如果你喜欢我的文章,欢迎关注公众号:安全女巫
转载请注明出处:https://mp.weixin.qq.com/s/xEKSXm2-fCHhyvZxrQUQvQ
burpsuite 最新版下载地址:
关注公众号回复burpsuite
官方只支持三种语言:Java, Python & Ruby
因Burpsuite使用Java编写,推荐使用java语言编写插件。若想用Python或Ruby,需使用借助JPython或JRuby,以达到使用Java调用Python或Ruby库的目的。
可根据实际情况进行插件编写。
保存所有接口到本地
安装jdk
安装idea
idea创建web项目,可做了解 https://blog.csdn.net/justdoit_potato/article/details/82994046
创建项目时,File-New-Project-选择jdk版本,点击下一步.
package burp;
import java.io.PrintWriter;
public class BurpExtender implements IBurpExtender
{
public void registerExtenderCallbacks (IBurpExtenderCallbacks callbacks)
{
// set our extension name
callbacks.setExtensionName("Hello world extension");
// obtain our output and error streams
PrintWriter stdout = new PrintWriter(callbacks.getStdout(), true);
PrintWriter stderr = new PrintWriter(callbacks.getStderr(), true);
// write a message to our output stream
stdout.println("Hello output");
// write a message to our error stream
stderr.println("Hello errors");
// write a message to the Burp alerts tab
callbacks.issueAlert("Hello alerts");
// throw an exception that will appear in our error stream
throw new RuntimeException("Hello exceptions");
}
}
plugin_jar为jar包目录
插件编写信息,成功展示
开启插件调试命令:
from burp import IBurpExtender
from java.io import PrintWriter
from java.lang import RuntimeException
class BurpExtender(IBurpExtender):
def registerExtenderCallbacks(self, callbacks):
callbacks.setExtensionName("Hello world extension")
stdout = PrintWriter(callbacks.getStdout(), True)
stderr = PrintWriter(callbacks.getStderr(), True)
stdout.println("Hello output")
stderr.println("Hello errors")
callbacks.issueAlert("Hello alerts")
raise RuntimeException("Hello exception")
from burp import IBurpExtender
from burp import ITab
from burp import IHttpListener
from burp import IMessageEditorController
from java.awt import Component;
from java.io import PrintWriter;
from java.util import ArrayList;
from java.util import List;
from javax.swing import JScrollPane;
from javax.swing import JSplitPane;
from javax.swing import JTabbedPane;
from javax.swing import JTable;
from javax.swing import SwingUtilities;
from javax.swing.table import AbstractTableModel;
from threading import Lock
class BurpExtender(IBurpExtender, ITab, IHttpListener, IMessageEditorController, AbstractTableModel):
def registerExtenderCallbacks(self, callbacks):
self._callbacks = callbacks
self._helpers = callbacks.getHelpers()
callbacks.setExtensionName("Custom logger")
self._log = ArrayList()
self._lock = Lock()
self._splitpane = JSplitPane(JSplitPane.VERTICAL_SPLIT)
logTable = Table(self)
scrollPane = JScrollPane(logTable)
self._splitpane.setLeftComponent(scrollPane)
tabs = JTabbedPane()
self._requestViewer = callbacks.createMessageEditor(self, False)
self._responseViewer = callbacks.createMessageEditor(self, False)
tabs.addTab("Request", self._requestViewer.getComponent())
tabs.addTab("Response", self._responseViewer.getComponent())
self._splitpane.setRightComponent(tabs)
callbacks.customizeUiComponent(self._splitpane)
callbacks.customizeUiComponent(logTable)
callbacks.customizeUiComponent(scrollPane)
callbacks.customizeUiComponent(tabs)
callbacks.addSuiteTab(self)
callbacks.registerHttpListener(self)
return
def getTabCaption(self):
return "Logger"
def getUiComponent(self):
return self._splitpane
def processHttpMessage(self, toolFlag, messageIsRequest, messageInfo):
if messageIsRequest:
return
self._lock.acquire()
row = self._log.size()
self._log.add(LogEntry(toolFlag, self._callbacks.saveBuffersToTempFiles(messageInfo), self._helpers.analyzeRequest(messageInfo).getUrl()))
self.fireTableRowsInserted(row, row)
self._lock.release()
def getRowCount(self):
try:
return self._log.size()
except:
return 0
def getColumnCount(self):
return 2
def getColumnName(self, columnIndex):
if columnIndex == 0:
return "Tool"
if columnIndex == 1:
return "URL"
return ""
def getValueAt(self, rowIndex, columnIndex):
logEntry = self._log.get(rowIndex)
if columnIndex == 0:
return self._callbacks.getToolName(logEntry._tool)
if columnIndex == 1:
return logEntry._url.toString()
return ""
def getHttpService(self):
return self._currentlyDisplayedItem.getHttpService()
def getRequest(self):
return self._currentlyDisplayedItem.getRequest()
def getResponse(self):
return self._currentlyDisplayedItem.getResponse()
class Table(JTable):
def init(self, extender):
self._extender = extender
self.setModel(extender)
def changeSelection(self, row, col, toggle, extend):
logEntry = self._extender._log.get(row)
self._extender._requestViewer.setMessage(logEntry._requestResponse.getRequest(), True)
self._extender._responseViewer.setMessage(logEntry._requestResponse.getResponse(), False)
self._extender._currentlyDisplayedItem = logEntry._requestResponse
JTable.changeSelection(self, row, col, toggle, extend)
class LogEntry:
def init(self, tool, requestResponse, url):
self.tool = tool
self.requestResponse = requestResponse
self._url = url
本文作者:公众号:安全女巫
本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/200103.html