Tripwire: Tracking Vulnerable Parameters
A deep dive into why and how the Tripwire extension was created to simplify SQLi testing.
The Origin Story: The Invisible SQLi
The motivation behind the Tripwire extension was a persistent and frustrating problem in web application security testing. My colleague consistently found SQL Injection vulnerabilities in endpoints that I had already reviewed and missed. After reviewing his methods, we realized the core difference wasn't the attack payload, but the speed and accuracy of parameter identification.
While tools like Burp Suite or automated scanners can find endpoints, the key to SQLi is often knowing which specific parameter within the endpoint is being used unsafely in the backend query. Tripwire was created to be that efficient "tripwire" that marks potential targets for manual validation.
Demo: Tripwire in Action
Below is Tripwire running inside Burp Suite while browsing an intentionally vulnerable lab. Every request that carries parameters is listed on the left, and anything that looks injectable is flagged in the Result column.
How to read the screenshot
- Params: the exact parameter that was tampered with (
id,bild, ...). One row is created per parameter, so you know precisely where to look. - Orig. / Modif. / Repair. Len: response length of the original request, the broken request (
') and the repaired request (''). A modified length that differs from the repaired one is a good hint that the quote reached the query. - Result: rows marked
Possible(?)matched a SQL error signature after the quote was injected. - Evidence tab: the response body of the broken request with the matched keywords highlighted. In the screenshot,
SQL syntaxandMySQLare highlighted in the leaked database error.
Try It Yourself
Installation
- Download Burp Suite and the Jython standalone JAR.
- In Burp, go to Extender → Options → Python Environment and select the Jython JAR.
- Clone the extension:
git clone https://github.com/7imbitz/Tripwire.git - Go to Extender → Extensions → Add and choose
extension.py. - A new Tripwire tab should appear in Burp.
Usage
- Open the Tripwire tab, then the Configuration sub-tab.
- Switch Capture ON. Capture is disabled by default.
- Browse the target as usual. Tripwire analyses every request with parameters in the background.
- Look for
Possible(?)in the Result column and open the Evidence tab to see the highlighted response. - Confirm the finding manually, since Tripwire only marks candidates, it does not prove exploitability.
The SQL error signatures and the list of ignored file extensions can both be edited from the Configuration tab. Static files (.js, .css, images, fonts, ...), telemetry-style paths (log, analytics, tracking, ...) and unsupported content types are skipped by default to keep the noise down.
Core Functionality Explained
Tripwire works by intercepting HTTP requests and intelligently logging all unique GET and POST parameters associated with an endpoint.
1. Data Parsing and Parameter Extraction
This is the first and most critical stage, performed by the extension's core logic (in a central handler class). It processes the raw HTTP traffic and extracts data regardless of its encoding (e.g., URL-encoded, JSON, form data).
Code Focus: Parsing Input
The code reads the `request.url` for GET parameters and the `request.body` for POST parameters. For POST data, it often requires logic to handle different `Content-Type` headers.
// Pseudocode for parameter extraction
function extract_parameters(request):
params = {}
// 1. Extract GET parameters from URL
for key, value in request.url.query:
params[key] = value
// 2. Extract POST parameters from body (simplified)
if request.method == 'POST':
body_type = request.headers['Content-Type']
if 'application/x-www-form-urlencoded' in body_type:
// Custom parser to split by '&' and '='
for key, value in parse_url_encoded(request.body):
params[key] = value
// Add logic for JSON/XML bodies if necessary
return params
This part is crucial because it transforms the messy network stream into a clean dictionary of key-value pairs, identifying every potential injection point.
2. Break and Repair SQL Injection
Once parameters are extracted, the extension's job is to test each parameter with the Break and Repair method
Code Focus: Break and Repair
The extension will break the query by inserting single quote to each parameter identified in a single request, and repair the query by inserting another single quote
// Pseudocode for break and repair
// Build modified request (param + ')
modifiedRequestResponse = self._performSQLInjection(messageInfo, param, "'")
modifiedResponse = modifiedRequestResponse.getResponse() if modifiedRequestResponse else None
result = ""
if modifiedResponse:
responseInfo = self._helpers.analyzeResponse(modifiedResponse)
body = modifiedResponse[responseInfo.getBodyOffset():].tostring().lower()
// Comparing request with sql error signature
sql_signatures = self.get_sql_error_signatures()
if any(err in body for err in sql_signatures):
result = "Possible"
for err in sql_signatures:
if err in body:
print(" Matched keyword:", err)
// Build repaired request (param + '')
repairedRequestResponse = self._performSQLInjection(messageInfo, param, "''")
requestInfo = self._helpers.analyzeRequest(messageInfo)
method = requestInfo.getMethod()
url = requestInfo.getUrl()
This method is the identity of the "Tripwire"; It will trip and marked as "possible" when a parameter with sql error signature are identified.
Conclusion
Tripwire is a direct response to a common problem: overwhelming data noise. By focusing programmatically on the parsing and unique identification of request parameters, it allowed us to skip the tedious work of manually tracking inputs and jump straight to vulnerability validation, making our testing process much more effective.
Give it a try, feedback are always appreciated.