mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-18 08:57:18 +02:00
Add files via upload
This commit is contained in:
+72
-32
@@ -1,41 +1,81 @@
|
||||
name: "http-repeater"
|
||||
command: "curl"
|
||||
command: "python3"
|
||||
args:
|
||||
- "-c"
|
||||
- |
|
||||
import json
|
||||
import sys
|
||||
import textwrap
|
||||
|
||||
import requests
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
sys.stderr.write("缺少 request_spec 参数\n")
|
||||
sys.exit(1)
|
||||
|
||||
spec_raw = sys.argv[1]
|
||||
repeat = int(sys.argv[2]) if len(sys.argv) > 2 and sys.argv[2] else 1
|
||||
delay = float(sys.argv[3]) if len(sys.argv) > 3 and sys.argv[3] else 0.0
|
||||
|
||||
try:
|
||||
spec = json.loads(spec_raw)
|
||||
except json.JSONDecodeError as exc:
|
||||
sys.stderr.write(f"请求规范解析失败: {exc}\n")
|
||||
sys.exit(1)
|
||||
|
||||
url = spec.get("url")
|
||||
if not url:
|
||||
sys.stderr.write("request_spec 中缺少 url 字段\n")
|
||||
sys.exit(1)
|
||||
|
||||
method = spec.get("method", "GET").upper()
|
||||
headers = spec.get("headers") or {}
|
||||
cookies = spec.get("cookies") or {}
|
||||
data = spec.get("data")
|
||||
json_data = spec.get("json")
|
||||
|
||||
session = requests.Session()
|
||||
|
||||
for idx in range(repeat):
|
||||
response = session.request(
|
||||
method,
|
||||
url,
|
||||
headers=headers,
|
||||
cookies=cookies,
|
||||
data=data,
|
||||
json=json_data,
|
||||
allow_redirects=False,
|
||||
)
|
||||
print(f"===== Response #{idx + 1} =====")
|
||||
print(f"Status: {response.status_code}")
|
||||
print(f"Headers:\n{textwrap.indent(str(dict(response.headers)), ' ')}")
|
||||
print("Body:")
|
||||
print(response.text)
|
||||
if delay and idx + 1 < repeat:
|
||||
import time
|
||||
time.sleep(delay)
|
||||
enabled: true
|
||||
|
||||
short_description: "发送精心制作的HTTP请求(Burp Repeater等效)"
|
||||
|
||||
description: |
|
||||
发送精心制作的HTTP请求,类似于Burp Suite的Repeater功能。
|
||||
|
||||
**主要功能:**
|
||||
- 请求重放
|
||||
- 请求修改
|
||||
- 响应查看
|
||||
- 多次发送
|
||||
|
||||
**使用场景:**
|
||||
- HTTP请求测试
|
||||
- 请求重放
|
||||
- 安全测试
|
||||
- 漏洞验证
|
||||
|
||||
以JSON描述请求细节(URL/方法/头/正文),运行时可重复发送并查看响应。
|
||||
parameters:
|
||||
- name: "request_spec"
|
||||
type: "string"
|
||||
description: "请求规范(JSON格式,包含url, method, headers, cookies, data)"
|
||||
description: "请求规范(JSON格式),支持 url, method, headers, cookies, data/json"
|
||||
required: true
|
||||
|
||||
- name: "additional_args"
|
||||
type: "string"
|
||||
description: |
|
||||
额外的http-repeater参数。用于传递未在参数列表中定义的http-repeater选项。
|
||||
|
||||
**示例值:**
|
||||
- 根据工具特性添加常用参数示例
|
||||
|
||||
**注意事项:**
|
||||
- 多个参数用空格分隔
|
||||
- 确保参数格式正确,避免命令注入
|
||||
- 此参数会直接追加到命令末尾
|
||||
position: 0
|
||||
format: "positional"
|
||||
- name: "repeat"
|
||||
type: "int"
|
||||
description: "重复发送次数(默认1)"
|
||||
required: false
|
||||
format: "positional"
|
||||
default: 1
|
||||
position: 1
|
||||
format: "positional"
|
||||
- name: "delay"
|
||||
type: "string"
|
||||
description: "重复发送的间隔秒数(默认0)"
|
||||
required: false
|
||||
default: "0"
|
||||
position: 2
|
||||
format: "positional"
|
||||
|
||||
Reference in New Issue
Block a user