BeichenDream / GodPotato

Apache License 2.0
1.8k stars 223 forks source link

Cannot use double quotes inside command #10

Open Pri3st opened 11 months ago

Pri3st commented 11 months ago

When I try to run more complex commands (e.g .\GodPotato.exe -cmd "cmd /c net localgroup "Remote Desktop Users"" the command fails.

beauknowstech commented 1 week ago

With your command, it assumes you are ending at the second double quote. So .\GodPotato.exe -cmd "cmd /c net localgroup "

Most programs you can use single quotes in addition to double quotes. In this case you will also have to escape the double quotes

.\GodPotato-NET4.exe -cmd 'cmd /c net localgroup \"Remote Desktop Users\"'

image

cmd /c didn't like using the single quotes around Remote Desktop Users

If you chose to use powershell -c instead of cmd /c this would also work: .\GodPotato-NET4.exe -cmd "powershell.exe -c net localgroup 'Remote Desktop Users'"

Also for future reference, I don't think you exactly need the cmd /c this command worked just fine for me: .\GodPotato-NET4.exe -cmd 'net localgroup \"Remote Desktop Users\"'

image

Hopefully that helps