Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Apr 1, 2024
1 parent 408c605 commit 0b870f5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
10 changes: 7 additions & 3 deletions src/InternetSearch/APISearchAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public class APISearchAction extends AbstractAction{


private boolean autoAddToTarget;
private boolean showInGUI;

public APISearchAction(AbstractTableModel lineModel, int[] modelRows, int columnIndex, String engine,boolean autoAddToTarget) {
public APISearchAction(AbstractTableModel lineModel, int[] modelRows, int columnIndex, String engine,boolean autoAddToTarget,boolean showInGUI) {
super();

if (!lineModel.getClass().equals(LineTableModel.class) &&
Expand All @@ -54,10 +55,11 @@ public APISearchAction(AbstractTableModel lineModel, int[] modelRows, int column
this.engine = engine;
putValue(Action.NAME, "Search On "+capitalizeFirstLetter(engine.trim())+" API");
this.autoAddToTarget = autoAddToTarget;
this.showInGUI = showInGUI;
}

public APISearchAction(AbstractTableModel lineModel, int[] modelRows, int columnIndex, String engine) {
this(lineModel,modelRows,columnIndex,engine,false);
this(lineModel,modelRows,columnIndex,engine,false,true);
}


Expand Down Expand Up @@ -98,7 +100,9 @@ protected Map doInBackground() throws Exception {
}

List<SearchResultEntry> entries = parseResp(resp_body,engine);
BurpExtender.getGui().getSearchPanel().addSearchTab(searchContent, entries);
if (showInGUI) {
BurpExtender.getGui().getSearchPanel().addSearchTab(searchContent, entries);
}

if (autoAddToTarget) {
for (SearchResultEntry entry:entries) {
Expand Down
3 changes: 0 additions & 3 deletions src/InternetSearch/SearchResultEntryMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ public void actionPerformed(ActionEvent actionEvent) {

this.addSeparator();

JMenu DoMenu = new JMenu("Do");
this.add(DoMenu);

JMenu SearchMenu = new JMenu("Search");
this.add(SearchMenu);
SearchMenu.addSeparator();
Expand Down
14 changes: 7 additions & 7 deletions src/InternetSearch/SearchTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public SearchTable(GUIMain guiMain,SearchTableModel model)
this(guiMain);
setModel(model);
tableHeaderWidthinit();
registerListeners();
}

public SearchTableModel getSearchTableModel(){
Expand Down Expand Up @@ -91,12 +92,11 @@ public void tableHeaderWidthinit(){

public int[] SelectedRowsToModelRows(int[] SelectedRows) {

int[] rows = SelectedRows;
for (int i=0; i < rows.length; i++){
rows[i] = convertRowIndexToModel(rows[i]);//转换为Model的索引,否则排序后索引不对应〿
for (int i = 0; i < SelectedRows.length; i++){
SelectedRows[i] = convertRowIndexToModel(SelectedRows[i]);//转换为Model的索引,否则排序后索引不对应〿
}
Arrays.sort(rows);//升序
return rows;
Arrays.sort(SelectedRows);//升序
return SelectedRows;
}


Expand Down Expand Up @@ -155,13 +155,13 @@ public void mouseClicked(MouseEvent e) {
}
}

@Override//title表格中的鼠标右键菜单
@Override//表格中的鼠标右键菜单
public void mouseReleased( MouseEvent e ){//在windows中触发,因为isPopupTrigger在windows中是在鼠标释放是触发的,而在mac中,是鼠标点击时触发的。
//https://stackoverflow.com/questions/5736872/java-popup-trigger-in-linux
if ( SwingUtilities.isRightMouseButton( e )){
if (e.isPopupTrigger() && e.getComponent() instanceof JTable ) {
int[] rows = getSelectedRows();
int col = ((LineTable) e.getSource()).columnAtPoint(e.getPoint()); // 获得列位置
int col = ((SearchTable) e.getSource()).columnAtPoint(e.getPoint()); // 获得列位置
int modelCol = convertColumnIndexToModel(col);
if (rows.length>0){
int[] modelRows = SelectedRowsToModelRows(rows);
Expand Down
6 changes: 3 additions & 3 deletions src/domain/target/TargetEntryMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ public void actionPerformed(ActionEvent actionEvent) {
JMenuItem SearchOnZoomEyeItem = new JMenuItem(new BrowserSearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"zoomeye"));


JMenuItem SearchOnFoFaAutoItem = new JMenuItem(new APISearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"fofa"));
JMenuItem SearchOnFoFaAutoItem = new JMenuItem(new APISearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"fofa",true,false));

JMenuItem SearchOnQuakeAutoItem = new JMenuItem(new APISearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"quake"));
JMenuItem SearchOnQuakeAutoItem = new JMenuItem(new APISearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"quake",true,false));

JMenuItem SearchOnHunterAutoItem = new JMenuItem(new APISearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"hunter"));
JMenuItem SearchOnHunterAutoItem = new JMenuItem(new APISearchAction(this.rootDomainTable.getTargetModel(),modelRows,columnIndex,"hunter",true,false));


JMenuItem SearchAllItem = new JMenuItem(new AbstractAction("Search On All Engines") {
Expand Down
9 changes: 4 additions & 5 deletions src/title/LineTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@ public LineEntry getRowAt(int row) {
//将选中的行(图形界面的行)转换为Model中的行数(数据队列中的index).因为图形界面排序等操作会导致图像和数据队列的index不是线性对应的。
public int[] SelectedRowsToModelRows(int[] SelectedRows) {

int[] rows = SelectedRows;
for (int i=0; i < rows.length; i++){
rows[i] = convertRowIndexToModel(rows[i]);//转换为Model的索引,否则排序后索引不对应〿
for (int i = 0; i < SelectedRows.length; i++){
SelectedRows[i] = convertRowIndexToModel(SelectedRows[i]);//转换为Model的索引,否则排序后索引不对应〿
}
Arrays.sort(rows);//升序
Arrays.sort(SelectedRows);//升序

return rows;
return SelectedRows;
}

public LineTable(GUIMain guiMain)
Expand Down

0 comments on commit 0b870f5

Please sign in to comment.