Skip to content

Commit 2fa413d

Browse files
committed
update
1 parent 54bec78 commit 2fa413d

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

src/messageTab/Info/InfoEntry.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public class InfoEntry {
1212

1313
public static final String Type_URL ="Type_URL";
1414
public static final String Type_Email ="Type_Email";
15+
public static final String Type_Domain ="Type_Domain";
16+
public static final String Type_IP ="Type_IP";
1517

1618
public InfoEntry() {
1719
//to resolve "default constructor not found" error

src/messageTab/Info/InfoTab.java

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
import java.util.List;
66
import java.util.UUID;
77

8+
import javax.sql.rowset.Joinable;
89
import javax.swing.JPanel;
910
import javax.swing.SwingUtilities;
1011
import javax.swing.SwingWorker;
1112

1213
import org.apache.commons.lang3.StringUtils;
1314

1415
import com.bit4woo.utilbox.utils.ByteArrayUtils;
16+
import com.bit4woo.utilbox.utils.DomainUtils;
1517
import com.bit4woo.utilbox.utils.EmailUtils;
18+
import com.bit4woo.utilbox.utils.IPAddressUtils;
1619
import com.bit4woo.utilbox.utils.TextUtils;
1720

1821
import base.FindUrlAction;
@@ -21,6 +24,7 @@
2124
import burp.IExtensionHelpers;
2225
import burp.IMessageEditorController;
2326
import burp.IMessageEditorTab;
27+
import inet.ipaddr.IPAddress;
2428

2529
/**
2630
* @author bit4woo
@@ -168,6 +172,28 @@ protected List<InfoEntry> doInBackground() {
168172
for (String email : emails) {
169173
entries.add(new InfoEntry(email, InfoEntry.Type_Email));
170174
}
175+
176+
String info_text = String.join(System.lineSeparator(), urls);
177+
info_text = info_text + String.join(System.lineSeparator(), emails);
178+
179+
180+
List<String> domains = DomainUtils.grepDomainAndPort(new String(originContent));
181+
domains = TextUtils.deduplicate(domains);
182+
for (String domain : domains) {
183+
if (info_text.contains(domain)) {
184+
continue;
185+
}
186+
entries.add(new InfoEntry(domain, InfoEntry.Type_Domain));
187+
}
188+
189+
List<String> iPList = IPAddressUtils.grepIPv4MayPort(new String(originContent));
190+
iPList = TextUtils.deduplicate(iPList);
191+
for (String ip : iPList) {
192+
if (info_text.contains(ip)) {
193+
continue;
194+
}
195+
entries.add(new InfoEntry(ip, InfoEntry.Type_IP));
196+
}
171197

172198
if (entries.isEmpty()) {
173199
entries.add(new InfoEntry("No Info To Display", InfoEntry.Type_URL));
@@ -219,12 +245,12 @@ public boolean isModified() {
219245
*/
220246
@Override
221247
public byte[] getSelectedData() {
222-
InfoTable table = (InfoTable) ((InfoPanel) panel).getTable();
223-
String content = table.getSelectedContent();
224-
return content.getBytes();
248+
InfoTable table = (InfoTable) ((InfoPanel) panel).getTable();
249+
return table.getSelectedContent().getBytes();
225250
}
226251

227252

253+
228254
public static void main(String[] args) {
229255
}
230256
}

src/messageTab/Info/InfoTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ public List<String> getSelectedUrls() {
268268
return result;
269269
}
270270

271+
271272
public String getSelectedContent() {
272273
int[] rows = this.getSelectedRows();
273274
int[] columns = this.getSelectedColumns();
274275

275-
// ⚠️ 有可能在反选瞬间 rows/cols 为空 → 避免返回空内容
276276
if (rows == null || rows.length == 0 || columns == null || columns.length == 0) {
277277
return ""; // 或者 return null;
278278
}

0 commit comments

Comments
 (0)