I've got very interesting findings. I created a program in C# that writes to a file whatever it is passed as arguments, separating each one with a new line.
Running r4896:
WriteLines1:
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306
WriteLines2:
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306
Running r4545:
WriteLines1:
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306
WriteLines2:
C:\Users\Ivan\ArgumentsLogger.exe
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3321:finalhostname:3306
Running from command line:
(C:\Users\Ivan\ArgumentsLogger.exe -ssh username123@sshhost -pw pas
sword123 -P 22 -i "C:\gfhf private_key.ppk" -N -L 3328:finalhostname:3306)
WriteLines1:
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3328:finalhostname:3306
WriteLines2:
C:\Users\Ivan\ArgumentsLogger.exe
-ssh
username123@sshhost
-pw
password123
-P
22
-i
C:\gfhf private_key.ppk
-N
-L
3328:finalhostname:3306
Do you notice how with the new version it changes compared to the old version and using the command prompt?
This is the code of the C# program:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ArgumentsLogger
{
class Program
{
static void Main(string[] args)
{
String[] arguments = Environment.GetCommandLineArgs();
System.IO.File.WriteAllLines(@"C:\Users\Ivan\WriteLines1.txt", args);
System.IO.File.WriteAllLines(@"C:\Users\Ivan\WriteLines2.txt", arguments);
}
}
}