-
Notifications
You must be signed in to change notification settings - Fork 234
/
php.py
30 lines (29 loc) · 888 Bytes
/
php.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,httplib
from optparse import OptionParser
usageString = "Usage: %prog [options] hostname"
parser = OptionParser(usage=usageString)
(opts,args) = parser.parse_args()
if len(args) < 1:
parser.error("Hostname is required")
print __doc__
file = sys.argv[1]
fobj = open(redis.txt,'r')
fileHandle = open('php.txt','a+')
for target in fobj:
website = target.strip()
#login path
dirs = ["phpinfo.php","php.php","test.php","1.php"]
for line in dirs:
conn = httplib.HTTPConnection(website)
conn.request('GET','/'+line)
r1 = conn.getresponse()
if r1.status == 200 or r1.status == 301 or r1.status == 403:
print website+'/'+line,r1.status,r1.reason
if not s.is_vul():
print 'NO vulerable'
#sys.exit(0)
else:
fileHandle.write(target)
print 'server is vulerable'