Last active
August 29, 2015 14:23
-
-
Save paralax/4735f7aa876d58add3c4 to your computer and use it in GitHub Desktop.
describe honeypot tools for awesome list
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
import csv | |
import re | |
import urllib | |
with open('/Users/josen/Downloads/Honeynet Project Tools - Sheet1.csv', 'rb') as csvfile: | |
reader = csv.reader(csvfile) | |
pots = {} | |
for tool, typ, _, _, _, url, _ in reader: | |
pots[typ.strip()] = ['[%s](%s)' % (tool, url)] + pots.get(typ.strip(), []) | |
for k,v in pots.iteritems(): | |
print '- %s' % k | |
for vv in v: | |
print ' - %s' % vv | |
def describe(url): | |
try: | |
html = filter(lambda x: 'meta name="description"' in x, urllib.urlopen(url).read().splitlines())[0] | |
descr = re.findall('<meta name="description" content="(.+)">', html)[0] | |
except IndexError: | |
descr = '' | |
return '[%s](%s) %s' % (url.split('/')[-1], url, descr) | |
for k,vs in pots.iteritems(): | |
for v in vs: | |
if 'github.com/' in v: | |
print describe(v) | |
else: | |
print v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment