Delete tools/http-repeater.yaml

This commit is contained in:
公明
2025-11-24 00:42:49 +08:00
committed by GitHub
parent 138119a6a8
commit 510c1bb2d0

View File

@@ -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"