mirror of
https://github.com/paralax/awesome-honeypots.git
synced 2024-10-01 06:35:45 -04:00
checks URLs
This commit is contained in:
parent
29c2330667
commit
917ede49dd
19
awesome-check.py
Executable file
19
awesome-check.py
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import re
|
||||
import sys
|
||||
import urllib2
|
||||
|
||||
with open(sys.argv[1], 'r') as f:
|
||||
for line in f.readlines():
|
||||
if '](http' in line:
|
||||
for url in re.findall("(http[s?]://[^)]+)", line):
|
||||
# print url
|
||||
try:
|
||||
request = urllib2.Request(url)
|
||||
request.get_method = lambda : 'HEAD'
|
||||
resp = urllib2.urlopen(request)
|
||||
if resp.getcode() != 200:
|
||||
print 'ERROR - ', line
|
||||
except urllib2.URLError, e:
|
||||
print e, line
|
Loading…
Reference in New Issue
Block a user