MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _randomFillBlankFields

Function _randomFillBlankFields

lib/controller/controller.py:197–213  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

195 logger.warning(warnMsg)
196
197def _randomFillBlankFields(value):
198 retVal = value
199
200 if extractRegexResult(EMPTY_FORM_FIELDS_REGEX, value):
201 message = "do you want to fill blank fields with random values? [Y/n] "
202
203 if readInput(message, default='Y', boolean=True):
204 for match in re.finditer(EMPTY_FORM_FIELDS_REGEX, retVal):
205 item = match.group("result")
206 if not any(_ in item for _ in IGNORE_PARAMETERS) and not re.search(ASP_NET_CONTROL_REGEX, item):
207 newValue = randomStr() if not re.search(r"^id|id$", item, re.I) else randomInt()
208 if item[-1] == DEFAULT_GET_POST_DELIMITER:
209 retVal = retVal.replace(item, "%s%s%s" % (item[:-1], newValue, DEFAULT_GET_POST_DELIMITER))
210 else:
211 retVal = retVal.replace(item, "%s%s" % (item, newValue))
212
213 return retVal
214
215def _saveToHashDB():
216 injections = hashDBRetrieve(HASHDB_KEYS.KB_INJECTIONS, True)

Callers 1

startFunction · 0.85

Calls 6

extractRegexResultFunction · 0.90
readInputFunction · 0.90
randomStrFunction · 0.90
randomIntFunction · 0.90
searchMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…