











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












Brute force example
String user_input ; Special_function_Sample(user_input) ;
user_input = “fred”; Special_function_Sample(fred)
User_input= fred”);print(“foo
Special_function_sample(“fred”); print(“foo”)
What if ….
Command injection vulnerabilities typically occur when:
Scope Effect
Access Control Command injection allows for the execution of arbitrary commands and code by the attacker
Integrity If a malicious user injects a character t delimits the end of one command and the beginning of another, it may be possible to then insert an entirely new and unrelated command that was not intended to be executed
Example 3 Language: Java
……. String script = System.getProperty("SCRIPTNAME"); if (script != null) System.exec(script); …….
Example4 Language: Perl use CGI qw(:standard); $name = param('name'); $nslookup = "/path/to/nslookup"; print header; if (open($fh, "$nslookup $name|")) { while (<$fh>) { print escapeHTML($_); print "
\n"; } close($fh); } Suppose an attacker provides a domain name like this:cwe.mitre.org%20%3B%20/bin/ls%20-l /path/to/nslookup cwe.mitre.org ; /bin/ls -l
Code Review (continue)
.):