plockchain support for send request flow by write yaml config file
Project description
Overview
Plockchain is a lightweight, configurable automation tool designed to help web pentesters streamline their HTTP-based testing workflows. With Plockchain, you can define a sequence of HTTP requests (a "chain"), leverage proxy settings, extract and manipulate data in-flight, and easily integrate dynamic variables into subsequent requests. Whether you need to automate a login flow to fetch a token, or orchestrate a multi-step sequence to probe various endpoints, Plockchain has you covered.
Key Features
- Configurable Flow: Define multi-step HTTP chains in a simple YAML file.
- Proxy Support: Route requests through an HTTP/SOCKS proxy for traffic inspection or access.
- Data Extraction & Injection: Extract fields from responses (e.g., JSON bodies via
jq-style selectors) and inject them into later requests. - TLS & Timeout Controls: Customize TLS on/off per request and set individual timeouts.
- Templating: Use Mustache-style placeholders (
{{variable}}) to render headers, URLs, and bodies dynamically. - Lightweight & Extensible: Built in Python with minimal dependencies, easy to extend for custom extractors or request types.
Prerequisites
- Python 3.8 or higher
pipfor installing dependencies
Installation
-
Clone the repository:
git clone https://github.com/nquangit/plockchain.git cd plockchain
-
Install required packages:
pip install -r requirements.txt
Configuration
Plockchain is driven by a YAML configuration file. Below is a sample configuration showing global variables, proxy settings, and a request chain:
# File: config.yaml
---
---
global_vars:
key: value
proxy:
host: 127.0.0.1
port: 8080
chain:
- req:
name: profile
use_tls: true
# Auto mode will get the host from the Host header
host: auto
# Auto mode will get the port base-on use_tls value (80 or 443)
port: auto
# Timeout in seconds (default: 30.0)
timeout: 5.0
event:
conditions:
status: 401
triggers:
chain: auth_chain
import:
headers:
Authorization: "Bearer {{token}}"
# Support chain must end with _chain suffix
auth_chain:
- req:
name: login
host: api.taskspace.com.vn
port: 443
timeout: 5.0
export:
response:
body:
var:
name: token
# Key access with jq for json response with unique key
key: ".data"
Configuration Fields
-
global_vars: Define key/value pairs available throughout the chain. -
proxy: Optional proxy settings (host,port). -
chain: An ordered list of steps; each step can be areq(HTTP request).name: Identifier for the step; used when exporting variables.use_tls:truefor HTTPS,falsefor HTTP.host/port: Target host and port (supportauto).timeout: Request timeout in seconds.export: Extract data from response. Currently supportsbodyJSON extraction with akeyselector.import: Inject variables into headers, query parameters, or body.
Usage
Run Plockchain by pointing it to your YAML config file:
# Future
python plockchain.py --config config.yaml
- Use
--verbosefor detailed logging. - Add
--no-proxyto bypass proxy settings.
Example Workflow
- Login capturing a JWT token.
- Fetch protected resource using the extracted token.
- Process or save the final output as needed.
python plockchain.py -c config.yaml -v
Extending Plockchain
- Custom Extractors: Add support for XML, regex, or HTML parsing by extending the
exportersmodule. - Additional Steps: Implement new step types (e.g., file uploads, GraphQL requests) in the
stepsdirectory.
Contributing
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes and push to your branch.
- Open a Pull Request detailing your improvements.
Please adhere to the existing code style and include unit tests for new features.
License
This project is licensed under the MIT License. See LICENSE for details.
Happy pentesting!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plockchain-1.5.tar.gz.
File metadata
- Download URL: plockchain-1.5.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28465a1876ec6ca284b8626d23ddc5fa9600eb16f117356df1c88cbc4d661b61
|
|
| MD5 |
4660df261bc0e09bff7877b9e680d8db
|
|
| BLAKE2b-256 |
3715cef5f3d4ac839437c019332f360e0397aa637aade2f62dbd0cfc71f4804f
|
File details
Details for the file plockchain-1.5-py3-none-any.whl.
File metadata
- Download URL: plockchain-1.5-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a8234d3a42b3a179f70c1be2ab03c203bf1fdceea9abfea661a03c7da734ec7
|
|
| MD5 |
09d247f3e72c6c7bad63f7f16c50c87d
|
|
| BLAKE2b-256 |
56fc0fa90b7bab0277ce44fd04acbd9766807fd922efe600e308809c8d6ef61c
|