-
Notifications
You must be signed in to change notification settings - Fork 3
/
soundkit.py
61 lines (44 loc) · 1.77 KB
/
soundkit.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
58
59
60
61
"""
Burp Suite - Soundkit plugin
*Only works with Burp Suite Professional, sorry!
(Python 2.7 code meant for consumption by Burp Suite Jython)
"""
from burp import IBurpExtender
from burp import IHttpListener
from burp import IProxyListener
from burp import IScannerListener
from burp import IExtensionStateListener
from java.applet.Applet import newAudioClip
from java.io import ByteArrayInputStream
from java.io import File
from java.io import PrintWriter\
from os import getcwd, listdir
from os.path import abspath, dirname, isfile, join
import random
def getRandomSoundFilePath():
sound_path = join(getcwd(), 'sounds', 'in_use')
sound_files = [join(sound_path, f) for f in listdir(sound_path) if isfile(join(sound_path, f))]
random_sound = random.choice(sound_files)
return random_sound
def playSound(sound):
url = File(sound).toURL()
audio = newAudioClip(url)
audio.play()
class BurpExtender(IBurpExtender, IScannerListener, IExtensionStateListener):
# Implement IBurpExtender
def registerExtenderCallbacks(self, callbacks):
# Keep reference to callbacks object
self._callbacks = callbacks
callbacks.setExtensionName('Soundkit')
# Obtain output stream
self._stdout = PrintWriter(callbacks.getStdout(), True)
callbacks.registerScannerListener(self)
callbacks.registerExtensionStateListener(self)
# Implement IScannerListener
def newScanIssue(self, issue):
sound_file = getRandomSoundFilePath()
self._stdout.println('New scan issue, playing ' + sound_file)
playSound(sound_file)
# Implement IExtensionStateListener
def extensionUnloaded(self):
self._stdout.println('Extension unloaded')