@@ -113,7 +113,7 @@ def getApps(webPort,victim,uri,https,verb,requestHeaders, args = None):
113
113
if appUp == True :
114
114
115
115
if args == None :
116
- sizeSelect = not injectSize . isdigit ()
116
+ sizeSelect = True
117
117
118
118
while sizeSelect :
119
119
injectSize = raw_input ("Baseline test-Enter random string size: " )
@@ -389,7 +389,7 @@ def getResponseBodyHandlingErrors(req):
389
389
return responseBody
390
390
391
391
392
- def postApps (victim ,webPort ,uri ,https ,verb ,postData ,requestHeaders ):
392
+ def postApps (victim ,webPort ,uri ,https ,verb ,postData ,requestHeaders , args = None ):
393
393
print "Web App Attacks (POST)"
394
394
print "==============="
395
395
paramName = []
@@ -468,17 +468,22 @@ def postApps(victim,webPort,uri,https,verb,postData,requestHeaders):
468
468
raw_input ("Something went wrong. Press enter to return to the main menu..." )
469
469
return
470
470
471
+ if args == None :
472
+ sizeSelect = True
471
473
472
- sizeSelect = (args == None )
473
- injectSize = 1000
474
+ while sizeSelect :
475
+ injectSize = raw_input ("Baseline test-Enter random string size: " )
476
+ sizeSelect = not injectSize .isdigit ()
477
+ if sizeSelect :
478
+ print "Invalid! The size should be an integer."
474
479
475
- while sizeSelect :
476
- injectSize = raw_input ("Baseline test-Enter random string size: " )
477
- sizeSelect = not injectSize .isdigit ()
478
- if sizeSelect :
479
- print "Invalid! The size should be an integer."
480
+ format = randInjString (int (injectSize ))
481
+ else :
482
+ injectSize = int (args .injectSize )
483
+ format = args .injectFormat
484
+
485
+ injectString = build_random_string (format , injectSize )
480
486
481
- injectString = randInjString (int (injectSize ))
482
487
print "Using " + injectString + " for injection testing.\n "
483
488
484
489
# Build a random string and insert; if the app handles input correctly, a random string and injected code should be treated the same.
@@ -747,8 +752,8 @@ def postApps(victim,webPort,uri,https,verb,postData,requestHeaders):
747
752
else :
748
753
savePath = args .savePath
749
754
save_to (savePath , vulnAddrs , possAddrs , strTbAttack ,intTbAttack )
750
-
751
- raw_input ("Press enter to continue..." )
755
+ if args == None :
756
+ raw_input ("Press enter to continue..." )
752
757
return ()
753
758
754
759
0 commit comments