Skip to content

Commit

Permalink
功能新增:
Browse files Browse the repository at this point in the history
1. 配置代理
2. 项目设置,用于批量查询
3. 规则设置,用于查询框自动联想,已预设fofa自带的查询语法
4. 复制当前查询的链接,用于debug
  • Loading branch information
flashine committed Feb 27, 2022
1 parent 27b9bb5 commit 04208af
Show file tree
Hide file tree
Showing 21 changed files with 469 additions and 204 deletions.
31 changes: 30 additions & 1 deletion src/main/java/org/fofaviewer/bean/ExcelBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Objects;

@EqualsAndHashCode(callSuper = true)
@Data
@HeadFontStyle(fontHeightInPoints = 16)
@ContentFontStyle(fontHeightInPoints = 14)
public class ExcelBean extends BaseBean {

@ColumnWidth(35)
@ExcelProperty(value="host", index=0)
@ExcelProperty(value="Host", index=0)
private String host;

@ColumnWidth(75)
Expand Down Expand Up @@ -57,4 +59,31 @@ public ExcelBean(String host, String title, String ip, String domain, Integer po
this.fid = fid;
this.certCN = certCN;
}

@Override
public boolean equals(Object obj) {
if (!(obj instanceof ExcelBean))
return false;
if (this == obj)
return true;
ExcelBean instance = (ExcelBean) obj;
boolean port = this.port.equals(instance.port);
boolean host = this.host.equals(instance.host);
if(port){
if(this.port == 443 && (this.host.contains(":443") || instance.host.contains(":443"))){
host = true;
}
if(this.port == 80 && (this.host.contains(":80") || instance.host.contains(":80"))){
host = true;
}
}
boolean ip = this.ip.equals(instance.ip);

return host && ip && port;
}

@Override
public int hashCode() {
return Objects.hash(ip, port);
}
}
8 changes: 4 additions & 4 deletions src/main/java/org/fofaviewer/bean/TabDataBean.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package org.fofaviewer.bean;
import java.util.HashMap;
import java.util.HashSet;

public class TabDataBean {
/**
Expand All @@ -13,7 +13,7 @@ public class TabDataBean {
/**
* 导出查询条件对应tab页中的url,用于后续扫描
*/
public HashMap<String, String> dataList;
public HashSet<String> dataList;
/**
* 是否还有未加载的数据
*/
Expand All @@ -23,12 +23,12 @@ public class TabDataBean {
*/
public int page = 1;

public TabDataBean(int count, HashMap<String, String> dataList) {
public TabDataBean(int count, HashSet<String> dataList) {
this.count = count;
this.dataList = dataList;
}
public TabDataBean(){
this.count = 0;
this.dataList = new HashMap<>();
this.dataList = new HashSet<>();
}
}
28 changes: 28 additions & 0 deletions src/main/java/org/fofaviewer/bean/TableBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;

import java.util.Objects;

public class TableBean extends BaseBean{
public SimpleIntegerProperty num = new SimpleIntegerProperty();
public SimpleStringProperty host = new SimpleStringProperty();
Expand Down Expand Up @@ -86,4 +88,30 @@ public SimpleStringProperty getCert() {
public SimpleStringProperty getCertCN() {
return certCN;
}

@Override
public boolean equals(Object obj) {
if (!(obj instanceof TableBean))
return false;
if (this == obj)
return true;
TableBean instance = (TableBean) obj;
boolean bool_host = this.host.getValue().equals(instance.host.getValue());
boolean bool_port = this.port.getValue().equals(instance.port.getValue());
if(bool_port){
if(this.port.getValue() == 443 && (this.host.getValue().contains(":443") || instance.host.getValue().contains(":443"))){
bool_host = true;
}
if(this.port.getValue() == 80 && (this.host.getValue().contains(":80") || instance.host.getValue().contains(":80"))){
bool_host = true;
}
}
boolean bool_ip = this.ip.getValue().equals(instance.ip.getValue());
return bool_host && bool_ip && bool_port;
}

@Override
public int hashCode() {
return Objects.hash(ip.getValue(), port.getValue());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.fofaviewer.request;
package org.fofaviewer.callback;

import javafx.scene.control.TableView;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.fofaviewer.request;
package org.fofaviewer.callback;

import javafx.scene.control.Tab;
import javafx.scene.layout.BorderPane;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/fofaviewer/callback/SaveOptionCallback.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.fofaviewer.callback;

public interface SaveOptionCallback{
default void setProjectName(String name){}
default String getProjectName(){
return null;
}
}
Loading

0 comments on commit 04208af

Please sign in to comment.