This tool extracts HTTP requests from an Excel file and converts them to GOR format for replay. It's available in both Python and Go implementations.
- Extract HTTP requests from Excel files
- Convert requests to GOR format for replay
- Support for both Python and Go implementations
- Generate unique request IDs and timestamps
- Handle large Excel files efficiently
- Python 3.6+
- pandas
- openpyxl
- Go 1.21+
You can install the required packages globally, but this is not recommended:
- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
# or
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
- Ensure Go is installed (1.21 or later)
- Install dependencies:
go mod tidy
- Build the binary:
go build -o excel_to_gor.exe excel_to_gor.go
python excel_to_gor.py --input <excel_file> --output <gor_file> [--column <column_name>]
# Options:
# -i, --input Path to the input Excel file (required)
# -o, --output Path to the output GOR file (required)
# -c, --column Name of the column containing HTTP requests (default: 'http请求')
# Using go run
go run excel_to_gor.go --input <excel_file> --output <gor_file> [--column <column_name>]
# Using compiled binary
./excel_to_gor --input <excel_file> --output <gor_file> [--column <column_name>]
# Options:
# -i, --input Path to the input Excel file (required)
# -o, --output Path to the output GOR file (required)
# -c, --column Name of the column containing HTTP requests (default: 'http请求')
Example:
# Python with default column
python excel_to_gor.py --input report.xlsx --output output.gor
# Python with custom column
python excel_to_gor.py --input report.xlsx --output output.gor --column "custom_column"
# Go with default column
go run excel_to_gor.go --input report.xlsx --output output.gor
# Go with custom column
go run excel_to_gor.go --input report.xlsx --output output.gor --column "custom_column"
# Download and install
curl -L -o gor.tar.gz https://github.com/buger/goreplay/releases/download/1.3.3/gor_1.3.3_x64.tar.gz
tar -xzf gor.tar.gz
sudo mv gor /usr/local/bin/
# Verify installation
gor --version
- Download the latest release from GOR releases page
- Extract the downloaded ZIP file
- Add the extracted directory to your system's PATH
- Open a new command prompt and verify installation:
gor.exe --version
Basic usage:
# Replay to a target host
gor --input-file "output.gor" --output-http "http://target-host"
# Replay to localhost
gor --input-file "output.gor" --output-http "http://localhost:8000"
# Replay with rate limiting (e.g., 10 requests per second)
gor --input-file "output.gor" --output-http "http://localhost:8000" --output-http-workers 10
This tool provides functionality to replay HTTP requests from a PCAP file and capture network traffic to a new PCAP file.
- Python 3.6+
- Wireshark (includes
tshark
command-line tool) - Required Python packages:
scapy
,pandas
Install the required Python packages:
pip install scapy pandas
To capture HTTP/HTTPS traffic to a PCAP file:
# Basic capture (30 seconds, default interface)
python http_replay.py capture -i eth0 -o capture.pcap
# Advanced capture (specific duration and filter)
python http_replay.py capture -i eth0 -o capture.pcap -d 60 -f "tcp port 80 or tcp port 443"
# List available interfaces
# On Windows:
getmac
# On Linux:
ifconfig -a
To replay HTTP requests from a PCAP file to a target URL:
# Basic replay
python http_replay.py replay -i input.pcap -t http://target-server
# Advanced replay (with delay and multiple iterations)
python http_replay.py replay -i input.pcap -t http://target-server -c 3 -d 0.5
Start a simple HTTP server to handle replay requests via API:
python http_replay.py server -p 8000
Then send a POST request to http://localhost:8000/replay
with a JSON body:
{
"pcap_file": "path/to/input.pcap",
"target_url": "http://target-server",
"count": 1,
"delay": 1
}
-
First, capture some traffic:
python http_replay.py capture -i eth0 -o traffic.pcap -d 60
-
Then replay the captured traffic:
python http_replay.py replay -i traffic.pcap -t http://test-server:8080
- The replay tool extracts HTTP GET requests from the PCAP file and replays them to the target URL.
- For HTTPS traffic, you may need to configure your system to intercept SSL/TLS traffic.
- The capture tool requires administrative/root privileges to capture network traffic.
- For Windows, you may need to run the capture command as Administrator.