@@ -420,31 +420,43 @@ def __setGoogleDorking():
420420 googleObj = Google (handlers )
421421 googleObj .getCookie ()
422422
423- matches = googleObj .search (conf .googleDork )
423+ def search ():
424+ matches = googleObj .search (conf .googleDork )
424425
425- if not matches :
426- errMsg = "unable to find results for your "
427- errMsg += "Google dork expression"
428- raise sqlmapGenericException , errMsg
426+ if not matches :
427+ errMsg = "unable to find results for your "
428+ errMsg += "Google dork expression"
429+ raise sqlmapGenericException , errMsg
429430
430- googleObj .getTargetUrls ()
431+ googleObj .getTargetUrls ()
432+ return matches
431433
432- if kb .targetUrls :
433- infoMsg = "sqlmap got %d results for your " % len (matches )
434- infoMsg += "Google dork expression, "
434+ while True :
435+ matches = search ()
436+ if kb .targetUrls :
437+ infoMsg = "sqlmap got %d results for your " % len (matches )
438+ infoMsg += "Google dork expression, "
435439
436- if len (matches ) == len (kb .targetUrls ):
437- infoMsg += "all "
438- else :
439- infoMsg += "%d " % len (kb .targetUrls )
440+ if len (matches ) == len (kb .targetUrls ):
441+ infoMsg += "all "
442+ else :
443+ infoMsg += "%d " % len (kb .targetUrls )
440444
441- infoMsg += "of them are testable targets"
442- logger .info (infoMsg )
443- else :
444- errMsg = "sqlmap got %d results " % len (matches )
445- errMsg += "for your Google dork expression, but none of them "
446- errMsg += "have GET parameters to test for SQL injection"
447- raise sqlmapGenericException , errMsg
445+ infoMsg += "of them are testable targets"
446+ logger .info (infoMsg )
447+ break
448+
449+ else :
450+ message = "sqlmap got %d results " % len (matches )
451+ message += "for your Google dork expression, but none of them "
452+ message += "have GET parameters to test for SQL injection. "
453+ message += "do you want to skip to the next result page? [Y/n]"
454+ test = readInput (message , default = "Y" )
455+
456+ if test [0 ] in ("n" , "N" ):
457+ raise sqlmapSilentQuitException
458+ else :
459+ conf .googlePage += 1
448460
449461def __setBulkMultipleTargets ():
450462 if not conf .bulkFile :
0 commit comments