Skip to content

Commit

Permalink
Merge pull request #3 from CYS4srl/master
Browse files Browse the repository at this point in the history
Update SensitiveDiscoverer extension to v3.2.1
  • Loading branch information
Hannah-PortSwigger authored Aug 23, 2023
2 parents 02ae7c5 + 6abc03c commit facd89c
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 29 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ name: Build test

on:
push:
tags-ignore:
- "v*"
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
build:
Expand All @@ -26,3 +19,8 @@ jobs:

- name: Build with Maven
run: mvn -B clean package

- uses: actions/upload-artifact@v3
with:
name: extension-build
path: target/SensitiveDiscoverer-*.jar
4 changes: 2 additions & 2 deletions BappManifest.bmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Uuid: 81e073a640964b2ea3af0da93d048dbd
ExtensionType: 1
Name: Sensitive Discoverer
RepoName: sensitive-discoverer
ScreenVersion: 3.2.0
ScreenVersion: 3.2.1
SerialVersion: 4
MinPlatformVersion: 0
ProOnly: False
Author: CYS4
ShortDescription: Burp Suite extension to scan for sensitive strings in HTTP messages.
EntryPoint: target/SensitiveDiscoverer-3.2.0-jar-with-dependencies.jar
EntryPoint: target/SensitiveDiscoverer-3.2.1-jar-with-dependencies.jar
BuildCommand: mvn package
SupportedProducts: Pro, Community
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>com.cys4.sensitivediscoverer</groupId>
<artifactId>sensitivediscoverer</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
34 changes: 15 additions & 19 deletions src/main/java/com/cys4/sensitivediscoverer/ui/MainUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ private JPanel createLogger_ButtonPanel(JPanel tabPanelLogger, JScrollPane scrol

JButton clearLogsBtn = createLogger_ClearLogs(scrollPaneLogger);
buttonPanelLog.add(clearLogsBtn, BorderLayout.NORTH);
JMenuBar exportLogsMenu = createLogger_ExportLogs();
buttonPanelLog.add(exportLogsMenu, BorderLayout.NORTH);
JToggleButton exportLogsBtn = createLogger_ExportLogs();
buttonPanelLog.add(exportLogsBtn, BorderLayout.NORTH);

JPanel buttonsLoggerPanel = new JPanel();
buttonsLoggerPanel.setLayout(new BoxLayout(buttonsLoggerPanel, BoxLayout.Y_AXIS));
Expand Down Expand Up @@ -415,12 +415,10 @@ private JButton createLogger_ClearLogs(JScrollPane scrollPaneLogger) {

/**
* Export logs menu, to export the log entries to file
* @return JMenuBar for exporting logs
* @return JToggleButton for log export popup
*/
private JMenuBar createLogger_ExportLogs() {
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu(getLocaleString("logger-exportLogs-label"));
menu.putClientProperty("analysisDependent", "1");
private JToggleButton createLogger_ExportLogs() {
JPopupMenu menu = new JPopupMenu();

JMenuItem itemToCSV = new JMenuItem(getLocaleString("common-toCSV"));
itemToCSV.addActionListener(actionEvent -> {
Expand Down Expand Up @@ -467,8 +465,10 @@ private JMenuBar createLogger_ExportLogs() {
});
menu.add(itemToJSON);

menuBar.add(menu);
return menuBar;
MenuButton btnExportLogs = new MenuButton(getLocaleString("logger-exportLogs-label"), menu);
btnExportLogs.putClientProperty("analysisDependent", "1");

return btnExportLogs;
}

/**
Expand Down Expand Up @@ -756,9 +756,8 @@ private JButton createOptions_Regex_btnNew(RegexContext ctx,
}

//TODO loses info on sections used
private JMenuBar createOptions_Regex_btnListSave(OptionsRegexTableModelUI modelReg) {
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu(getLocaleString("options-list-save"));
private JToggleButton createOptions_Regex_btnListSave(OptionsRegexTableModelUI modelReg) {
JPopupMenu menu = new JPopupMenu();

JMenuItem itemToCSV = new JMenuItem(getLocaleString("common-toCSV"));
itemToCSV.addActionListener(actionEvent -> {
Expand Down Expand Up @@ -802,17 +801,15 @@ private JMenuBar createOptions_Regex_btnListSave(OptionsRegexTableModelUI modelR
});
menu.add(itemToJSON);

menuBar.add(menu);
return menuBar;
return new MenuButton(getLocaleString("options-list-save"), menu);
}

//TODO loses info on sections used
private JMenuBar createOptions_Regex_btnListOpen(RegexContext ctx,
private JToggleButton createOptions_Regex_btnListOpen(RegexContext ctx,
EnumSet<ProxyItemSection> newRegexesSections,
JPanel tabPaneOptions,
OptionsRegexTableModelUI modelReg) {
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu(getLocaleString("options-list-open"));
JPopupMenu menu = new JPopupMenu();

JMenuItem itemFromCSV = new JMenuItem(getLocaleString("common-fromCSV"));
itemFromCSV.addActionListener(actionEvent -> {
Expand Down Expand Up @@ -904,8 +901,7 @@ private JMenuBar createOptions_Regex_btnListOpen(RegexContext ctx,
});
menu.add(itemFromJSON);

menuBar.add(menu);
return menuBar;
return new MenuButton(getLocaleString("options-list-open"), menu);
}

private JButton createOptions_Regex_btnListClear(RegexContext ctx,
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/com/cys4/sensitivediscoverer/ui/MenuButton.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.cys4.sensitivediscoverer.ui;

import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;

public class MenuButton extends JToggleButton {
private final JPopupMenu popup;

public MenuButton(String name, JPopupMenu menu) {
super(name);
this.popup = menu;
addActionListener(ev -> {
JToggleButton b = MenuButton.this;
if (b.isSelected()) {
popup.show(b, 0, b.getBounds().height);
} else {
popup.setVisible(false);
}
});
popup.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
MenuButton.this.setSelected(false);
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {}
});
}
}

0 comments on commit facd89c

Please sign in to comment.