diff --git a/BappManifest.bmf b/BappManifest.bmf index 71c9811..61290a4 100644 --- a/BappManifest.bmf +++ b/BappManifest.bmf @@ -2,7 +2,7 @@ Uuid: 33839d04fdaa4e3b80292fbed115db13 ExtensionType: 1 Name: ExtendedMacro RepoName: extended-macro -ScreenVersion: 0.0.3 +ScreenVersion: 0.0.5 SerialVersion: 1 MinPlatformVersion: 0 ProOnly: False diff --git a/README.md b/README.md index 1933dee..bec9118 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,20 @@ It is still in development, so please don't be angry if something getting wrong, - create sequence of the request to be triggered before the every request call - extract data from arbitrary response - paste extracted data into arbitrary following request - - from the sequence - - into the last request (Intruder, Repeater, Scanner, Sequencer or Spider) + - replacement of the existing data + - add new HTTP header + - replacement of the HTTP header - create new header - changing order of the requests +- URL decoding of extracted data +- extracted data caching + - you can specify time interval, when the extraction will be performed ## Advantages against the BurpSuite Macro - ability to replace arbitrary string in the request - ability to add new header into the request - easier configuration than macro (does not seems to be, but it is ;)) +- extracted data caching ## About the UI The plug-in adds new tab into the BurpSuite named "ExtendedMacro". It contains several tabs: "Main", "Logger" and "Settings". diff --git a/screenshot/logger.png b/screenshot/logger.png index fe78bc3..c0bf422 100644 Binary files a/screenshot/logger.png and b/screenshot/logger.png differ diff --git a/screenshot/main.png b/screenshot/main.png index 85906d9..6609a2f 100644 Binary files a/screenshot/main.png and b/screenshot/main.png differ diff --git a/screenshot/settings.png b/screenshot/settings.png index 46c60f5..abf7a17 100644 Binary files a/screenshot/settings.png and b/screenshot/settings.png differ diff --git a/src/burp/BurpExtender.java b/src/burp/BurpExtender.java index 01308f3..72d7e73 100644 --- a/src/burp/BurpExtender.java +++ b/src/burp/BurpExtender.java @@ -16,14 +16,14 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IContextMenuFactory, ITab { private static String EXTENSION_NAME = "ExtendedMacro"; private static String EXTENSION_NAME_TAB_NAME = "Extended Macro"; - private static String VERSION = "0.0.3"; + private static String VERSION = "0.0.5"; public PrintWriter stdout; public PrintWriter stderr; public IExtensionHelpers helpers; private IBurpExtenderCallbacks callbacks; private MessagesTable extMessagesTable; private MessagesTable repMessagesTable; - private JPanel mainPanel; + private JSplitPane mainPanel; private MessagesModel messagesModel; private IMessageEditor extRequestEditor; private IMessageEditor extResponseEditor; @@ -113,8 +113,26 @@ public String getNextMsgIdLogger() { private void initGui() { mainTabPane = new JTabbedPane(); - mainPanel = new JPanel(); - mainPanel.setLayout(new GridLayout(3, 2)); + JSplitPane mainPanel_up = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + + JPanel p1 = new JPanel(); + JPanel p2 = new JPanel(); + JPanel p3 = new JPanel(); + + p1.setLayout(new GridLayout(1, 2)); + p2.setLayout(new GridLayout(1, 2)); + p3.setLayout(new GridLayout(1, 2)); + + mainPanel_up.add(p1); + mainPanel_up.add(p2); + mainPanel.add(mainPanel_up); + mainPanel.add(p3); + mainPanel.setResizeWeight(0.25); + + p1.setPreferredSize(new Dimension(100, 200)); + p2.setPreferredSize(new Dimension(100, 500)); + p3.setPreferredSize(new Dimension(100, 80)); messagesModel = new MessagesModel(this.helpers); @@ -161,7 +179,7 @@ private void initGui() { JTabbedPane extMessagesTab = new JTabbedPane(); extMessagesTab.addTab("Extraction message list", extMsgScrollPane); - mainPanel.add(extMessagesTab); + p1.add(extMessagesTab); // replace messages table repMessagesTable = new MessagesTable(this, false); @@ -202,11 +220,11 @@ private void initGui() { JTabbedPane repMessagesTab = new JTabbedPane(); repMessagesTab.addTab("Replace message list", repMsgScrollPane); - mainPanel.add(repMessagesTab); + p1.add(repMessagesTab); // add editor tabs - mainPanel.add(extMessagesTabs); - mainPanel.add(repMessagesTabs); + p2.add(extMessagesTabs); + p2.add(repMessagesTabs); // extraction panel JPanel extractionPanel = new JPanel(); @@ -266,7 +284,7 @@ private void initGui() { extButtonsPane.add(extFromSelectionButton); extractionPanel.add(extButtonsPane); - mainPanel.add(extTab); + p3.add(extTab); // replace panel JPanel replacePanel = new JPanel(); @@ -296,9 +314,9 @@ private void initGui() { replaceType = new JComboBox<>(); replaceType.addItem(Replace.TYPE_REP_SEL); replaceType.addItem(Replace.TYPE_ADD_SEL); - replaceType.addItem(Replace.TYPE_REP_LAST); - replaceType.addItem(Replace.TYPE_ADD_LAST); - replaceType.addItem(Replace.TYPE_REP_HEADER_LAST); + replaceType.addItem(Replace.TYPE_REP_BURP); + replaceType.addItem(Replace.TYPE_ADD_BURP); + replaceType.addItem(Replace.TYPE_REP_HEADER_BURP); replaceNameStringField = new JTextField(); replaceType.addActionListener(new ConfigChangedListener(this, ConfigActions.A_REP_CONFIG_CHANGED)); @@ -331,7 +349,7 @@ private void initGui() { replaceButtonsPane.add(repFromSelectionButton); replacePanel.add(replaceButtonsPane); - mainPanel.add(repTab); + p3.add(repTab); mainTabPane.addTab("Main window", mainPanel); @@ -383,7 +401,13 @@ private void initGui() { logger.add(loggerMessagesEditorPanel); mainTabPane.addTab("Logger", logger); + p1.revalidate(); + p2.revalidate(); + p3.revalidate(); + p1.repaint(); + p2.repaint(); + p3.repaint(); initSettingsGui(mainTabPane); } @@ -754,9 +778,9 @@ public boolean isValidReplace() { String replaceTypeString = replaceType.getSelectedItem().toString(); - if (replaceTypeString.equals(Replace.TYPE_ADD_LAST) || - replaceTypeString.equals(Replace.TYPE_REP_LAST) || - replaceTypeString.equals(Replace.TYPE_REP_HEADER_LAST)) { + if (replaceTypeString.equals(Replace.TYPE_ADD_BURP) || + replaceTypeString.equals(Replace.TYPE_REP_BURP) || + replaceTypeString.equals(Replace.TYPE_REP_HEADER_BURP)) { ignore_rep_row = true; } diff --git a/src/burp/ConfigListener.java b/src/burp/ConfigListener.java index 67ff0ed..c19f2ba 100644 --- a/src/burp/ConfigListener.java +++ b/src/burp/ConfigListener.java @@ -141,6 +141,7 @@ public void actionPerformed(ActionEvent actionEvent) { extender.getReplaceModel().addReplace(rep); } else { + rep.setMsgId("Burp"); extender.getReplaceModel().addReplaceLast(rep); } extender.stdout.println("[+] Adding new replace: " + rep); diff --git a/src/burp/Replace.java b/src/burp/Replace.java index c6a0784..17a1e9d 100644 --- a/src/burp/Replace.java +++ b/src/burp/Replace.java @@ -2,7 +2,6 @@ import java.util.List; import java.util.Iterator; -import java.io.PrintWriter; /** * Created by fruh on 9/7/16. @@ -10,9 +9,9 @@ public class Replace { public static String TYPE_REP_SEL = "Replace on selected"; public static String TYPE_ADD_SEL = "Add new header on selected"; - public static String TYPE_REP_LAST = "Replace on last request"; - public static String TYPE_ADD_LAST = "Add new header on last request"; - public static String TYPE_REP_HEADER_LAST = "Replace header on last request"; + public static String TYPE_REP_BURP = "Replace on Burp request"; + public static String TYPE_ADD_BURP = "Add new header on Burp request"; + public static String TYPE_REP_HEADER_BURP = "Replace header on Burp request"; private boolean urlDecode = false; private String dataToPaste; @@ -46,13 +45,13 @@ public void setReplaceStr(String replaceStr) { } public String replaceData(String request, IExtensionHelpers helpers) { - if (type.equals(TYPE_REP_SEL) || type.equals(TYPE_REP_LAST)) { + if (type.equals(TYPE_REP_SEL) || type.equals(TYPE_REP_BURP)) { request = request.replace(replaceStr, dataToPaste); } else { IRequestInfo rqInfo = helpers.analyzeRequest(request.getBytes()); List headers = rqInfo.getHeaders(); - if (type.equals(TYPE_REP_HEADER_LAST)){ + if (type.equals(TYPE_REP_HEADER_BURP)){ for (Iterator iterator = headers.iterator(); iterator.hasNext();){ String header = iterator.next(); if (header.startsWith(replaceStr)){