-
Notifications
You must be signed in to change notification settings - Fork 1
/
ExtensionTemplate.py
57 lines (45 loc) · 1.8 KB
/
ExtensionTemplate.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Extension template file for Burp Suite
#
# How to use:
# - TODO...
#
# Copyright (c) 2021, Alexandre Hamelin <[email protected]>
#
# Distributed under the Apache 2.0 License.
from array import array
from burp import IBurpExtender, IExtensionStateListener
#from burp import IIntruderPayloadProcessor
# basic tutorial: https://portswigger.net/burp/extender/writing-your-first-burp-suite-extension
# callbacks ref:
# https://github.com/PortSwigger/burp-extender-api/blob/master/src/main/java/burp/IBurpExtenderCallbacks.java
class BurpExtender(IBurpExtender, IExtensionStateListener):
def registerExtenderCallbacks(self, callbacks):
callbacks.setExtensionName("Extension Name");
self._callbacks = callbacks
self._stdout = callbacks.getStdout()
self._stderr = callbacks.getStderr()
self._helpers = callbacks.getHelpers()
self.printOutput = callbacks.printOutput
self.printError = callbacks.printError
callbacks.registerExtensionStateListener(self);
"""
some helpers methods:
----------------
int indexOf (byte[] data, byte[] pattern, boolean caseSensitive, int from, int to);
String bytesToString(byte[] data);
byte[] stringToBytes(String data);
String urlDecode(String data);
String urlEncode(String data);
byte[] urlDecode(byte[] data);
byte[] urlEncode(byte[] data);
byte[] base64Decode(String data);
byte[] base64Decode(byte[] data);
String base64Encode(String data);
String base64Encode(byte[] data);
or use array.array('b', 'mystr') to convert to a byte array
and array.array('b', []).tostring() to convert to a string
"""
return
# IExtensionStateListener
def extensionUnloaded(self):
pass