Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19d8733

Browse files
committed
this is strictly for educational purposes
1 parent c948bce commit 19d8733

4 files changed

Lines changed: 384 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ def setPaths():
660660
paths.COMMON_COLUMNS = os.path.join(paths.SQLMAP_TXT_PATH, "common-columns.txt")
661661
paths.COMMON_TABLES = os.path.join(paths.SQLMAP_TXT_PATH, "common-tables.txt")
662662
paths.COMMON_OUTPUTS = os.path.join(paths.SQLMAP_TXT_PATH, 'common-outputs.txt')
663+
paths.DORKS = os.path.join(paths.SQLMAP_TXT_PATH, "dorks.txt")
663664
paths.SQL_KEYWORDS = os.path.join(paths.SQLMAP_TXT_PATH, "keywords.txt")
664665
paths.ORACLE_DEFAULT_PASSWD = os.path.join(paths.SQLMAP_TXT_PATH, "oracle-default-passwords.txt")
665666
paths.WORDLIST = os.path.join(paths.SQLMAP_TXT_PATH, "wordlist.txt")

lib/core/option.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,20 @@ def __setRequestFromFile():
302302

303303
__feedTargetsDict(conf.requestFile, addedTargetUrls)
304304

305+
def __setScriptKiddie():
306+
"""
307+
This function sets a random google dork
308+
"""
309+
if not conf.scriptKiddie or conf.url or conf.list or conf.requestFile or conf.googleDork:
310+
return
311+
312+
dorks = getFileItems(paths.DORKS)
313+
conf.googleDork = "inurl:%s" % dorks[randomRange(0, len(dorks) - 1)]
314+
conf.multipleTargets = True
315+
316+
logMsg = "setting random google dork to: '%s'" % conf.googleDork
317+
logger.info(logMsg)
318+
305319
def __setGoogleDorking():
306320
"""
307321
This function checks if the way to request testable hosts is through
@@ -1379,7 +1393,7 @@ def init(inputOptions=advancedDict()):
13791393
parseTargetUrl()
13801394
parseTargetDirect()
13811395

1382-
if conf.url or conf.list or conf.requestFile or conf.googleDork or conf.liveTest:
1396+
if conf.url or conf.list or conf.requestFile or conf.googleDork or conf.liveTest or conf.scriptKiddie:
13831397
__setHTTPTimeout()
13841398
__setHTTPExtraHeaders()
13851399
__setHTTPCookies()
@@ -1390,6 +1404,7 @@ def init(inputOptions=advancedDict()):
13901404
__setHTTPProxy()
13911405
__setSafeUrl()
13921406
__setUnion()
1407+
__setScriptKiddie()
13931408
__setGoogleDorking()
13941409
__urllib2Opener()
13951410
__findPageForms()

lib/parse/cmdline.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,8 @@ def cmdLineParser():
560560
(args, _) = parser.parse_args(args)
561561

562562
if not args.direct and not args.url and not args.list and not args.googleDork and not args.configFile\
563-
and not args.requestFile and not args.updateAll and not args.smokeTest and not args.liveTest:
563+
and not args.requestFile and not args.updateAll and not args.smokeTest and not args.liveTest\
564+
and not args.scriptKiddie:
564565
errMsg = "missing a mandatory parameter ('-d', '-u', '-l', '-r', '-g', '-c' or '--update'), "
565566
errMsg += "-h for help"
566567
parser.error(errMsg)

0 commit comments

Comments
 (0)