Skip to content

Commit fb4343c

Browse files
committed
Version: 1.0.2 Update
1 parent c99fc7f commit fb4343c

File tree

5 files changed

+30
-14
lines changed

5 files changed

+30
-14
lines changed

images/right-click-function.png

19.3 KB
Loading

src/main/java/caa/CaA.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CaA implements BurpExtension {
1818
@Override
1919
public void initialize(MontoyaApi api) {
2020
// 设置扩展名称
21-
String version = "1.0.1";
21+
String version = "1.0.2";
2222
api.extension().setName(String.format("CaA (%s) - Collector and Analyzer", version));
2323

2424
// 加载扩展后输出的项目信息

src/main/java/caa/component/Databoard.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ public class Databoard extends JPanel {
4040
@Override
4141
public void actionPerformed(ActionEvent e) {
4242
String selected = tableComboBox.getSelectedItem().toString();
43+
dataPanel.removeAll();
44+
4345
if (selected.contains("All")) {
4446
hostTextField.setEnabled(false);
4547
handleComboBoxAction(null, "*");
@@ -48,8 +50,8 @@ public void actionPerformed(ActionEvent e) {
4850
String host = hostTextField.getText();
4951
if (host.equals("*")) {
5052
hostTextField.setText("");
51-
dataPanel.removeAll();
52-
} else {
53+
hostTextField.setForeground(Color.BLACK);
54+
} else if (hostTextField.getForeground().equals(Color.BLACK)) {
5355
handleComboBoxAction(null, host);
5456
}
5557
}
@@ -180,8 +182,6 @@ private void handleComboBoxAction(ActionEvent e, String host) {
180182
handleComboBoxWorker.cancel(true);
181183
}
182184

183-
dataPanel.removeAll();
184-
185185
handleComboBoxWorker = new SwingWorker<Object, Void>() {
186186
@Override
187187
protected Object doInBackground() {

src/main/java/caa/component/member/DatatablePanel.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,32 @@ public void changedUpdate(DocumentEvent e) {
145145
JPopupMenu popupMenu = new JPopupMenu();
146146
JMenuItem generatorPayload = new JMenuItem("Send to Payload Generator");
147147
JMenu copyMenu = new JMenu("Copy Payload");
148-
JMenuItem rawCopy = new JMenuItem("Raw");
148+
JMenu rawMenu = new JMenu("Raw");
149+
JMenuItem rawWithParamCopy = new JMenuItem("Raw with Param");
150+
JMenuItem rawWithCookieCopy = new JMenuItem("Raw with Cookie");
151+
JMenuItem rawWithHeaderCopy = new JMenuItem("Raw with Header");
149152
JMenuItem jsonCopy = new JMenuItem("Json");
150153
JMenuItem xmlCopy = new JMenuItem("Xml");
151-
copyMenu.add(rawCopy);
154+
copyMenu.add(rawMenu);
155+
rawMenu.add(rawWithParamCopy);
156+
rawMenu.add(rawWithCookieCopy);
157+
rawMenu.add(rawWithHeaderCopy);
152158
copyMenu.add(jsonCopy);
153159
copyMenu.add(xmlCopy);
154160

155-
rawCopy.addActionListener(e -> {
161+
rawWithParamCopy.addActionListener(e -> {
156162
String payload = getSelectedDataAtTable(dataTable);
157-
setClipboardContents(generator.generateRawParam(payload));
163+
setClipboardContents(generator.generateRawParam(payload, "=", "&"));
164+
});
165+
166+
rawWithCookieCopy.addActionListener(e -> {
167+
String payload = getSelectedDataAtTable(dataTable);
168+
setClipboardContents(generator.generateRawParam(payload, "=", "; "));
169+
});
170+
171+
rawWithHeaderCopy.addActionListener(e -> {
172+
String payload = getSelectedDataAtTable(dataTable);
173+
setClipboardContents(generator.generateRawParam(payload, ": ","\r\n"));
158174
});
159175

160176
jsonCopy.addActionListener(e -> {

src/main/java/caa/instances/Generator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,21 +243,21 @@ private String generateRandomString(int length, int strFlag) {
243243
return this.api.utilities().randomUtils().randomString(length, strFlag == 1 ? RandomUtils.CharacterSet.ASCII_LETTERS : RandomUtils.CharacterSet.DIGITS);
244244
}
245245

246-
public String generateRawParam(String payload) {
246+
public String generateRawParam(String payload, String formatChar, String delimiter) {
247247
List<String> paramValueList = new ArrayList<>();
248-
String formatString = "{0}={1}";
248+
String formatString = "{0}{1}{2}";
249249
if (payload.contains("=")) {
250250
for (String paramValue : payload.split("\r\n")) {
251251
String param = paramValue.split("=")[0];
252252
String value = httpUtils.decodeParameter(paramValue.split("=")[1]);
253-
paramValueList.add(MessageFormat.format(formatString, param, value));
253+
paramValueList.add(MessageFormat.format(formatString, param, formatChar, value));
254254
}
255255
} else {
256256
for (String param : payload.split("\r\n")) {
257-
paramValueList.add(MessageFormat.format(formatString, param, generateRandomString(6, 1)));
257+
paramValueList.add(MessageFormat.format(formatString, param, formatChar, generateRandomString(6, 1)));
258258
}
259259
}
260-
return String.join("&", paramValueList);
260+
return String.join(delimiter, paramValueList);
261261
}
262262

263263
public String generateJsonParam(String payload) {

0 commit comments

Comments
 (0)