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

Function _findPageForms

lib/core/option.py:484–530  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

482 logger.warning(warnMsg)
483
484def _findPageForms():
485 if not conf.forms or conf.crawlDepth:
486 return
487
488 if conf.url and not checkConnection():
489 return
490
491 found = False
492 infoMsg = "searching for forms"
493 logger.info(infoMsg)
494
495 if not any((conf.bulkFile, conf.googleDork)):
496 page, _, _ = Request.queryPage(content=True, ignoreSecondOrder=True)
497 if findPageForms(page, conf.url, True, True):
498 found = True
499 else:
500 if conf.bulkFile:
501 targets = getFileItems(conf.bulkFile)
502 elif conf.googleDork:
503 targets = [_[0] for _ in kb.targets]
504 kb.targets.clear()
505 else:
506 targets = []
507
508 for i in xrange(len(targets)):
509 try:
510 target = targets[i].strip()
511
512 if not re.search(r"(?i)\Ahttp[s]*://", target):
513 target = "http://%s" % target
514
515 page, _, _ = Request.getPage(url=target.strip(), cookie=conf.cookie, crawling=True, raise404=False)
516 if findPageForms(page, target, False, True):
517 found = True
518
519 if conf.verbose in (1, 2):
520 status = '%d/%d links visited (%d%%)' % (i + 1, len(targets), round(100.0 * (i + 1) / len(targets)))
521 dataToStdout("\r[%s] [INFO] %s" % (time.strftime("%X"), status), True)
522 except KeyboardInterrupt:
523 break
524 except Exception as ex:
525 errMsg = "problem occurred while searching for forms at '%s' ('%s')" % (target, getSafeExString(ex))
526 logger.error(errMsg)
527
528 if not found:
529 warnMsg = "no forms found"
530 logger.warning(warnMsg)
531
532def _setDBMSAuthentication():
533 """

Callers 1

initFunction · 0.85

Calls 13

checkConnectionFunction · 0.90
findPageFormsFunction · 0.90
getFileItemsFunction · 0.90
roundFunction · 0.90
dataToStdoutFunction · 0.90
getSafeExStringFunction · 0.90
xrangeClass · 0.85
infoMethod · 0.80
queryPageMethod · 0.80
getPageMethod · 0.80
clearMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…