Skip to content

Commit

Permalink
Update TextAreaMenu.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Jul 18, 2024
1 parent dd34d6f commit b7e9a8b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Tools/TextAreaMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import config.ConfigManager;
import config.ConfigName;
import domain.DomainManager;
import domain.target.AssetTrustLevel;
import utils.PortScanUtils;

public class TextAreaMenu extends JPopupMenu {
Expand Down Expand Up @@ -115,6 +116,26 @@ public void actionPerformed(ActionEvent actionEvent) {
guiMain.getDomainPanel().saveDomainDataToDB();
}
});


JMenuItem addToTargetConfirm = new JMenuItem(new AbstractAction("Add To Target(Confirm)") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
DomainManager domainResult = guiMain.getDomainPanel().getDomainResult();
for (String item:selectedItems) {
try {
if (IPAddressUtils.isValidIPv4MayPort(item)) {
domainResult.getSpecialPortTargets().add(item);
}else {
domainResult.addToTargetAndSubDomain(item,true,AssetTrustLevel.Confirm);
}
} catch (Exception e2) {
e2.printStackTrace(stderr);
}
}
guiMain.getDomainPanel().saveDomainDataToDB();
}
});

JMenuItem doOnlineSearch = new JMenuItem(new AbstractAction("Do Online Search") {
@Override
Expand All @@ -131,6 +152,7 @@ public void actionPerformed(ActionEvent actionEvent) {

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

0 comments on commit b7e9a8b

Please sign in to comment.