mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-06-07 22:53:26 +03:00
asking and skipping to the next google result page if no usable links found
This commit is contained in:
parent
1c633b7351
commit
4eeeb3655e
|
@ -420,31 +420,43 @@ def __setGoogleDorking():
|
||||||
googleObj = Google(handlers)
|
googleObj = Google(handlers)
|
||||||
googleObj.getCookie()
|
googleObj.getCookie()
|
||||||
|
|
||||||
matches = googleObj.search(conf.googleDork)
|
def search():
|
||||||
|
matches = googleObj.search(conf.googleDork)
|
||||||
|
|
||||||
if not matches:
|
if not matches:
|
||||||
errMsg = "unable to find results for your "
|
errMsg = "unable to find results for your "
|
||||||
errMsg += "Google dork expression"
|
errMsg += "Google dork expression"
|
||||||
raise sqlmapGenericException, errMsg
|
raise sqlmapGenericException, errMsg
|
||||||
|
|
||||||
googleObj.getTargetUrls()
|
googleObj.getTargetUrls()
|
||||||
|
return matches
|
||||||
|
|
||||||
if kb.targetUrls:
|
while True:
|
||||||
infoMsg = "sqlmap got %d results for your " % len(matches)
|
matches = search()
|
||||||
infoMsg += "Google dork expression, "
|
if kb.targetUrls:
|
||||||
|
infoMsg = "sqlmap got %d results for your " % len(matches)
|
||||||
|
infoMsg += "Google dork expression, "
|
||||||
|
|
||||||
|
if len(matches) == len(kb.targetUrls):
|
||||||
|
infoMsg += "all "
|
||||||
|
else:
|
||||||
|
infoMsg += "%d " % len(kb.targetUrls)
|
||||||
|
|
||||||
|
infoMsg += "of them are testable targets"
|
||||||
|
logger.info(infoMsg)
|
||||||
|
break
|
||||||
|
|
||||||
if len(matches) == len(kb.targetUrls):
|
|
||||||
infoMsg += "all "
|
|
||||||
else:
|
else:
|
||||||
infoMsg += "%d " % len(kb.targetUrls)
|
message = "sqlmap got %d results " % len(matches)
|
||||||
|
message += "for your Google dork expression, but none of them "
|
||||||
|
message += "have GET parameters to test for SQL injection. "
|
||||||
|
message += "do you want to skip to the next result page? [Y/n]"
|
||||||
|
test = readInput(message, default="Y")
|
||||||
|
|
||||||
infoMsg += "of them are testable targets"
|
if test[0] in ("n", "N"):
|
||||||
logger.info(infoMsg)
|
raise sqlmapSilentQuitException
|
||||||
else:
|
else:
|
||||||
errMsg = "sqlmap got %d results " % len(matches)
|
conf.googlePage += 1
|
||||||
errMsg += "for your Google dork expression, but none of them "
|
|
||||||
errMsg += "have GET parameters to test for SQL injection"
|
|
||||||
raise sqlmapGenericException, errMsg
|
|
||||||
|
|
||||||
def __setBulkMultipleTargets():
|
def __setBulkMultipleTargets():
|
||||||
if not conf.bulkFile:
|
if not conf.bulkFile:
|
||||||
|
|
|
@ -503,7 +503,7 @@ def cmdLineParser():
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
help="Parse and test forms on target url")
|
help="Parse and test forms on target url")
|
||||||
|
|
||||||
miscellaneous.add_option("--gpage", dest="googlePage", type="int",
|
miscellaneous.add_option("--gpage", dest="googlePage", default=1, type="int",
|
||||||
help="Use Google dork results from specified page number")
|
help="Use Google dork results from specified page number")
|
||||||
|
|
||||||
miscellaneous.add_option("--mobile", dest="mobile",
|
miscellaneous.add_option("--mobile", dest="mobile",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user