aboutsummaryrefslogtreecommitdiffstats
path: root/toys/pphidden_async.py
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-04-17 06:47:45 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-04-17 06:47:45 +0200
commit7bc3eba021a8628c37a04bde60265f6cb2ba46ae (patch)
treeb31fe25fdeac7aa59485b4ebcaf55d6bf935e67a /toys/pphidden_async.py
parentpphidden_async: use grbrute (diff)
downloadlaurent-tools-7bc3eba021a8628c37a04bde60265f6cb2ba46ae.tar.xz
laurent-tools-7bc3eba021a8628c37a04bde60265f6cb2ba46ae.zip
grbrute: fix event processing interuption by user
now when the user callback return False it stops grbrute
Diffstat (limited to '')
-rw-r--r--toys/pphidden_async.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/toys/pphidden_async.py b/toys/pphidden_async.py
index 229a181..1b6a576 100644
--- a/toys/pphidden_async.py
+++ b/toys/pphidden_async.py
@@ -27,10 +27,13 @@ class Pp_url:
return res
def cb_response(res):
- print "[-] %s : %d" % (res.url, res.status_code)
+ global found
+ if not found:
+ print "[-] %s : %d" % (res.url, res.status_code)
if res.status_code != 404:
- print "[*] found: %s" % res.url
- sys.exit(0)
+ found = res.url
+ return False
+ return True
parser = argparse.ArgumentParser(description='pphidden_async',
epilog="Example: %s 73 0 0" % sys.argv[0])
@@ -44,7 +47,10 @@ parser.add_argument('-v', action="store_true", dest="verbose", default=False,
help="verbose")
args = parser.parse_args()
+found = None
url_iter = Pp_url(args.image, args.start_x, args.start_y)
grbrute.Grbrute(url_iter, cb_response, verbose=args.verbose)
-print "[*] not found"
-sys.exit(1)
+if found is False:
+ print "[*] not found"
+ sys.exit(1)
+print "[*] found: %s" % found