@@ -1367,18 +1367,18 @@ def _randomizeParameter(paramString, randomParameter):
1367
1367
1368
1368
for variable in list (variables .keys ()):
1369
1369
if unsafeVariableNaming (variable ) != variable :
1370
- value = variables [variable ]
1370
+ entry = variables [variable ]
1371
1371
del variables [variable ]
1372
- variables [unsafeVariableNaming (variable )] = value
1372
+ variables [unsafeVariableNaming (variable )] = entry
1373
1373
1374
1374
uri = variables ["uri" ]
1375
1375
cookie = variables ["cookie" ]
1376
1376
1377
- for name , value in variables .items ():
1378
- if name != "__builtins__" and originals .get (name , "" ) != value :
1379
- if isinstance (value , (int , float , six .string_types , six .binary_type )):
1377
+ for name , entry in variables .items ():
1378
+ if name != "__builtins__" and originals .get (name , "" ) != entry :
1379
+ if isinstance (entry , (int , float , six .string_types , six .binary_type )):
1380
1380
found = False
1381
- value = getUnicode (value , UNICODE_ENCODING )
1381
+ entry = getUnicode (entry , UNICODE_ENCODING )
1382
1382
1383
1383
if kb .postHint == POST_HINT .MULTIPART :
1384
1384
boundary = "--%s" % re .search (r"boundary=([^\s]+)" , contentType ).group (1 )
@@ -1396,18 +1396,18 @@ def _randomizeParameter(paramString, randomParameter):
1396
1396
found = True
1397
1397
first = match .group (0 )
1398
1398
second = part [len (first ):]
1399
- second = re .sub (r"(?s).+?(\r?\n?\-*\Z)" , r"%s\g<1>" % re .escape (value ), second )
1399
+ second = re .sub (r"(?s).+?(\r?\n?\-*\Z)" , r"%s\g<1>" % re .escape (entry ), second )
1400
1400
parts [i ] = "%s%s" % (first , second )
1401
1401
post = boundary .join (parts )
1402
1402
1403
1403
elif kb .postHint and re .search (r"\b%s\b" % re .escape (name ), post or "" ):
1404
1404
if kb .postHint in (POST_HINT .XML , POST_HINT .SOAP ):
1405
1405
if re .search (r"<%s\b" % re .escape (name ), post ):
1406
1406
found = True
1407
- post = re .sub (r"(?s)(<%s\b[^>]*>)(.*?)(</%s)" % (re .escape (name ), re .escape (name )), r"\g<1>%s\g<3>" % value .replace ('\\ ' , r'\\' ), post )
1407
+ post = re .sub (r"(?s)(<%s\b[^>]*>)(.*?)(</%s)" % (re .escape (name ), re .escape (name )), r"\g<1>%s\g<3>" % entry .replace ('\\ ' , r'\\' ), post )
1408
1408
elif re .search (r"\b%s>" % re .escape (name ), post ):
1409
1409
found = True
1410
- post = re .sub (r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re .escape (name ), re .escape (name )), r"\g<1>%s\g<3>" % value .replace ('\\ ' , r'\\' ), post )
1410
+ post = re .sub (r"(?s)(\b%s>)(.*?)(</[^<]*\b%s>)" % (re .escape (name ), re .escape (name )), r"\g<1>%s\g<3>" % entry .replace ('\\ ' , r'\\' ), post )
1411
1411
1412
1412
elif kb .postHint in (POST_HINT .JSON , POST_HINT .JSON_LIKE ):
1413
1413
match = re .search (r"['\"]%s['\"]:" % re .escape (name ), post )
@@ -1417,45 +1417,45 @@ def _randomizeParameter(paramString, randomParameter):
1417
1417
match = re .search (r"(%s%s%s:\s*)(\d+|%s[^%s]*%s)" % (quote , re .escape (name ), quote , quote , quote , quote ), post )
1418
1418
if match :
1419
1419
found = True
1420
- post = post .replace (match .group (0 ), "%s%s" % (match .group (1 ), value if value .isdigit () else "%s%s%s" % (match .group (0 )[0 ], value , match .group (0 )[0 ])))
1420
+ post = post .replace (match .group (0 ), "%s%s" % (match .group (1 ), entry if entry .isdigit () else "%s%s%s" % (match .group (0 )[0 ], entry , match .group (0 )[0 ])))
1421
1421
post = post .replace (BOUNDARY_BACKSLASH_MARKER , "\\ %s" % quote )
1422
1422
1423
1423
regex = r"\b(%s)\b([^\w]+)(\w+)" % re .escape (name )
1424
1424
if not found and re .search (regex , (post or "" )):
1425
1425
found = True
1426
- post = re .sub (regex , r"\g<1>\g<2>%s" % value .replace ('\\ ' , r'\\' ), post )
1426
+ post = re .sub (regex , r"\g<1>\g<2>%s" % entry .replace ('\\ ' , r'\\' ), post )
1427
1427
1428
1428
regex = r"((\A|%s)%s=).+?(%s|\Z)" % (re .escape (delimiter ), re .escape (name ), re .escape (delimiter ))
1429
1429
if not found and re .search (regex , (post or "" )):
1430
1430
found = True
1431
- post = re .sub (regex , r"\g<1>%s\g<3>" % value .replace ('\\ ' , r'\\' ), post )
1431
+ post = re .sub (regex , r"\g<1>%s\g<3>" % entry .replace ('\\ ' , r'\\' ), post )
1432
1432
1433
1433
if re .search (regex , (get or "" )):
1434
1434
found = True
1435
- get = re .sub (regex , r"\g<1>%s\g<3>" % value .replace ('\\ ' , r'\\' ), get )
1435
+ get = re .sub (regex , r"\g<1>%s\g<3>" % entry .replace ('\\ ' , r'\\' ), get )
1436
1436
1437
1437
if re .search (regex , (query or "" )):
1438
1438
found = True
1439
- uri = re .sub (regex .replace (r"\A" , r"\?" ), r"\g<1>%s\g<3>" % value .replace ('\\ ' , r'\\' ), uri )
1439
+ uri = re .sub (regex .replace (r"\A" , r"\?" ), r"\g<1>%s\g<3>" % entry .replace ('\\ ' , r'\\' ), uri )
1440
1440
1441
1441
regex = r"((\A|%s\s*)%s=).+?(%s|\Z)" % (re .escape (conf .cookieDel or DEFAULT_COOKIE_DELIMITER ), re .escape (name ), re .escape (conf .cookieDel or DEFAULT_COOKIE_DELIMITER ))
1442
1442
if re .search (regex , (cookie or "" )):
1443
1443
found = True
1444
- cookie = re .sub (regex , r"\g<1>%s\g<3>" % value .replace ('\\ ' , r'\\' ), cookie )
1444
+ cookie = re .sub (regex , r"\g<1>%s\g<3>" % entry .replace ('\\ ' , r'\\' ), cookie )
1445
1445
1446
1446
if not found :
1447
1447
if post is not None :
1448
1448
if kb .postHint in (POST_HINT .JSON , POST_HINT .JSON_LIKE ):
1449
1449
match = re .search (r"['\"]" , post )
1450
1450
if match :
1451
1451
quote = match .group (0 )
1452
- post = re .sub (r"\}\Z" , "%s%s}" % (',' if re .search (r"\w" , post ) else "" , "%s%s%s:%s" % (quote , name , quote , value if value .isdigit () else "%s%s%s" % (quote , value , quote ))), post )
1452
+ post = re .sub (r"\}\Z" , "%s%s}" % (',' if re .search (r"\w" , post ) else "" , "%s%s%s:%s" % (quote , name , quote , entry if entry .isdigit () else "%s%s%s" % (quote , entry , quote ))), post )
1453
1453
else :
1454
- post += "%s%s=%s" % (delimiter , name , value )
1454
+ post += "%s%s=%s" % (delimiter , name , entry )
1455
1455
elif get is not None :
1456
- get += "%s%s=%s" % (delimiter , name , value )
1456
+ get += "%s%s=%s" % (delimiter , name , entry )
1457
1457
elif cookie is not None :
1458
- cookie += "%s%s=%s" % (conf .cookieDel or DEFAULT_COOKIE_DELIMITER , name , value )
1458
+ cookie += "%s%s=%s" % (conf .cookieDel or DEFAULT_COOKIE_DELIMITER , name , entry )
1459
1459
1460
1460
if not conf .skipUrlEncode :
1461
1461
get = urlencode (get , limit = True )
@@ -1482,8 +1482,8 @@ def _randomizeParameter(paramString, randomParameter):
1482
1482
dataToStdout (warnMsg )
1483
1483
1484
1484
while len (kb .responseTimes [kb .responseTimeMode ]) < MIN_TIME_RESPONSES :
1485
- value = kb .responseTimePayload .replace (RANDOM_INTEGER_MARKER , str (randomInt (6 ))).replace (RANDOM_STRING_MARKER , randomStr ()) if kb .responseTimePayload else kb .responseTimePayload
1486
- Connect .queryPage (value = value , content = True , raise404 = False )
1485
+ _ = kb .responseTimePayload .replace (RANDOM_INTEGER_MARKER , str (randomInt (6 ))).replace (RANDOM_STRING_MARKER , randomStr ()) if kb .responseTimePayload else kb .responseTimePayload
1486
+ Connect .queryPage (value = _ , content = True , raise404 = False )
1487
1487
dataToStdout ('.' )
1488
1488
1489
1489
dataToStdout (" (done)\n " )
0 commit comments