55import java .util .List ;
66import java .util .UUID ;
77
8+ import javax .sql .rowset .Joinable ;
89import javax .swing .JPanel ;
910import javax .swing .SwingUtilities ;
1011import javax .swing .SwingWorker ;
1112
1213import org .apache .commons .lang3 .StringUtils ;
1314
1415import com .bit4woo .utilbox .utils .ByteArrayUtils ;
16+ import com .bit4woo .utilbox .utils .DomainUtils ;
1517import com .bit4woo .utilbox .utils .EmailUtils ;
18+ import com .bit4woo .utilbox .utils .IPAddressUtils ;
1619import com .bit4woo .utilbox .utils .TextUtils ;
1720
1821import base .FindUrlAction ;
2124import burp .IExtensionHelpers ;
2225import burp .IMessageEditorController ;
2326import 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}
0 commit comments