Created
May 13, 2015 12:56
-
-
Save pathcl/d5c71db64e9cedb6979e to your computer and use it in GitHub Desktop.
google-hacks-scanner.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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