Skip to content

Instantly share code, notes, and snippets.

@pathcl
Created May 13, 2015 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pathcl/d5c71db64e9cedb6979e to your computer and use it in GitHub Desktop.
Save pathcl/d5c71db64e9cedb6979e to your computer and use it in GitHub Desktop.
google-hacks-scanner.py
#!/usr/bin/env python
import re
import sys
import google
import urllib2
if len(sys.argv) < 2:
print sys.argv[0] + ": <dict>"
sys.exit(1)
fh = open(sys.argv[1])
for word in fh.readlines():
print "\nSearching for " + word.strip()
results = google.search(word.strip())
try:
for link in results:
if re.search("youtube", link) == None: print link
except KeyError:
pass
except urllib2.HTTPError, e:
print "Google search failed: " + str(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment