Skip to content

Instantly share code, notes, and snippets.

@iam1980
Created March 29, 2017 13:58
Show Gist options
  • Save iam1980/62ee37e38c7f76ca5d3889379e1d81fd to your computer and use it in GitHub Desktop.
Save iam1980/62ee37e38c7f76ca5d3889379e1d81fd to your computer and use it in GitHub Desktop.
import subprocess
f = open('ips.txt', 'r')
flines = f.readlines()
vulnsrvs = 0
i = 1
for line in flines:
host = line.split(",")
ip = host[0].replace('\n','')
port = host[1].replace('\n','')
print "Try (" + str(i) +") "+ str(ip) +":" + str(port)
if port == "443":
#dont bother with SSL/TLS
continue
try:
myout = subprocess.check_output(['curl', '--connect-timeout', '2', '--max-time', '2', '-s','-I', '-X', 'PROPFIND','http://' + ip + ':' + port + '/' ])
print myout
if "HTTP/1.1 411 Length Required" in myout:
print "Found one:"
print myout
vulnsrvs += 1
except Exception, e:
print str(e.output)
i += 1
print "Vulnerable: " + str(vulnsrvs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment