Skip to content

Commit 9695528

Browse files
Merge pull request #3 from stavinski/master
Major changes to original extension
2 parents 51db72f + ae76a7e commit 9695528

15 files changed

Lines changed: 899 additions & 94 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.class

BappDescription.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
<p>This extension allows execution of a custom Python script on each HTTP
2-
request and response processed by Burp.</p>
3-
<p>To use, type or paste a Python script into the &quot;Script&quot; tab, and use Burp in
1+
<p>This exension allows execution of custom Python scripts to be used with HTTP request and responses plus handling Macro messages.</p>
2+
<p>To use, type or paste a Python script into the &quot;Python Scripts&quot; tab, and use Burp in
43
the normal way. The script will be executed for each HTTP request and response.
54
The following variables are defined in the context of the script:</p>
65
<ul>
@@ -10,4 +9,5 @@
109
<li>toolFlag</li>
1110
<li>messageIsRequest</li>
1211
<li>messageInfo</li>
12+
<li>macroItems</li>
1313
</ul>

BappManifest.bmf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ Uuid: eb563ada801346e6bdb7a7d7c5c52583
22
ExtensionType: 2
33
Name: Python Scripter
44
RepoName: python-scripter
5-
ScreenVersion: 1.1
5+
ScreenVersion: 2.0
66
SerialVersion: 2
77
MinPlatformVersion: 0
88
ProOnly: False
9-
Author: Marcin Wielgoszewski
10-
ShortDescription: Allows execution of a custom Python script on each HTTP request and response.
11-
EntryPoint: burpscript.py
9+
Author: Marcin Wielgoszewski, Mike Cromwell
10+
ShortDescription: Allows execution of custom Python scripts to be used with HTTP request and responses plus handling Macro messages.
11+
EntryPoint: python-scripter.py

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
1+
# Python Scripter
2+
3+
## Introduction
4+
5+
This extension allows you to write custom Python to hook into both the request, response pipeline and also the Macro handling support in Burp Suite. This is useful in those times were you want some behaviour but don't want to have to go to the full extent of creating a custom extension.
6+
7+
You can also over time build up a useful collection of utility scripts that can be used across web assessments.
8+
9+
I would highly recommend to build off the already established framework [pyscripter-er](https://github.com/lanmaster53/pyscripter-er) that already has a lot of common functionality built-in to save you some of the leg work.
10+
11+
## Usage
12+
13+
Once the extension is installed you will find a `Python Scripts` tab, this allows you to add, modify or remove scripts:
14+
15+
![Python Scripts with no scripts](images/new.png)
16+
17+
When you add a new script it will be given a name of `New Script X` this can be changed in the same way as in the `Repeater` tabs by double clicking and pressing Enter to confirm or Esc to cancel.
18+
19+
You can then start changing the new script or pasting a script from another location directly into the editor:
20+
21+
![Renaming the script via the tab](images/rename.png)
22+
23+
When your ready to compile the Python code simply click `Compile`, compile time errors these will be displayed in the `Errors` textarea:
24+
25+
![Compile time errors](images/error.png)
26+
27+
To test the script simply enable it and then push through a request, output should be presented in the `Output` textarea:
28+
29+
![Script output](images/output.png)
30+
31+
If there was a runtime exception these will also be captured in the `Errors` textarea to help diagnose the bug.
32+
33+
__Scripts are automatically restored and saved on extension load and unload.__
34+
35+
36+
## FAQs
37+
38+
__Q. Why do I see no output?__
39+
40+
A. As long as the script is enabled this could be that there was a runtime exception raised, firstly check the `Errors` textarea, could be that the scope checking in place is incorrect if your using `callbacks.isInScope` perhaps placing a `print` before and after this is comparesd coud help track down the issue. It may also be the case that the extension has an exception in which case you should check the `Errors` textare from the extensions dialog in Burp Suite.
41+
42+
## Original Work
43+
144
Sourced from gist: https://gist.github.com/mwielgoszewski/7026954

burpscript.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)