From bd75fd26e98a68e0f3011bf4639e716d2dcdb224 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 23 Mar 2011 11:57:57 +0000 Subject: [PATCH] implementing a --page-rank switch as requested by l0rda@l0rda.biz --- doc/THANKS | 3 +++ lib/controller/controller.py | 2 +- lib/core/optiondict.py | 1 + lib/parse/cmdline.py | 6 +++++- sqlmap.conf | 6 +++++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/THANKS b/doc/THANKS index a19ed9602..3b4a53eab 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -267,6 +267,9 @@ Anastasios Monachos for providing some useful data for suggesting a feature +Kirill Morozov + for suggesting a feature + Alejo Murillo Moya for reporting a minor bug for suggesting a few features diff --git a/lib/controller/controller.py b/lib/controller/controller.py index 21b8b6db9..7422f0d6a 100644 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -201,7 +201,7 @@ def start(): if conf.forms: message = "[#%d] form:\n%s %s" % (hostCount, conf.method or HTTPMETHOD.GET, targetUrl) else: - message = "url %d:\n%s %s%s" % (hostCount, conf.method or HTTPMETHOD.GET, targetUrl, " (PageRank: %s)" % get_pagerank(targetUrl) if conf.googleDork else "") + message = "url %d:\n%s %s%s" % (hostCount, conf.method or HTTPMETHOD.GET, targetUrl, " (PageRank: %s)" % get_pagerank(targetUrl) if conf.googleDork and conf.pageRank else "") if conf.cookie: message += "\nCookie: %s" % conf.cookie diff --git a/lib/core/optiondict.py b/lib/core/optiondict.py index 88f87a82a..ad12f8e4e 100644 --- a/lib/core/optiondict.py +++ b/lib/core/optiondict.py @@ -160,6 +160,7 @@ optDict = { "checkPayload": "boolean", "cleanup": "boolean", "googlePage": "integer", + "pageRank": "boolean", "parseErrors": "boolean", "replicate": "boolean", "tor": "boolean", diff --git a/lib/parse/cmdline.py b/lib/parse/cmdline.py index 1cac94b77..15227de22 100644 --- a/lib/parse/cmdline.py +++ b/lib/parse/cmdline.py @@ -482,7 +482,11 @@ def cmdLineParser(): help="Parse and test forms on target url") miscellaneous.add_option("--gpage", dest="googlePage", type="int", - help="Use google dork results from specified page number") + help="Use Google dork results from specified page number") + + miscellaneous.add_option("--page-rank", dest="pageRank", + action="store_true", default=False, + help="Display page rank (PR) for Google dork results") miscellaneous.add_option("--parse-errors", dest="parseErrors", action="store_true", default=False, diff --git a/sqlmap.conf b/sqlmap.conf index c42c8fab0..811f63ca0 100644 --- a/sqlmap.conf +++ b/sqlmap.conf @@ -514,11 +514,15 @@ cleanup = False # Valid: True or False forms = False -# Use google dork results from specified page number. +# Use Google dork results from specified page number. # Valid: integer # Default: 1 googlePage = 1 +# Display page rank (PR) for Google dork results. +# Valid: True or False +pageRank = False + # Parse DBMS error messages from response pages. # Valid: True or False parseErrors = False