
Burp Suite extension (Jython): zamienia zaznaczony request na gotowy skrypt exploita w Pythonie - SQLi, SSTI, LFI, CMDi, XXE, deserializacja, logika/auth
An extended version of the Copy As Python-Requests extension for Burp Suite. The original (Silent
Signal / PortSwigger's fork) rewrites the selected request into a call to the requests library
in Python. This version does the same and adds:
§ as a function parameter, encoded depending on its location,The extension does not exploit or scan anything itself. It produces a ready-to-run skeleton
of a script. The target-specific logic - the query, the oracle, the injection context - you write
yourself, in clearly marked lines ZMIEN. Nothing about any specific application is in the code.
Based on the idea and purpose of:
burp-requests (Apache-2.0): https://github.com/silentsignal/burp-requestscopy-as-python-requests (MIT): https://github.com/PortSwigger/copy-as-python-requestsThe code in this repository is an independent implementation in Jython, not a fork of the above.
| File | Name in Burp | What it's for |
|---|---|---|
copy_as_python_ng.py | Copy As Python-Requests NG | Script skeleton by vulnerability type (with extraction loop / timing measurement) |
copy_as_script.py | Copy as script | Raw rewriting of one or more requests into Python functions |
location of jython standalone jar points to jython-standalone-2.7.x.jar.
Without this, no Python extension will load..py.Do this once on the machine you work from. The extension stays in Burp's configuration.
In the Repeater editor, surround the value that normally works with § characters:
GET /catalog?item=§42§&sort=price HTTP/1.1
The text between the markers (here 42) is only an example - the generator removes it and in its place
inserts the payload, encoding it depending on the location (path / query / form / JSON).
If you don't select anything, the script will still be generated, with a comment telling you to indicate the location.
The rule is the same for every type: the payload location comes from the request (the § marker),
and the payload itself is a single line that you write based on code analysis - never a list of variants to guess from.
Select the §...§ location, right-click -> Extensions -> Copy as Python (NG) -> choose the type,
and for SQLi/SSTI also the engine. A complete script is copied to the clipboard. Alternatively, the
Copy As Python-Requests NG tab: paste the raw request, choose the type/engine, click Generate.
| Category | Type | Engine-dependent |
|---|---|---|
| SQLi | blind boolean (by response) | yes |
| SQLi | blind boolean (by record state) | yes |
| SQLi | time-based blind (sleep) | yes |
| SQLi | error-based | yes |
| SQLi | UNION SELECT | yes |
| RCE: template/code | SSTI -> RCE | yes (template engine) |
| RCE: template/code | PHP eval | no |
| RCE: template/code | JS eval (Node) | no |
| RCE: template/code | OS command injection | no |
| Deserialization | pickle (Python) | no |
| Deserialization | jsonpickle | no |
| Deserialization | Phar (PHP) | no |
| Deserialization | .NET | no |
| Files | path traversal / LFI | no |
| Files | upload -> RCE | no |
| Files | zip slip | no |
| XML | XXE (file read) | no |
| Logic / auth | password reset token | no |
| Logic / auth | weak hash bypass | no |
| Logic / auth | weak secret / signature | no |
| Logic / auth | prototype pollution | no |
| Logic / auth | mass assignment | no |
mysql, postgres, mssql, oracle, sqlite. The generator itself selects the engine's
syntax blocks: SUBSTRING/SUBSTR, ASCII/UNICODE, LENGTH/LEN,
SLEEP/pg_sleep/WAITFOR/DBMS_PIPE, CONCAT/||/+, extractvalue/CAST/CONVERT.thymeleaf, freemarker, velocity, jinja2, ejs, pug, handlebars,
twig, erb, smarty - RCE payload per engine.SQL engine verification status:
| Engine | boolean | time-based | union | error | how verified |
|---|---|---|---|---|---|
| postgres | OK | OK | OK | OK | live |
| mysql | OK | OK | OK | OK | live |
| mssql | syntax | syntax | syntax | syntax | per documentation |
| oracle | syntax | syntax | syntax | syntax | per documentation |
| sqlite | syntax | no sleep | syntax | none | per documentation |
"syntax" = payload built per the engine documentation, not confirmed against a live engine.
You confirm it with the first two tests against the target (1=1 vs 1=2).
The extraction loop (binary search, timing measurement, character iteration) is written
and identical for every application with a given database engine - it is a pure algorithm. You fill in
only the lines marked ZMIEN:
', which comment),Every SQLi script ends with the assert oracle("1=1") and not oracle("1=2") assertion - these are your
first two tests against the target, confirming that the context and oracle are good. The script takes the target
from sys.argv[1], and without an argument - the address from the request.
That is why it also works against a target that has never been tested: it rewrites your request and inserts
the same algorithm. New target = the same ZMIEN lines to fill in.
Select several requests in HTTP history, right-click -> Copy as Python (NG) -> Skeleton from selected (multiple tasks). A single file is created:
§,SHARED at the top - you enter them once,exploit() with a list of functions - here you add the flow (order, passing results,
conditions).This is the boundary of safe automation: the tool rewrites what is visible in the history, but it does not guess the order or the connections between steps.
Select one or more requests (HTTP history or Repeater), right-click -> Extensions -> Copy as script. A script lands in the clipboard: one function per request, in the order of selection.
BASE instead of the address, unnecessary headers stripped, cookies injected into the session;wartosc = r1.text... and passes it on as a variable;§...§ (or the part selected with the mouse) becomes the parameter payload, encoded depending
on its location.You write the attack logic yourself.