├── TODO.md ├── selenium ├── libs │ ├── sac-1.3.jar │ ├── bsh-1.3.0.jar │ ├── guava-15.0.jar │ ├── jna-3.4.0.jar │ ├── htmlunit-2.13.jar │ ├── httpcore-4.3.jar │ ├── ini4j-0.5.2.jar │ ├── json-20080701.jar │ ├── testng-6.8.5.jar │ ├── xalan-2.7.1.jar │ ├── commons-io-2.2.jar │ ├── httpmime-4.3.1.jar │ ├── jcommander-1.29.jar │ ├── junit-dep-4.11.jar │ ├── nekohtml-1.9.19.jar │ ├── operadriver-1.5.jar │ ├── xml-apis-1.4.01.jar │ ├── apache-mime4j-0.6.jar │ ├── cglib-nodep-2.1_3.jar │ ├── commons-codec-1.8.jar │ ├── commons-exec-1.1.jar │ ├── commons-jxpath-1.3.jar │ ├── commons-lang3-3.1.jar │ ├── cssparser-0.9.11.jar │ ├── hamcrest-core-1.3.jar │ ├── httpclient-4.3.1.jar │ ├── jna-platform-3.4.0.jar │ ├── netty-3.5.7.Final.jar │ ├── serializer-2.7.1.jar │ ├── xercesImpl-2.10.0.jar │ ├── hamcrest-library-1.3.jar │ ├── protobuf-java-2.4.1.jar │ ├── commons-logging-1.1.1.jar │ ├── htmlunit-core-js-2.13.jar │ ├── jetty-websocket-8.1.8.jar │ ├── phantomjsdriver-1.1.0.jar │ └── commons-collections-3.2.1.jar ├── selenium-java-2.40.0.jar ├── selenium-java-2.40.0-srcs.jar └── CHANGELOG ├── BappManifest.bmf ├── BappDescription.html ├── README.md └── realRender.py /TODO.md: -------------------------------------------------------------------------------- 1 | * Attempt to fix Selenium deadlock when user manually intervenes on JavaScript alert boxes -------------------------------------------------------------------------------- /selenium/libs/sac-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/sac-1.3.jar -------------------------------------------------------------------------------- /selenium/libs/bsh-1.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/bsh-1.3.0.jar -------------------------------------------------------------------------------- /selenium/libs/guava-15.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/guava-15.0.jar -------------------------------------------------------------------------------- /selenium/libs/jna-3.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/jna-3.4.0.jar -------------------------------------------------------------------------------- /selenium/libs/htmlunit-2.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/htmlunit-2.13.jar -------------------------------------------------------------------------------- /selenium/libs/httpcore-4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/httpcore-4.3.jar -------------------------------------------------------------------------------- /selenium/libs/ini4j-0.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/ini4j-0.5.2.jar -------------------------------------------------------------------------------- /selenium/libs/json-20080701.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/json-20080701.jar -------------------------------------------------------------------------------- /selenium/libs/testng-6.8.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/testng-6.8.5.jar -------------------------------------------------------------------------------- /selenium/libs/xalan-2.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/xalan-2.7.1.jar -------------------------------------------------------------------------------- /selenium/libs/commons-io-2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-io-2.2.jar -------------------------------------------------------------------------------- /selenium/libs/httpmime-4.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/httpmime-4.3.1.jar -------------------------------------------------------------------------------- /selenium/libs/jcommander-1.29.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/jcommander-1.29.jar -------------------------------------------------------------------------------- /selenium/libs/junit-dep-4.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/junit-dep-4.11.jar -------------------------------------------------------------------------------- /selenium/libs/nekohtml-1.9.19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/nekohtml-1.9.19.jar -------------------------------------------------------------------------------- /selenium/libs/operadriver-1.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/operadriver-1.5.jar -------------------------------------------------------------------------------- /selenium/libs/xml-apis-1.4.01.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/xml-apis-1.4.01.jar -------------------------------------------------------------------------------- /selenium/selenium-java-2.40.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/selenium-java-2.40.0.jar -------------------------------------------------------------------------------- /selenium/libs/apache-mime4j-0.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/apache-mime4j-0.6.jar -------------------------------------------------------------------------------- /selenium/libs/cglib-nodep-2.1_3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/cglib-nodep-2.1_3.jar -------------------------------------------------------------------------------- /selenium/libs/commons-codec-1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-codec-1.8.jar -------------------------------------------------------------------------------- /selenium/libs/commons-exec-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-exec-1.1.jar -------------------------------------------------------------------------------- /selenium/libs/commons-jxpath-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-jxpath-1.3.jar -------------------------------------------------------------------------------- /selenium/libs/commons-lang3-3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-lang3-3.1.jar -------------------------------------------------------------------------------- /selenium/libs/cssparser-0.9.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/cssparser-0.9.11.jar -------------------------------------------------------------------------------- /selenium/libs/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /selenium/libs/httpclient-4.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/httpclient-4.3.1.jar -------------------------------------------------------------------------------- /selenium/libs/jna-platform-3.4.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/jna-platform-3.4.0.jar -------------------------------------------------------------------------------- /selenium/libs/netty-3.5.7.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/netty-3.5.7.Final.jar -------------------------------------------------------------------------------- /selenium/libs/serializer-2.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/serializer-2.7.1.jar -------------------------------------------------------------------------------- /selenium/libs/xercesImpl-2.10.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/xercesImpl-2.10.0.jar -------------------------------------------------------------------------------- /selenium/libs/hamcrest-library-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/hamcrest-library-1.3.jar -------------------------------------------------------------------------------- /selenium/libs/protobuf-java-2.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/protobuf-java-2.4.1.jar -------------------------------------------------------------------------------- /selenium/selenium-java-2.40.0-srcs.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/selenium-java-2.40.0-srcs.jar -------------------------------------------------------------------------------- /selenium/libs/commons-logging-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-logging-1.1.1.jar -------------------------------------------------------------------------------- /selenium/libs/htmlunit-core-js-2.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/htmlunit-core-js-2.13.jar -------------------------------------------------------------------------------- /selenium/libs/jetty-websocket-8.1.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/jetty-websocket-8.1.8.jar -------------------------------------------------------------------------------- /selenium/libs/phantomjsdriver-1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/phantomjsdriver-1.1.0.jar -------------------------------------------------------------------------------- /selenium/libs/commons-collections-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/browser-repeater/master/selenium/libs/commons-collections-3.2.1.jar -------------------------------------------------------------------------------- /BappManifest.bmf: -------------------------------------------------------------------------------- 1 | Uuid: 215390e63f314c20958a23930eb1555a 2 | ExtensionType: 2 3 | Name: Browser Repeater 4 | RepoName: browser-repeater 5 | ScreenVersion: 0.1 6 | SerialVersion: 1 7 | MinPlatformVersion: 0 8 | ProOnly: False 9 | Author: Nadeem Douba 10 | ShortDescription: Automatically renders Repeater responses in Firefox. 11 | EntryPoint: realRender.py 12 | -------------------------------------------------------------------------------- /BappDescription.html: -------------------------------------------------------------------------------- 1 |
This extension renders responses returned in the Repeater tool in a real browser (specifically Firefox). 2 |
3 |The extension uses Selenium, a popular browser automation framework, to control the web browser when the Repeater tool is used in Burp Suite. 4 | Think of this extension as the automatic 'Show Response In Browser' (SRIB) tool. 5 | Instead of using the SRIB feature repeatedly in Burp Suite, this extension automates the process and makes pen-testing web apps that use mostly JavaScript rendered web pages much easier.
6 |Known Issue: If a JavaScript alert box appears and the operator manually accepts the alert, Selenium will cease operation and the extension will deadlock. 7 | The only work around for this issue is to manually close the browser and restart the 8 | extension.
-------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | About 2 | ----- 3 | 4 | This BurpSuite plugin renders responses returned in the Repeater tool in a real browser (specifically Firefox). The plugin uses 5 | Selenium, a popular browser automation framework, to control the web browser when the Repeater tool is used in Burp 6 | Suite. Think of this extension as the automatic 'Show Response In Browser' (SRIB) tool. Instead of using the SRIB 7 | feature repeatedly in Burp Suite, this extension automates the process and makes pen-testing web apps that use mostly 8 | JavaScript rendered web pages much easier. 9 | 10 | 11 | Requirements 12 | ------------ 13 | 14 | You'll need the following to get started: 15 | - the standalone version of Jython available at http://www.jython.org/downloads.html. 16 | - the latest version of BurpSuite versions 1.6 or later. 17 | - Firefox 18 | - a positive attitude! 19 | 20 | 21 | Known Issues & Workarounds 22 | -------------------------- 23 | 24 | If a JavaScript alert box appears and the operator manually accepts the alert, Selenium will cease operation and the 25 | extension will deadlock. The only work around for this issue is to manually close the browser and restart the plugin. 26 | 27 | 28 | Help! 29 | ----- 30 | 31 | This is still a work in progress so their may be a few bugs I haven't hammered out. 32 | -------------------------------------------------------------------------------- /realRender.py: -------------------------------------------------------------------------------- 1 | from Queue import Queue 2 | import SocketServer 3 | from burp import (IBurpExtender, IHttpListener, IBurpExtenderCallbacks, IExtensionStateListener) 4 | from threading import Thread, Event 5 | 6 | import sys 7 | import os 8 | 9 | from urlparse import urlparse, urlunparse 10 | from urllib import quote 11 | 12 | import SimpleHTTPServer 13 | 14 | 15 | try: 16 | raise NotImplementedError("No error") 17 | except Exception, e: 18 | exc_type, exc_obj, exc_tb = sys.exc_info() 19 | root = os.path.dirname(exc_tb.tb_frame.f_code.co_filename) 20 | sys.path.extend([os.path.join(p, j) for p, d, f in os.walk(root) for j in f if j.endswith('.jar')]) 21 | 22 | from org.openqa.selenium import Proxy, NoAlertPresentException 23 | from org.openqa.selenium.firefox import FirefoxDriver 24 | from org.openqa.selenium.remote import DesiredCapabilities, CapabilityType 25 | 26 | __author__ = 'Nadeem Douba' 27 | __copyright__ = 'Copyright 2012, dotNetBeautifier Project' 28 | __credits__ = [] 29 | 30 | __license__ = 'GPL' 31 | __version__ = '0.1' 32 | __maintainer__ = 'Nadeem Douba' 33 | __email__ = 'ndouba@gmail.com' 34 | __status__ = 'Development' 35 | 36 | 37 | class DriverThread(Thread): 38 | def __init__(self, queue): 39 | super(DriverThread, self).__init__() 40 | self.queue = queue 41 | proxyServer = 'localhost:8080' 42 | proxy = Proxy() 43 | proxy.setHttpProxy(proxyServer) 44 | proxy.setSslProxy(proxyServer) 45 | capabilities = DesiredCapabilities() 46 | capabilities.setCapability(CapabilityType.PROXY, proxy) 47 | self.driver = FirefoxDriver(capabilities) 48 | 49 | def run(self): 50 | firstRun = True 51 | while True: 52 | url = self.queue.get() 53 | if not firstRun: 54 | self._acceptAlerts() 55 | elif firstRun: 56 | firstRun = False 57 | if not url: 58 | break 59 | sys.stdout.write('Fetching %s... ' % url) 60 | self.driver.get(url) 61 | print 'done.' 62 | self.queue.task_done() 63 | self.queue.task_done() 64 | self.driver.close() 65 | 66 | def _acceptAlerts(self): 67 | print '\n------ BEGIN ALERTS ------\n' 68 | while True: 69 | try: 70 | alert = self.driver.switchTo().alert() 71 | print 'javascript:alert(%s);' % repr(alert.getText()) 72 | alert.dismiss() 73 | except NoAlertPresentException: 74 | print '\n------ END ALERTS ------\n' 75 | self.driver.switchTo().defaultContent() 76 | return 77 | 78 | 79 | class DummyServer(Thread): 80 | 81 | def __init__(self): 82 | super(DummyServer, self).__init__() 83 | self._stop = Event() 84 | 85 | def run(self): 86 | httpd = SocketServer.TCPServer(('127.0.0.1', 31337), SimpleHTTPServer.SimpleHTTPRequestHandler) 87 | while not self.stopped(): 88 | httpd.handle_request() 89 | 90 | def stop(self): 91 | self._stop.set() 92 | 93 | def stopped(self): 94 | return self._stop.isSet() 95 | 96 | 97 | class BurpExtender(IBurpExtender, IHttpListener, IExtensionStateListener): 98 | _redirectTemplate = 'HTTP/1.1 200 OK\r\n' \ 99 | 'Cache-Control: no-cache, no-store\r\n' \ 100 | 'Pragma: no-cache\r\n' \ 101 | 'Content-Type: text/html; charset=utf-8\r\n' \ 102 | 'Expires: -1\r\n\r\n' \ 103 | '' \ 104 | 'Please wait while we redirect you to your final destination...\r\n\r\n' 105 | 106 | def registerExtenderCallbacks(self, callbacks): 107 | self._callbacks = callbacks 108 | self._helpers = callbacks.getHelpers() 109 | self._requestMaps = {} 110 | self._responses = {} 111 | self._counter = 0 112 | self._inCurrentSession = True 113 | 114 | self._queue = Queue() 115 | self._driver = DriverThread(self._queue) 116 | self._driver.start() 117 | self._dummyServer = DummyServer() 118 | self._dummyServer.start() 119 | 120 | callbacks.setExtensionName('Browser Renderer') 121 | callbacks.registerHttpListener(self) 122 | callbacks.registerExtensionStateListener(self) 123 | 124 | def _standardizeUrl(self, url): 125 | u = urlparse(url) 126 | if ':' not in u.netloc: 127 | return urlunparse(( 128 | u.scheme, 129 | '%s:%d' % (u.netloc, 80 if u.scheme == 'http' else 443), 130 | u.path, 131 | u.params, 132 | u.query, 133 | u.fragment 134 | )) 135 | return url 136 | 137 | def processHttpMessage(self, toolFlag, messageIsRequest, messageInfo): 138 | url = self._standardizeUrl(str(messageInfo.getUrl())) 139 | if toolFlag == IBurpExtenderCallbacks.TOOL_REPEATER: 140 | if messageIsRequest and url not in self._requestMaps: 141 | uniqueUrl = 'http://localhost:31337/realRenderer/%d' % self._counter 142 | self._requestMaps[url] = uniqueUrl 143 | self._requestMaps[uniqueUrl] = url 144 | self._counter += 1 145 | elif not messageIsRequest: 146 | self._callbacks.printError('Saving response for %s\n' % url) 147 | self._queue.join() # block until the last request is completed 148 | self._responses[(self._requestMaps[url], url)] = messageInfo.getResponse() 149 | self._callbacks.printError('Save complete for %s!\n' % url) 150 | self._queue.put(self._requestMaps[url]) 151 | self._callbacks.printError('Navigating to %s in browser.\n' % url) 152 | elif toolFlag == IBurpExtenderCallbacks.TOOL_PROXY and not messageIsRequest: 153 | if url in self._requestMaps: 154 | if url.startswith('http://localhost:31337/realRenderer/'): 155 | messageInfo.setResponse( 156 | self._helpers.stringToBytes( 157 | self._redirectTemplate % quote(self._requestMaps[url]) 158 | ) 159 | ) 160 | else: 161 | for h in self._helpers.analyzeRequest(messageInfo.getRequest()).getHeaders(): 162 | if h.startswith('Referer:'): 163 | referer = self._standardizeUrl(h.split(': ')[1]) 164 | if (referer, url) in self._responses and self._responses[(referer, url)]: 165 | messageInfo.setResponse(self._responses[(referer, url)]) 166 | break 167 | 168 | 169 | def extensionUnloaded(self): 170 | self._queue.put(None) 171 | self._driver.join() 172 | self._dummyServer.stop() -------------------------------------------------------------------------------- /selenium/CHANGELOG: -------------------------------------------------------------------------------- 1 | v2.40.0 2 | ======= 3 | WebDriver: 4 | * Update to support native events for Firefox 27 (removed native event 5 | support for Firefox 25). 6 | * Removed the iPhone driver. Also leaving the atoms available, so that 7 | appium and iosdriver can use them. 8 | * Deleted the client side of the AndroidDriver. Note that the atoms 9 | are still left in place so that Selendroid can still be compiled. 10 | * Make the RemoteWebDriver implement TakesScreenshot. There's only one 11 | driver that doesn't implement the interface (the HtmUnitDriver) and 12 | this is the most common cause for using the Augmenter, which isn't 13 | very discoverable. 14 | * Imported PhantomJSDriver 1.1.0, removing 1.0.4 (previous version). 15 | * Implemented augmentation of previously augmented instances 16 | * Fixed JdkAugmenter's inability to add interfaces that are already implemented 17 | * Removed org.openqa.selenium.net.INetAddress, an unnecessary abstraction 18 | around java.net.InetAddress. 19 | * (on behalf of Tobias Lidskog) Add ability to send --silent flag to 20 | chromedriver. 21 | when building an inverted predicate. 22 | * Implemented part of advanced user interactions using injected atoms 23 | * Fixed HtmlUnitDriver to handle timeout exception on refresh. 24 | * Implemented page load timeouts in Firefox without stopping page 25 | loading. 26 | * Implemented pageLoadingStrategy capability in Firefox. 27 | * Migrated the WebDriverBackedSelenium to 28 | com.thoughtworks.selenium.webdriven. This also leaves behind a 29 | deprecated implementation of each of the key interfaces to ease 30 | migration for users. 31 | * Implemented proper error code for the case of invalid css selector 32 | empty class name, and compound class name in atoms. 33 | * Implemented alert and confirmation handling in WDBS (Java) 34 | * Throw a more descriptive error when typing in certain types of input 35 | elements in Chrome. Starting with Chrome 33, certain types of input 36 | elements do not support the selection API (in fact, they throw when 37 | you try to access the property). This prevents us from fully 38 | simulating typing in the atoms. 39 | * FIXED: 2397: (on behalf of TommyBeadle) Fixed exception handling 40 | * FIXED: 3991: Add Keys.chord(Iterable