Works in Unix (Ubuntu). Check for command separator was not present in the exec.
git-svn-id: http://webgoat.googlecode.com/svn/trunk@452 4033779f-a91e-0410-96ef-6bf7bf53c507
This commit is contained in:
parent
0c0483b1ac
commit
202469b6f3
@ -244,7 +244,8 @@ public class CommandInjection extends LessonAdapter
|
|||||||
{
|
{
|
||||||
System.out.println("Executing OS command: " + Arrays.asList(command));
|
System.out.println("Executing OS command: " + Arrays.asList(command));
|
||||||
ExecResults er = Exec.execSimple(command);
|
ExecResults er = Exec.execSimple(command);
|
||||||
if (!er.getError())
|
// the third argument (index 2) will have the command injection in it
|
||||||
|
if ((command[2].indexOf("&") != -1 || command[2].indexOf(";") != -1) && !er.getError())
|
||||||
{
|
{
|
||||||
makeSuccess(s);
|
makeSuccess(s);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user