Skip to content

Commit

Permalink
Version: 1.0.2 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
gh0stkey committed Sep 26, 2024
1 parent c99fc7f commit fb4343c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 14 deletions.
Binary file modified images/right-click-function.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/java/caa/CaA.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CaA implements BurpExtension {
@Override
public void initialize(MontoyaApi api) {
// 设置扩展名称
String version = "1.0.1";
String version = "1.0.2";
api.extension().setName(String.format("CaA (%s) - Collector and Analyzer", version));

// 加载扩展后输出的项目信息
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/caa/component/Databoard.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public class Databoard extends JPanel {
@Override
public void actionPerformed(ActionEvent e) {
String selected = tableComboBox.getSelectedItem().toString();
dataPanel.removeAll();

if (selected.contains("All")) {
hostTextField.setEnabled(false);
handleComboBoxAction(null, "*");
Expand All @@ -48,8 +50,8 @@ public void actionPerformed(ActionEvent e) {
String host = hostTextField.getText();
if (host.equals("*")) {
hostTextField.setText("");
dataPanel.removeAll();
} else {
hostTextField.setForeground(Color.BLACK);
} else if (hostTextField.getForeground().equals(Color.BLACK)) {
handleComboBoxAction(null, host);
}
}
Expand Down Expand Up @@ -180,8 +182,6 @@ private void handleComboBoxAction(ActionEvent e, String host) {
handleComboBoxWorker.cancel(true);
}

dataPanel.removeAll();

handleComboBoxWorker = new SwingWorker<Object, Void>() {
@Override
protected Object doInBackground() {
Expand Down
24 changes: 20 additions & 4 deletions src/main/java/caa/component/member/DatatablePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,32 @@ public void changedUpdate(DocumentEvent e) {
JPopupMenu popupMenu = new JPopupMenu();
JMenuItem generatorPayload = new JMenuItem("Send to Payload Generator");
JMenu copyMenu = new JMenu("Copy Payload");
JMenuItem rawCopy = new JMenuItem("Raw");
JMenu rawMenu = new JMenu("Raw");
JMenuItem rawWithParamCopy = new JMenuItem("Raw with Param");
JMenuItem rawWithCookieCopy = new JMenuItem("Raw with Cookie");
JMenuItem rawWithHeaderCopy = new JMenuItem("Raw with Header");
JMenuItem jsonCopy = new JMenuItem("Json");
JMenuItem xmlCopy = new JMenuItem("Xml");
copyMenu.add(rawCopy);
copyMenu.add(rawMenu);
rawMenu.add(rawWithParamCopy);
rawMenu.add(rawWithCookieCopy);
rawMenu.add(rawWithHeaderCopy);
copyMenu.add(jsonCopy);
copyMenu.add(xmlCopy);

rawCopy.addActionListener(e -> {
rawWithParamCopy.addActionListener(e -> {
String payload = getSelectedDataAtTable(dataTable);
setClipboardContents(generator.generateRawParam(payload));
setClipboardContents(generator.generateRawParam(payload, "=", "&"));
});

rawWithCookieCopy.addActionListener(e -> {
String payload = getSelectedDataAtTable(dataTable);
setClipboardContents(generator.generateRawParam(payload, "=", "; "));
});

rawWithHeaderCopy.addActionListener(e -> {
String payload = getSelectedDataAtTable(dataTable);
setClipboardContents(generator.generateRawParam(payload, ": ","\r\n"));
});

jsonCopy.addActionListener(e -> {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/caa/instances/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,21 +243,21 @@ private String generateRandomString(int length, int strFlag) {
return this.api.utilities().randomUtils().randomString(length, strFlag == 1 ? RandomUtils.CharacterSet.ASCII_LETTERS : RandomUtils.CharacterSet.DIGITS);
}

public String generateRawParam(String payload) {
public String generateRawParam(String payload, String formatChar, String delimiter) {
List<String> paramValueList = new ArrayList<>();
String formatString = "{0}={1}";
String formatString = "{0}{1}{2}";
if (payload.contains("=")) {
for (String paramValue : payload.split("\r\n")) {
String param = paramValue.split("=")[0];
String value = httpUtils.decodeParameter(paramValue.split("=")[1]);
paramValueList.add(MessageFormat.format(formatString, param, value));
paramValueList.add(MessageFormat.format(formatString, param, formatChar, value));
}
} else {
for (String param : payload.split("\r\n")) {
paramValueList.add(MessageFormat.format(formatString, param, generateRandomString(6, 1)));
paramValueList.add(MessageFormat.format(formatString, param, formatChar, generateRandomString(6, 1)));
}
}
return String.join("&", paramValueList);
return String.join(delimiter, paramValueList);
}

public String generateJsonParam(String payload) {
Expand Down

0 comments on commit fb4343c

Please sign in to comment.