Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Apr 13, 2024
1 parent 5bd61e7 commit 386ec6a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 27 deletions.
15 changes: 8 additions & 7 deletions src/InternetSearch/Client/FoFaClient.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package InternetSearch.Client;

import java.util.ArrayList;
import java.util.Base64;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;

import InternetSearch.SearchEngine;
import InternetSearch.SearchResultEntry;
import Tools.JSONHandler;
import config.ConfigManager;
import config.ConfigName;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Base64;
import java.util.List;

public class FoFaClient extends BaseClient {

Expand Down
13 changes: 11 additions & 2 deletions src/InternetSearch/Client/HunterClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Base64;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
Expand Down Expand Up @@ -38,8 +39,16 @@ public List<SearchResultEntry> parseResp(String respbody) {
for (Object item : items) {
JSONObject entryitem = (JSONObject) item;
SearchResultEntry entry = new SearchResultEntry();
entry.setHost(entryitem.getString("url"));
entry.getIPSet().add(entryitem.getString("ip"));

String url = entryitem.getString("url");
String ip = entryitem.getString("ip");
if (StringUtils.isNotEmpty(url)) {
entry.setHost(url);
}else {
entry.setHost(ip);
}

entry.getIPSet().add(ip);
entry.setRootDomain(entryitem.getString("domain"));
entry.setPort(entryitem.getInt("port"));
entry.setProtocol(entryitem.getString("protocol"));
Expand Down
37 changes: 19 additions & 18 deletions src/InternetSearch/SearchResultEntry.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package InternetSearch;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.lang3.StringUtils;

import burp.BurpExtender;
import burp.IPAddressUtils;
import domain.DomainManager;
import org.apache.commons.lang3.StringUtils;
import utils.DomainNameUtils;
import utils.GrepUtils;
import utils.URLUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

public class SearchResultEntry {
private int port = -1;
private String host = "";
Expand All @@ -23,21 +24,21 @@ public class SearchResultEntry {
private String webcontainer = "";
private String title = "";
private Set<String> CertDomainSet = new HashSet<String>();

private Set<String> IPSet = new HashSet<String>();

private String icon_url = "";
private byte[] icon_bytes = new byte[0];
private String icon_hash = "";
private String source = "";
private String ASNInfo = "";

private int AsnNum =-1;

public SearchResultEntry(String host) {

}

public SearchResultEntry() {

}
Expand Down Expand Up @@ -166,7 +167,7 @@ public String getIdentify() {
//不同搜索引擎的结果,是否要去重?
return getUri()+"#"+System.currentTimeMillis();
}

/**
* 类似: http://www.example.com:8442
* @return
Expand All @@ -185,8 +186,8 @@ private String buildUri() {
}
return URLUtils.getUrlWithDefaultPort(sb.toString());
}


public String getUri() {
if (uri != null && uri.length()>0) {
return uri;
Expand All @@ -205,7 +206,7 @@ public String getTitle() {
public void setTitle(String title) {
this.title = title;
}

public void AddToTarget() {
DomainManager domainResult = BurpExtender.getGui().getDomainPanel().getDomainResult();
if (IPAddressUtils.isValidIP(this.host)) {
Expand All @@ -214,14 +215,14 @@ public void AddToTarget() {
domainResult.getSpecialPortTargets().add(this.host+":"+this.port);
}
}

if (DomainNameUtils.isValidDomain(this.host)) {
domainResult.addToTargetAndSubDomain(this.host,true);
if (this.port >=0 && this.port <= 65535) {
domainResult.addToTargetAndSubDomain(this.host+":"+this.port,true);
}
}

if (StringUtils.isEmpty(this.rootDomain)) {
domainResult.addToTargetAndSubDomain(this.rootDomain,true);
}
Expand All @@ -235,7 +236,7 @@ public String toString() {
+ Arrays.toString(icon_bytes) + ", icon_hash=" + icon_hash + ", source=" + source + ", ASNInfo="
+ ASNInfo + "]";
}

public static void main(String[] args) {
SearchResultEntry item = new SearchResultEntry();
item.setHost("11.11.11.11:7000");
Expand Down

0 comments on commit 386ec6a

Please sign in to comment.