The drunk night can’t stop our pace
A few days ago, the company bought some BurpSuite licenses, and finally can use the genuine, first to the company to Bozan! Well, get down to business, BurpSuite as a great artifact of Web security testing, one of the advantages is its scalability. BurpSuite supports Java, Python, and Ruby as extensions to its plugins, and there are many powerful plugins in its built-in Bapp_Store. As a program, I thought it was time to develop a proprietary plug-in myself. With this mentality, I began to try to learn to explore Coding, so I got this article.
The above mentioned Burp supports Java, Python, and Ruby language extensions. Relatively speaking, I am more familiar with Python, so I started learning to write plug-ins in Python. For high-speed friends, I can write in Java. Friends who are familiar with Python must know that Python is divided into Cython, Jython, and so on. The former is what we usually call Python, the latter is the Java version of Python, and the simple understanding is that Java can be called with Jython.
To develop and use your own BurpSuite plugin, you must deploy the Jython development environment and the Jython runtime environment. The former needs to build an environment on the platform that develops the jython program, and the latter needs to build the environment on the platform where the burstite is running. Since general development and the use of plugins are on a platform, such as mac, this article describes how to install the jython environment on the mac.
First we need to install the jython environment on the mac in order to develop the jython program, just like installing the python environment, install the jython command on the mac:
After installation, jython is installed in the /usr/local/Cellar/jython/ directory. You need to set the environment variable, add /usr/local/Cellar/jython/2.7.1/libexec/bin to the environment variable, and then in the shell. Enter:
Note: Other platforms (windows, linux) install jython way please google yourself, it should be similar.
After installing the jython environment on the mac, you need to load the jython environment in the burstite. Note that the jar file is selected here.
This article introduces a plug-in that detects unauthorized access vulnerabilities as an example to introduce the development process of the plug-in. Since the focus of this article is on how to develop a bp plug-in and some force majeure factors, the plug-ins introduced in this article are simplified versions. .
Description: This file is a plugin entry file, in which the imported burp built-in class IBurpExtender is the base class, that is, all plugins need to use inheritance class, IHttpListener class is used to get http request and response content.
Description: This file is used to detect unauthorized access classes. It is relatively simple to obtain the original request and response packets, remove the cookie of the request interface, and replay the authentication after token authentication. Check whether the returned result has changed. In general, it will also detect whether the response packet contains sensitive information. Here, for the convenience of the demonstration, the plug-in function is simplified.
Choose to add a plugin:
Note the markup section in the image below:
Description: Type select python, file select entry file, bulpsuite will automatically get the local dependent file; output here selects the console output, because this plugin does not write ui interface.
After loading successfully, it will be output in the console:
Then we will open the browser proxy, close the bp interception, and happily test the web system. If the plugin detects an interface that is not authorized to access, the output will be similar as follows:
The way the console is output is not so elegant, so it’s better to output it on the interface like its built-in features. The following is a simple ui interface development code:
Description: This is just a demo of ui interface development, the effect is as follows:
Here are a few common burb classes:
For more information about burp development, please refer to the following: https://portswigger.net/burp/extender/