@@ -61,8 +61,19 @@ def vulnTest():
6161 Runs the testing against 'vulnserver'
6262 """
6363
64+ TESTS = (
65+ ("--flush-session" , ("CloudFlare" ,)),
66+ ("--flush-session --data='{\" id\" : 1}' --banner" , ("Payload: {\" id\" " , "banner: '3" )),
67+ ("--flush-session --data='<root><param name=\" id\" value=\" 1*\" /></root>' --banner" , ("Payload: <root><param name=\" id\" value=\" 1" , "banner: '3" )),
68+ ("--flush-session --parse-errors --eval=\" id2=2\" --referer=\" localhost\" --cookie=\" PHPSESSID=d41d8cd98f00b204e9800998ecf8427e\" " , (": syntax error" , "Type: boolean-based blind" , "Type: time-based blind" , "Type: UNION query" , "back-end DBMS: SQLite" , "3 columns" )),
69+ ("--banner --schema --dump -T users --binary-fields=surname --where \" id>3\" " , ("banner: '3" , "INTEGER" , "TEXT" , "id" , "name" , "surname" , "2 entries" , "6E616D6569736E756C6C" )),
70+ ("--all --tamper=between,randomcase" , ("5 entries" , "luther" , "blisset" , "fluffy" , "179ad45c6ce2cb97cf1029e212046e81" , "NULL" , "nameisnull" , "testpass" )),
71+ ("-z \" tec=B\" --hex --fresh-queries --threads=4 --sql-query=\" SELECT 987654321\" " , ("length of query output" , ": '987654321'" ,)),
72+ ("--technique=T --fresh-queries --sql-query=\" SELECT 1234\" " , (": '1234'" ,)),
73+ )
74+
6475 retVal = True
65- count , length = 0 , 6
76+ count = 0
6677 address , port = "127.0.0.10" , random .randint (1025 , 65535 )
6778
6879 def _thread ():
@@ -73,15 +84,7 @@ def _thread():
7384 thread .daemon = True
7485 thread .start ()
7586
76- for options , checks in (
77- ("--flush-session" , ("CloudFlare" ,)),
78- ("--flush-session --data='{\" id\" : 1}' --banner" , ("Payload: {\" id\" " , "banner: '3" )),
79- ("--flush-session --parse-errors --eval=\" id2=2\" --referer=\" localhost\" --cookie=\" PHPSESSID=d41d8cd98f00b204e9800998ecf8427e\" " , (": syntax error" , "Type: boolean-based blind" , "Type: time-based blind" , "Type: UNION query" , "back-end DBMS: SQLite" , "3 columns" )),
80- ("--banner --schema --dump -T users --binary-fields=surname --where \" id>3\" " , ("banner: '3" , "INTEGER" , "TEXT" , "id" , "name" , "surname" , "2 entries" , "6E616D6569736E756C6C" )),
81- ("--all --tamper=between,randomcase" , ("5 entries" , "luther" , "blisset" , "fluffy" , "179ad45c6ce2cb97cf1029e212046e81" , "NULL" , "nameisnull" , "testpass" )),
82- ("-z \" tec=B\" --hex --fresh-queries --threads=4 --sql-query=\" SELECT 987654321\" " , ("length of query output" , ": '987654321'" ,)),
83- ("--technique=T --fresh-queries --sql-query=\" SELECT 1234\" " , (": '1234'" ,)),
84- ):
87+ for options , checks in TESTS :
8588 cmd = "%s %s -u http://%s:%d/?id=1 --batch %s" % (sys .executable , os .path .abspath (os .path .join (os .path .dirname (__file__ ), ".." , ".." , "sqlmap.py" )), address , port , options )
8689 output = shellExec (cmd )
8790
@@ -91,7 +94,7 @@ def _thread():
9194 retVal = False
9295
9396 count += 1
94- status = '%d/%d (%d%%) ' % (count , length , round (100.0 * count / length ))
97+ status = '%d/%d (%d%%) ' % (count , len ( TESTS ) , round (100.0 * count / len ( TESTS ) ))
9598 dataToStdout ("\r [%s] [INFO] complete: %s" % (time .strftime ("%X" ), status ))
9699
97100 clearConsoleLine ()
0 commit comments