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

Function checkDynamicContent

lib/controller/checks.py:1187–1241  ·  view source on GitHub ↗

This function checks for the dynamic content in the provided pages

(firstPage, secondPage)

Source from the content-addressed store, hash-verified

1185 return result
1186
1187def checkDynamicContent(firstPage, secondPage):
1188 """
1189 This function checks for the dynamic content in the provided pages
1190 """
1191
1192 if kb.nullConnection:
1193 debugMsg = "dynamic content checking skipped "
1194 debugMsg += "because NULL connection used"
1195 logger.debug(debugMsg)
1196 return
1197
1198 if any(page is None for page in (firstPage, secondPage)):
1199 warnMsg = "can't check dynamic content "
1200 warnMsg += "because of lack of page content"
1201 logger.critical(warnMsg)
1202 return
1203
1204 if firstPage and secondPage and any(len(_) > MAX_DIFFLIB_SEQUENCE_LENGTH for _ in (firstPage, secondPage)):
1205 ratio = None
1206 else:
1207 try:
1208 seqMatcher = getCurrentThreadData().seqMatcher
1209 seqMatcher.set_seq1(firstPage)
1210 seqMatcher.set_seq2(secondPage)
1211 ratio = seqMatcher.quick_ratio()
1212 except MemoryError:
1213 ratio = None
1214
1215 if ratio is None:
1216 kb.skipSeqMatcher = True
1217
1218 # In case of an intolerable difference turn on dynamicity removal engine
1219 elif ratio <= UPPER_RATIO_BOUND:
1220 findDynamicContent(firstPage, secondPage)
1221
1222 count = 0
1223 while not Request.queryPage():
1224 count += 1
1225
1226 if count > conf.retries:
1227 warnMsg = "target URL content appears to be too dynamic. "
1228 warnMsg += "Switching to '--text-only' "
1229 logger.warning(warnMsg)
1230
1231 conf.textOnly = True
1232 return
1233
1234 warnMsg = "target URL content appears to be heavily dynamic. "
1235 warnMsg += "sqlmap is going to retry the request(s)"
1236 singleTimeLogMessage(warnMsg, logging.CRITICAL)
1237
1238 kb.heavilyDynamic = True
1239
1240 secondPage, _, _ = Request.queryPage(content=True)
1241 findDynamicContent(firstPage, secondPage)
1242
1243def checkStability():
1244 """

Callers 1

checkStabilityFunction · 0.85

Calls 5

getCurrentThreadDataFunction · 0.90
findDynamicContentFunction · 0.90
singleTimeLogMessageFunction · 0.90
debugMethod · 0.80
queryPageMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…