mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-03-31 00:09:29 +02:00
Delete tools/http-repeater.yaml
This commit is contained in:
@@ -1,81 +0,0 @@
|
||||
name: "http-repeater"
|
||||
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: |
|
||||
以JSON描述请求细节(URL/方法/头/正文),运行时可重复发送并查看响应。
|
||||
parameters:
|
||||
- name: "request_spec"
|
||||
type: "string"
|
||||
description: "请求规范(JSON格式),支持 url, method, headers, cookies, data/json"
|
||||
required: true
|
||||
position: 0
|
||||
format: "positional"
|
||||
- name: "repeat"
|
||||
type: "int"
|
||||
description: "重复发送次数(默认1)"
|
||||
required: false
|
||||
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