Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Jun 27, 2024
1 parent fb08f6b commit 5f1bf86
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 25 deletions.
54 changes: 29 additions & 25 deletions src/InternetSearch/SearchPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,33 @@ public Set<String> getAlreadySearchContent(){
}
return result;
}

public static void searchAtBackground(String content) {
SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
String searchType = null;

if (DomainUtils.isValidDomainNoPort(content)) {
searchType = SearchType.SubDomain;
} else if (IPAddressUtils.isValidIPv4NoPort(content)) {
searchType = SearchType.IP;
} else {
searchType = SearchType.OriginalString;
}

APISearchAction.DoSearchAllInOn(searchType, content, SearchEngine.getAssetSearchEngineList());

return null;
}

@Override
protected void done() {

}
};
worker.execute();
}

public JPanel createButtonPanel() {
JPanel buttonPanel = new JPanel();
Expand All @@ -274,31 +301,8 @@ public JPanel createButtonPanel() {
JButton buttonSearch = new JButton("Search");
buttonSearch.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
SwingWorker<Void, Void> worker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
String content = textFieldSearch.getText();
String searchType = null;

if (DomainUtils.isValidDomainNoPort(content)) {
searchType = SearchType.SubDomain;
} else if (IPAddressUtils.isValidIPv4NoPort(content)) {
searchType = SearchType.IP;
} else {
searchType = SearchType.OriginalString;
}

APISearchAction.DoSearchAllInOn(searchType, content, SearchEngine.getAssetSearchEngineList());

return null;
}

@Override
protected void done() {

}
};
worker.execute();
String content = textFieldSearch.getText();
searchAtBackground(content);
}
});
buttonPanel.add(buttonSearch);
Expand Down
15 changes: 15 additions & 0 deletions src/Tools/TextAreaMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.bit4woo.utilbox.utils.TextUtils;

import GUI.GUIMain;
import InternetSearch.SearchPanel;
import burp.BurpExtender;
import config.ConfigManager;
import config.ConfigName;
Expand Down Expand Up @@ -115,7 +116,21 @@ public void actionPerformed(ActionEvent actionEvent) {
}
});

JMenuItem doOnlineSearch = new JMenuItem(new AbstractAction("Do Online Search") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
for (String item:selectedItems) {
try {
SearchPanel.searchAtBackground(item);
} catch (Exception e2) {
e2.printStackTrace(stderr);
}
}
}
});

this.add(genPortScanCmd);
this.add(addToTarget);
this.add(doOnlineSearch);
}
}

0 comments on commit 5f1bf86

Please sign in to comment.