Repository: tangxiaofeng7/Fofa-collect
Branch: master
Commit: 59bb3a4acc1b
Files: 38
Total size: 52.3 KB
Directory structure:
gitextract_zno1ssb6/
├── .idea/
│ ├── .gitignore
│ ├── .name
│ ├── artifacts/
│ │ └── FofaCollect_jar.xml
│ ├── compiler.xml
│ ├── jarRepositories.xml
│ ├── libraries/
│ │ ├── Maven__cn_hutool_hutool_core_5_7_3.xml
│ │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml
│ │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml
│ │ └── Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
├── FofaCollect.iml
├── META-INF/
│ └── MANIFEST.MF
├── README.md
├── pom.xml
└── src/
├── META-INF/
│ └── MANIFEST.MF
└── main/
└── java/
├── META-INF/
│ └── MANIFEST.MF
└── com/
└── suyu/
├── Main.java
├── controller/
│ ├── FofaController.java
│ ├── FofaPwdController.java
│ └── MainController.java
├── core/
│ ├── DO/
│ │ ├── FofaData.java
│ │ ├── User.java
│ │ └── UserLogin.java
│ ├── client/
│ │ └── FofaClient.java
│ ├── constants/
│ │ ├── FofaClientConsts.java
│ │ ├── FofaFieldsConsts.java
│ │ └── UserConsts.java
│ ├── enmus/
│ │ └── UserVipLevelEnum.java
│ ├── exception/
│ │ └── FofaException.java
│ └── util/
│ └── HttpUtils.java
├── utils/
│ ├── FileTools.java
│ ├── Path.java
│ └── Tools.java
└── views/
├── FoFa.fxml
├── Main.fxml
└── fofa_pwd.fxml
================================================
FILE CONTENTS
================================================
================================================
FILE: .idea/.gitignore
================================================
# 默认忽略的文件
/shelf/
/workspace.xml
# 数据源本地存储已忽略文件
/dataSources/
/dataSources.local.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
================================================
FILE: .idea/.name
================================================
FofaCollect
================================================
FILE: .idea/artifacts/FofaCollect_jar.xml
================================================
<component name="ArtifactManager">
<artifact type="jar" name="FofaCollect:jar">
<output-path>$PROJECT_DIR$/out/artifacts/FofaCollect_jar</output-path>
<root id="archive" name="FofaCollect.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/src/META-INF/MANIFEST.MF" />
</element>
<element id="module-output" name="FofaCollect" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.10.4/jackson-databind-2.9.10.4.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/r4v3zn/fofa/fofa-core/1.0.2.RELEASE/fofa-core-1.0.2.RELEASE.jar" path-in-jar="/" />
<element id="extracted-dir" path="$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.10/jackson-annotations-2.9.10.jar" path-in-jar="/" />
</root>
</artifact>
</component>
================================================
FILE: .idea/compiler.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="FofaCollect" />
</profile>
</annotationProcessing>
<bytecodeTargetLevel>
<module name="FofaCollect" target="6" />
</bytecodeTargetLevel>
</component>
</project>
================================================
FILE: .idea/jarRepositories.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/central/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>
================================================
FILE: .idea/libraries/Maven__cn_hutool_hutool_core_5_7_3.xml
================================================
<component name="libraryTable">
<library name="Maven: cn.hutool:hutool-core:5.7.3">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-core/5.7.3/hutool-core-5.7.3.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-core/5.7.3/hutool-core-5.7.3-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-core/5.7.3/hutool-core-5.7.3-sources.jar!/" />
</SOURCES>
</library>
</component>
================================================
FILE: .idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml
================================================
<component name="libraryTable">
<library name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.12.4/jackson-annotations-2.12.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.12.4/jackson-annotations-2.12.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.12.4/jackson-annotations-2.12.4-sources.jar!/" />
</SOURCES>
</library>
</component>
================================================
FILE: .idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml
================================================
<component name="libraryTable">
<library name="Maven: com.fasterxml.jackson.core:jackson-core:2.12.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.12.4/jackson-core-2.12.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.12.4/jackson-core-2.12.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.12.4/jackson-core-2.12.4-sources.jar!/" />
</SOURCES>
</library>
</component>
================================================
FILE: .idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml
================================================
<component name="libraryTable">
<library name="Maven: com.fasterxml.jackson.core:jackson-databind:2.12.4">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.12.4/jackson-databind-2.12.4.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.12.4/jackson-databind-2.12.4-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.12.4/jackson-databind-2.12.4-sources.jar!/" />
</SOURCES>
</library>
</component>
================================================
FILE: .idea/misc.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
</project>
================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/FofaCollect.iml" filepath="$PROJECT_DIR$/FofaCollect.iml" />
</modules>
</component>
</project>
================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
================================================
FILE: FofaCollect.iml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_6">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.12.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.12.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.4" level="project" />
<orderEntry type="library" name="Maven: cn.hutool:hutool-core:5.7.3" level="project" />
</component>
</module>
================================================
FILE: META-INF/MANIFEST.MF
================================================
Manifest-Version: 1.0
Main-Class: com.suyu.Main
================================================
FILE: README.md
================================================
# Fofa-collect
### 版本说明
支持jdk8直接运行
jdk11因为没有javafx这个依赖需要自己再加上参数
```
java -Dfile.encoding="UTF-8" --module-path "C:\Program Files\Java\javafx-sdk-11.0.2\lib" --add-modules "javafx.controls,javafx.fxml,javafx.web" -jar "xxx.jar"
```
<br></br>
### star趋势
[](https://starchart.cc/tangxiaofeng7/Fofa-collect)
================================================
FILE: pom.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.suyu</groupId>
<artifactId>FofaConllect</artifactId>
<version>3.0</version>
<packaging>jar</packaging>
<build>
<finalName>FofaCollect</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>libs/</classpathPrefix>
<mainClass>com.suyu.Main</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>6</source>
<target>6</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.fxml</include>
<include>**/*.ini</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</build>
<dependencies>
<!-- jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.12.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.12.4</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-core</artifactId>
<version>5.7.3</version>
</dependency>
</dependencies>
</project>
================================================
FILE: src/META-INF/MANIFEST.MF
================================================
Manifest-Version: 1.0
Main-Class: com.suyu.Main
================================================
FILE: src/main/java/META-INF/MANIFEST.MF
================================================
Manifest-Version: 1.0
Main-Class: com.suyu.Main
================================================
FILE: src/main/java/com/suyu/Main.java
================================================
package com.suyu;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class Main extends Application {
@Override
public void start(Stage primaryStage) throws Exception{
Parent root = FXMLLoader.load(getClass().getClassLoader().getResource("com/suyu/views/Main.fxml"));
primaryStage.setTitle("FofaCollect by txf");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
================================================
FILE: src/main/java/com/suyu/controller/FofaController.java
================================================
package com.suyu.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.suyu.Main;
import com.suyu.core.DO.FofaData;
import com.suyu.core.client.FofaClient;
import com.suyu.utils.FileTools;
import com.suyu.utils.Path;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import java.net.URL;
import java.util.ResourceBundle;
public class FofaController extends Main implements Initializable {
@FXML
private Button stop_btn;
@FXML
private TextArea result_text;
@FXML
private ComboBox<?> page_cbx;
@FXML
private TextField fofa_q;
@FXML
private Button search_btn;
@FXML
private Button clear_btn;
@FXML
private ProgressBar processbar;
private MainController main;
private GoThread t;
public FofaController() {
}
public MainController getMain() {
return this.main;
}
public void setMain(MainController main) {
ObservableList products = FXCollections.observableArrayList((Object[]) new String[]{"1", "99", "500", "999", "9999"});
this.page_cbx.setItems(products);
this.page_cbx.getSelectionModel().select(2);
this.main = main;
this.syslog("在使用本工具前,请先在配置您的Fofa账号和KEY");
}
public void syslog(String log) {
this.result_text.appendText(log + "\r\n");
}
private void go() throws JsonProcessingException {
String pa = Path.getRootPath() + "fofa.ini";
String pstr = FileTools.readFileAllContent(pa, "utf-8");
if (pstr.equals("")) {
this.syslog("提示:在使用本工具前,请先在配置您的Fofa账号和KEY");
}
String[] ps = pstr.split(":");
String email = ps[0];
String key = ps[1].replace("\n", "");
String q = this.fofa_q.getText();
int p = Integer.parseInt(this.page_cbx.getValue().toString());
FofaClient client = new FofaClient(email, key);
try {
System.out.println(client.getUser());
} catch (Exception e) {
e.printStackTrace();
}
for (int i = 1; i < p; ++i) {
processbar.setProgress((float) i / (float) p);
FofaData a = new FofaData();
try {
a = client.getData(q, i);
} catch (Exception ex) {
this.syslog(ex.toString());
}
String b = String.valueOf(a.getResults());
String c = b.substring(b.indexOf("[") + 1,b.indexOf("]")).replace(", ", "\n").replace("https://", "").replace("http://", ".");
this.syslog(c);
}
}
public void fofa_search(ActionEvent actionEvent) {
this.result_text.setText("");
(t = new GoThread()).start();
}
public void fofa_search_stop(ActionEvent actionEvent) {
t.stop();
processbar.setProgress(1);
}
public void fofa_clear(ActionEvent actionEvent) {
this.result_text.setText("");
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
class GoThread extends Thread {
@Override
public void run() {
try {
go();
} catch (JsonProcessingException e) {
e.printStackTrace();
}
}
}
}
================================================
FILE: src/main/java/com/suyu/controller/FofaPwdController.java
================================================
package com.suyu.controller;
import com.suyu.utils.*;
import javafx.fxml.*;
import javafx.scene.control.*;
import javafx.event.*;
import java.net.*;
import java.util.*;
public class FofaPwdController implements Initializable {
@FXML
private Button fofa_save;
@FXML
private TextField key_id;
@FXML
private TextArea fofa_acc_text;
@FXML
private TextField mail_account;
private MainController main;
// public void setMain(final MainController main) {
// this.main = main;
// }
public void syslog(final String log) {
this.fofa_acc_text.appendText(log + "----" + Tools.getTimeNow() + "\r\n");
}
@FXML
public void savefofa(final Event e) {
final String pc = this.mail_account.getText() + ":" + this.key_id.getText();
FileTools.writeFile(Path.getRootPath() + "fofa.ini", pc);
this.syslog("配置文件修改成功");
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}
================================================
FILE: src/main/java/com/suyu/controller/MainController.java
================================================
package com.suyu.controller;
import com.suyu.utils.*;
import javafx.event.*;
import javafx.stage.*;
import javafx.fxml.*;
import javafx.scene.control.*;
import javafx.scene.*;
import java.net.*;
import java.util.*;
public class MainController implements Initializable {
@FXML
private TabPane mainTabPane;
@FXML
public static TextArea txtlog;
@FXML
private ToggleButton PortScanStop_btn;
@FXML
private static TextField Target_port;
@FXML
private TextArea PortScan_ip;
@FXML
private ToggleButton PortScanStart_btn;
@FXML
private ToggleButton PortImport_btn;
@FXML
private MenuItem close;
public void syslog(final String log) {
MainController.txtlog.appendText(log + "----" + Tools.getTimeNow() + "\r\n");
}
@FXML
public void about(final Event e) {
try {
final DialogPane da = new DialogPane();
da.setHeaderText("唐小风 \n Wechat: suyu401");
final Stage stage = new Stage();
final Scene sc = new Scene((Parent)da);
stage.setScene(sc);
stage.initStyle(StageStyle.UTILITY);
stage.initModality(Modality.WINDOW_MODAL);
stage.setTitle("关于我");
stage.setAlwaysOnTop(true);
stage.show();
}
catch (Exception ex) {
ex.printStackTrace();
}
}
public void openFofacollect(final Event e) {
try {
final FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getClassLoader().getResource("com/suyu/views/FoFa.fxml"));
final Parent root = (Parent)fxmlLoader.load();
final FofaController fo = (FofaController)fxmlLoader.getController();
fo.setMain(this);
final Tab tab = new Tab();
tab.setText("Fofa查询窗口界面");
tab.setContent((Node)root);
this.mainTabPane.getTabs().add((Tab) tab);
this.mainTabPane.getSelectionModel().select(tab);
}
catch (Exception var2) {
this.syslog(var2.getMessage());
}
}
@FXML
private void fofa_pwd(final Event event) {
try {
final FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(getClass().getClassLoader().getResource("com/suyu/views/fofa_pwd.fxml"));
final Parent root = (Parent)fxmlLoader.load();
final Stage stage = new Stage();
final Scene sc = new Scene(root);
stage.setScene(sc);
stage.setAlwaysOnTop(true);
stage.show();
}
catch (Exception var3) {
this.syslog(var3.getMessage());
}
}
@Override
public void initialize(URL location, ResourceBundle resources) {
}
}
================================================
FILE: src/main/java/com/suyu/core/DO/FofaData.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.DO;
import java.util.List;
/**
* Title: FofaData
* Descrption: this is fofa datas
* Date:2019-06-08 17:49
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
*
* @author R4v3zn
* @version 1.0.0
*/
public class FofaData {
/**
* mode
*/
private String mode;
/**
* current page no
*/
private Integer page;
/**
* total size
*/
private Integer size;
/**
* total page
*/
private Integer totalPage;
/**
* query
*/
private String query;
/**
* results
*/
private List<List<String>> results;
public void setQuery(String query) {
this.query = query;
}
public String getQuery() {
return query;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
public Integer getTotalPage() {
return totalPage;
}
public String getMode() {
return mode;
}
public Integer getPage() {
return page;
}
public Integer getSize() {
return size;
}
public List<List<String>> getResults() {
return results;
}
public void setResults(List<List<String>> results) {
this.results = results;
}
public void setMode(String mode) {
this.mode = mode;
}
public void setPage(Integer page) {
this.page = page;
}
public void setSize(Integer size) {
this.size = size;
}
@Override
public String toString() {
return "FofaData{" +
"mode='" + mode + '\'' +
", page=" + page +
", size=" + size +
", totalPage=" + totalPage +
", query='" + query + '\'' +
", results=" + results +
'}';
}
}
================================================
FILE: src/main/java/com/suyu/core/DO/User.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.DO;
import com.suyu.core.enmus.UserVipLevelEnum;
/**
* Title: User
* Descrption: this is User
* Date:2019-06-07 16:00
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
* @author R4v3zn
* @version 1.0.0
*/
public class User {
/**
* user email
*/
private String email;
/**
* username;
*/
private String userName;
/**
* fcion
*/
private Integer fCoin;
/**
* vip
*/
private Boolean isVip;
/**
* vip level
*/
private UserVipLevelEnum vipLevel;
/**
* is verified
*/
private Boolean isVerified;
/**
* avatar
*/
private String avatar;
/**
* message count
*/
private Integer message;
/**
* fofacli version
*/
private String fofacliVersion;
/**
* fofa server
*/
private Boolean fofaServer;
/**
* User
* @param email email
* @param userName name
* @param fCoin FCoin
* @param isVip is vip
* @param vipLevel vip level
* @param isVerified is verified
* @param avatar avatar link
* @param message message count
* @param fofacliVersion fofacli version
* @param fofaServer fofaServer
*/
public User(String email, String userName, Integer fCoin, Boolean isVip, UserVipLevelEnum vipLevel, Boolean isVerified, String avatar, Integer message, String fofacliVersion, Boolean fofaServer) {
this.email = email;
this.userName = userName;
this.fCoin = fCoin;
this.isVip = isVip;
this.vipLevel = vipLevel;
this.isVerified = isVerified;
this.avatar = avatar;
this.message = message;
this.fofacliVersion = fofacliVersion;
this.fofaServer = fofaServer;
}
public void setEmail(String email) {
this.email = email;
}
public void setUserName(String userName) {
this.userName = userName;
}
public void setfCoin(Integer fCoin) {
this.fCoin = fCoin;
}
public void setVip(Boolean vip) {
isVip = vip;
}
public void setVipLevel(UserVipLevelEnum vipLevel) {
this.vipLevel = vipLevel;
}
public void setVerified(Boolean verified) {
isVerified = verified;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
public void setMessage(Integer message) {
this.message = message;
}
public void setFofacliVersion(String fofacliVersion) {
this.fofacliVersion = fofacliVersion;
}
public void setFofaServer(Boolean fofaServer) {
this.fofaServer = fofaServer;
}
public String getEmail() {
return email;
}
public String getUserName() {
return userName;
}
public Integer getfCoin() {
return fCoin;
}
public Boolean getVip() {
return isVip;
}
public UserVipLevelEnum getVipLevel() {
return vipLevel;
}
public Boolean getVerified() {
return isVerified;
}
public String getAvatar() {
return avatar;
}
public Integer getMessage() {
return message;
}
public String getFofacliVersion() {
return fofacliVersion;
}
public Boolean getFofaServer() {
return fofaServer;
}
@Override
public String toString() {
return "User{" +
"email='" + email + '\'' +
", userName='" + userName + '\'' +
", fCoin=" + fCoin +
", isVip=" + isVip +
", vipLevel=" + vipLevel +
", isVerified=" + isVerified +
", avatar='" + avatar + '\'' +
", message=" + message +
", fofacliVersion='" + fofacliVersion + '\'' +
", fofaServer=" + fofaServer +
'}';
}
}
================================================
FILE: src/main/java/com/suyu/core/DO/UserLogin.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.DO;
/**
* Title: UserLogin
* Descrption: UserLogin DO
* Date:2019-06-07 16:13
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
* @author R4v3zn
* @version 1.0.0
*/
public class UserLogin {
/**
* this is FOFA Pro email
*/
private String email;
/**
* this is FOFA Pro key
*/
private String key;
/**
* Constructor
* @param email user email
* @param key user key
*/
public UserLogin(String email, String key) {
this.email = email;
this.key = key;
}
public String getEmail() {
return email;
}
public String getKey() {
return key;
}
public void setEmail(String email) {
this.email = email;
}
public void setKey(String key) {
this.key = key;
}
}
================================================
FILE: src/main/java/com/suyu/core/client/FofaClient.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.client;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.suyu.core.DO.FofaData;
import com.suyu.core.DO.User;
import com.suyu.core.DO.UserLogin;
import com.suyu.core.enmus.UserVipLevelEnum;
import com.suyu.core.exception.FofaException;
import com.suyu.core.util.HttpUtils;
import java.util.*;
import static cn.hutool.core.codec.Base64.encode;
import static com.suyu.core.constants.FofaClientConsts.*;
import static com.suyu.core.constants.FofaFieldsConsts.FIELDS_LIST;
/**
* Title: FofaClient
* Descrption: this is FOFA Pro client
* Date:2019-06-07 14:21
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
* @author R4v3zn
* @version 1.0.0
*/
public class FofaClient {
private String email;
private String key;
/**
* Constructor
* @param email email
* @param key key
*/
public FofaClient(String email, String key){
this.email = email;
this.key = key;
}
/**
* Jackson mapper
*/
private ObjectMapper mapper = new ObjectMapper();
/**
* getUserLogin
* @return
*/
public UserLogin getUserLogin(){
return new UserLogin(email, key);
}
/**
* get user info
* @return
*/
public User getUser() throws Exception{
String loginEmail = this.email;
String loginKey = this.key;
// get user
String url = BASE_URL + GET_USER_INFO_URI;
Map<String,Object> map = new HashMap<String, Object>();
map.put("email", loginEmail);
map.put("key", loginKey);
String rsp = HttpUtils.doGet(url, map);
JsonNode node = mapper.readTree(rsp);
JsonNode errorNode = node.get("error");
if(errorNode != null && errorNode.asBoolean()){
throw new FofaException(node.get("errmsg").asText());
}
String email = node.get("email").asText();
String userName = node.get("username").asText();
Integer fCoin = node.get("fcoin").asInt();
Boolean isVip = node.get("isvip").asBoolean();
Integer vipLevel = node.get("vip_level").asInt();
Boolean isVerified = node.get("is_verified").asBoolean();
String avatar = node.get("avatar").asText();
Integer message = node.get("message").asInt();
String fofacliVersion = node.get("fofacli_ver").asText();
Boolean fofaServer = node.get("fofacli_ver").asBoolean();
UserVipLevelEnum vipLevelEnum = vipLevel == 1?UserVipLevelEnum.VIP:UserVipLevelEnum.SVIP;
User user = new User(email,userName,fCoin,isVip,vipLevelEnum,isVerified,avatar,message,fofacliVersion, fofaServer);
return user;
}
/**
* get data
* <p>
* page default 1
* size default 100
* fields default host
* full default false
* </p>
* @param q search query(not encode)
* @return fofa search result data
* @throws Exception search Expection
*/
public FofaData getData(String q) throws Exception {
return getData(q, 1,100,"host",false);
}
/**
* get data
* <p>
* size default 100
* fields default host
* full default false
* </p>
* @param q search query(not encode)
* @param page page
* @return fofa search result data
* @exception Exception search Expection
*/
public FofaData getData(String q,Integer page) throws Exception {
return getData(q, page,100,"host",false);
}
/**
* get data
* <p>
* fields default host
* full default false
* </p>
* @param q search query(not encode)
* @param page page
* @param size page size
* @return fofa search result data
* @exception Exception search Expection
*/
public FofaData getData(String q,Integer page,Integer size) throws Exception{
return getData(q, page,size,"host",false);
}
/**
* get data
* <p>
* full default false
* </p>
* @param q search query(not encode)
* @param page page
* @param size page size
* @param fields fields
* @return fofa search result data
* @throws Exception search Expection
*/
public FofaData getData(String q,Integer page,Integer size,String fields)throws Exception{
return getData(q,page,size,fields,false);
}
/**
* get data
* @param q search query(not encode)
* @param page page no
* @param size page size
* @param fields fields
* @param full is full
* @return fofa search result data
*/
public FofaData getData(String q, Integer page, Integer size, String fields, Boolean full) throws Exception{
checkParam(q,size,fields);
// check page
page = page < 0 ? 1:page;
// check full is not null
full = full == null ? false:full;
String url = BASE_URL+SEARCH_URI;
Map<String,Object> map = new HashMap<String, Object>();
map.put("qbase64", encode(q));
map.put("page", page);
map.put("size", size);
map.put("fields", fields);
map.put("full",full);
map.put("key", key);
map.put("email", email);
String rsp = HttpUtils.doGet(url, map);
JsonNode node = mapper.readTree(rsp);
JsonNode errorNode = node.get("error");
if(errorNode != null && errorNode.asBoolean()){
throw new FofaException(node.get("errmsg").asText());
}
String mode = node.get("mode").asText();
String query = node.get("query").asText();
Integer rspPage = node.get("page").asInt();
Integer totalSize = node.get("size").asInt();
String results = node.get("results").toString();
Integer totalPage = totalSize%size == 0 ? totalSize/size:totalSize/size + 1;
FofaData fofaData = new FofaData();
fofaData.setMode(mode);
fofaData.setPage(rspPage);
fofaData.setSize(totalSize);
fofaData.setQuery(query);
fofaData.setTotalPage(totalPage);
List<List<String>> list = mapper.readValue(results, List.class);
fofaData.setResults(list);
return fofaData;
}
/**
* check param
* @param q search query
* @param size size
* @param fields fields
* @throws FofaException
*/
public void checkParam(String q,Integer size, String fields)throws FofaException{
// check search query
if(q == null || "".equals(q)){
throw new FofaException("search query cannot be empty");
}
// check max size
if(size > MAX_SIZE){
throw new FofaException("max size "+MAX_SIZE);
}
// check fields
List<String> splitList = Arrays.asList(fields.split(","));
splitList = new ArrayList<String>(splitList);
splitList.removeAll(FIELDS_LIST);
if(splitList.size() > 0){
throw new FofaException(splitList+" not's fields,please delte that");
}
}
}
================================================
FILE: src/main/java/com/suyu/core/constants/FofaClientConsts.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.constants;
/**
* Title: FofaClientConsts
* Descrption: this is Fofo Pro Client Constants
* Date:2019-06-07 21:56
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
*
* @author R4v3zn
* @version 1.0.0
*/
public class FofaClientConsts {
/**
* Base FOFA Pro Api
*/
// public static final String BASE_URL = "https://fofa.so";
public static final String BASE_URL = "https://fofa.info";
/**
* get user info uri
*/
public static final String GET_USER_INFO_URI = "/api/v1/info/my";
/**
* search uri
*/
public static final String SEARCH_URI = "/api/v1/search/all";
/**
* max size
*/
public static final Integer MAX_SIZE = 10000;
}
================================================
FILE: src/main/java/com/suyu/core/constants/FofaFieldsConsts.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.constants;
import java.util.Arrays;
import java.util.List;
/**
* Title: FofaFieldsConsts
* Descrption: this is FOFA Pro fields Constants
* Date:2019-06-08 18:53
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
*
* @author R4v3zn
* @version 1.0.0
*/
public class FofaFieldsConsts {
/**
* FOFA Pro fields list
*/
public static final List<String> FIELDS_LIST = Arrays.asList(new String[]{"host","title","ip","domain","port","country","province","city","country_name","header","protocol","banner","cert","isp","as_number","as_organization","latitude","longitude"});
}
================================================
FILE: src/main/java/com/suyu/core/constants/UserConsts.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.constants;
/**
* Title: UserConsts
* Descrption: this is User Consts
* Date:2019-06-07 20:36
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
*
* @author R4v3zn
* @version 1.0.0
*/
public class UserConsts {
}
================================================
FILE: src/main/java/com/suyu/core/enmus/UserVipLevelEnum.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.enmus;
/**
* Title: UserVipLevelEnum
* Descrption: TODO
* Date:2019-06-07 20:45
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
*
* @author R4v3zn
* @version 1.0.0
*/
public enum UserVipLevelEnum {
/**
* Senior member, Free member
*/
SVIP(2,"高级会员"),VIP(1,"普通会员");
private String levelName;
private Integer code;
UserVipLevelEnum(Integer code,String levelName){
this.code = code;
this.levelName = levelName;
}
}
================================================
FILE: src/main/java/com/suyu/core/exception/FofaException.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.exception;
/**
* Title: FofaException
* Descrption: FofaException
* Date:2019-06-07 16:12
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
*
* @author R4v3zn
* @version 1.0.0
*/
public class FofaException extends Exception{
/**
* Constructor
* @param msg message
*/
public FofaException(String msg){
super(msg);
}
}
================================================
FILE: src/main/java/com/suyu/core/util/HttpUtils.java
================================================
/*
* Copyright (c) 2019. r4v3zn.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.suyu.core.util;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.*;
import java.util.Map;
/**
* Title: HttpUtils
* Descrption: HttpUtils
* Date:2019-06-10 19:10
* Email:woo0nise@gmail.com
* Company:www.j2ee.app
* @author R4v3zn
* @version 1.0.0
*/
public class HttpUtils {
/**
* private
*/
private HttpUtils(){}
/**
* do get
* @param url requests url
* @return response info
*/
public static String doGet(String url){
return doGet(url,null);
}
/**
* do get
* @param actionUrl requests url
* @param map requests param
* @return response info
*/
public static String doGet(String actionUrl,Map<String,Object> map) {
String result = "";
try {
if(map != null && map.size() > 0){
actionUrl += "?";
for (String key: map.keySet()) {
actionUrl += key + "="+URLEncoder.encode(map.get(key).toString(), "UTF-8")+"&";
}
}
URL url = new URL(actionUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
BufferedReader reader = null;
if(HttpURLConnection.HTTP_OK == connection.getResponseCode()){
reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "utf-8"));
}else{
reader = new BufferedReader(new InputStreamReader(connection.getErrorStream(), "utf-8"));
}
String s = "";
String temp = "";
while ((temp = reader.readLine()) != null) {
s += temp;
}
result = s;
reader.close();
} catch (ProtocolException e) {
e.printStackTrace();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return result;
}
}
================================================
FILE: src/main/java/com/suyu/utils/FileTools.java
================================================
package com.suyu.utils;
import java.io.*;
public class FileTools
{
public static byte[] getBytesByFile(final String filePath) throws IOException {
final InputStream in = new FileInputStream(filePath);
final byte[] data = toByteArray(in);
in.close();
return data;
}
public static byte[] toByteArray(final InputStream in) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
final byte[] buffer = new byte[4096];
final boolean var3 = false;
int n;
while ((n = in.read(buffer)) != -1) {
out.write(buffer, 0, n);
}
return out.toByteArray();
}
public static byte[] readToBytes(final String path) throws IOException {
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final File ff = new File(path);
final FileInputStream fs = new FileInputStream(ff);
final byte[] temp = new byte[4096];
final boolean var5 = false;
int len;
while ((len = fs.read(temp)) != -1) {
bos.write(temp, 0, len);
}
fs.close();
final byte[] data = bos.toByteArray();
bos.close();
return data;
}
public static String readFileToString(final String path) throws IOException {
final byte[] data = readToBytes(path);
final String str = new String(data, "UTF-8");
return str;
}
public static void writeFile(final String filePath, final String content) {
try {
final OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(filePath), "utf-8");
final BufferedWriter writer = new BufferedWriter(write);
writer.write(content);
writer.close();
}
catch (IOException var4) {
var4.printStackTrace();
}
}
public static String readOneLineTxtFile(final String filePath) {
try {
final String encoding = "utf-8";
final File file = new File(filePath);
if (file.isFile() && file.exists()) {
final InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);
final BufferedReader bufferedReader = new BufferedReader(read);
final String lineTxt = bufferedReader.readLine();
bufferedReader.close();
read.close();
}
else {
System.out.println("\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u6587\u4ef6,\u67e5\u770b\u6b64\u8def\u5f84\u662f\u5426\u6b63\u786e:" + filePath);
}
}
catch (Exception var6) {
System.out.println("\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u51fa\u9519");
}
return "";
}
public static String readFileAllContent(final String filePath, final String encoding) {
final StringBuffer fileContent = new StringBuffer();
try {
final File file = new File(filePath);
if (file.isFile() && file.exists()) {
final InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);
final BufferedReader bufferedReader = new BufferedReader(read);
String lineTxt = null;
while ((lineTxt = bufferedReader.readLine()) != null) {
fileContent.append(lineTxt);
fileContent.append("\n");
}
read.close();
}
else {
System.out.println("\u627e\u4e0d\u5230\u6307\u5b9a\u7684\u6587\u4ef6,\u67e5\u770b\u6b64\u8def\u5f84\u662f\u5426\u6b63\u786e:" + filePath);
}
}
catch (Exception var7) {
System.out.println("\u8bfb\u53d6\u6587\u4ef6\u5185\u5bb9\u51fa\u9519");
}
return fileContent.toString();
}
}
================================================
FILE: src/main/java/com/suyu/utils/Path.java
================================================
package com.suyu.utils;
import java.net.*;
import java.io.*;
public class Path
{
public static String getRootPath() {
final URL url = Path.class.getProtectionDomain().getCodeSource().getLocation();
String filePath = "";
try {
filePath = URLDecoder.decode(url.getPath(), "UTF-8");
}
catch (Exception ex) {}
filePath = filePath.replace("\\", "/").replace("//", "/");
if (filePath.contains(":/") && filePath.startsWith("/")) {
filePath = filePath.substring(1);
}
if (filePath.endsWith(".jar")) {
filePath = filePath.substring(0, filePath.lastIndexOf("/") + 1);
}
return filePath;
}
public static String getClassResources() {
String cpath = new Object() {
public String getPath() {
return this.getClass().getResource("").getPath();
}
}.getPath();
cpath = URLDecoder.decode(cpath.replaceAll("file:/", ""));
if (cpath.indexOf(":") != 1) {
cpath = File.separator + cpath;
}
return cpath;
}
}
================================================
FILE: src/main/java/com/suyu/utils/Tools.java
================================================
package com.suyu.utils;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Tools
{
public static String date2Str(final Date date, final String format) {
if (date != null) {
final SimpleDateFormat sdf = new SimpleDateFormat(format);
return sdf.format(date);
}
return "";
}
public static String getTimeNow() {
return date2Str(new Date(), "yyyy-MM-dd HH:mm:ss");
}
}
================================================
FILE: src/main/java/com/suyu/views/FoFa.fxml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="746.0" prefWidth="940.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.suyu.controller.FofaController">
<bottom>
<AnchorPane prefHeight="641.0" prefWidth="795.0" BorderPane.alignment="CENTER">
<children>
<TextArea fx:id="result_text" layoutX="11.0" layoutY="-8.0" prefHeight="629.0" prefWidth="918.0" AnchorPane.bottomAnchor="20.0" AnchorPane.leftAnchor="11.0" AnchorPane.rightAnchor="11.0" AnchorPane.topAnchor="-8.0" />
</children>
</AnchorPane>
</bottom>
<center>
<AnchorPane prefHeight="74.0" prefWidth="940.0" BorderPane.alignment="CENTER">
<children>
<Label layoutX="14.0" layoutY="14.0" prefHeight="38.0" prefWidth="79.0" text="查询条件 :" />
<TextField fx:id="fofa_q" layoutX="115.0" layoutY="20.0" prefHeight="27.0" prefWidth="398.0" promptText="app="Solr"" />
<Label layoutX="542.0" layoutY="14.0" prefHeight="38.0" prefWidth="79.0" text="页 数 :" />
<ComboBox fx:id="page_cbx" layoutX="602.0" layoutY="20.0" prefHeight="27.0" prefWidth="90.0" />
<Button fx:id="search_btn" layoutX="730.0" layoutY="21.0" mnemonicParsing="false" onAction="#fofa_search" text="search" />
<Button fx:id="clear_btn" layoutX="866.0" layoutY="20.0" mnemonicParsing="false" onAction="#fofa_clear" text=" claer" />
<Button fx:id="stop_btn" layoutX="799.0" layoutY="21.0" mnemonicParsing="false" onAction="#fofa_search_stop" text=" stop " />
<ProgressBar fx:id="processbar" layoutX="115.0" layoutY="65.0" prefHeight="20.0" prefWidth="811.0" progress="0.0" />
<Label layoutX="14.0" layoutY="56.0" prefHeight="38.0" prefWidth="79.0" text="进度条:" />
</children>
</AnchorPane>
</center>
</BorderPane>
================================================
FILE: src/main/java/com/suyu/views/Main.fxml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="799.0" prefWidth="952.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.suyu.controller.MainController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="设 置">
<items>
<MenuItem mnemonicParsing="false" onAction="#fofa_pwd" text="fofa账号配置" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="关 于">
<items>
<MenuItem fx:id="about" mnemonicParsing="false" onAction="#about" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</top>
<center>
<TabPane fx:id="mainTabPane" prefHeight="751.0" prefWidth="915.0" tabClosingPolicy="UNAVAILABLE" BorderPane.alignment="CENTER">
<tabs>
<Tab text="功 能 列 表">
<content>
<BorderPane prefHeight="718.0" prefWidth="832.0">
<top>
<ToolBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<items>
<Button onMouseClicked="#openFofacollect" text="Fofa采集" />
</items>
</ToolBar>
</top>
<center>
<TextArea prefHeight="200.0" prefWidth="200.0" promptText="第一次使用Fofa采集,请先配置您的邮箱和KEY" BorderPane.alignment="CENTER">
<font>
<Font size="41.0" />
</font>
</TextArea>
</center>
</BorderPane>
</content>
</Tab>
</tabs>
</TabPane>
</center>
</BorderPane>
================================================
FILE: src/main/java/com/suyu/views/fofa_pwd.fxml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<BorderPane prefHeight="100.0" prefWidth="755.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.suyu.controller.FofaPwdController">
<top>
<Pane prefHeight="46.0" prefWidth="600.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="fofa_save" layoutX="680.0" layoutY="10.0" mnemonicParsing="false" onAction="#savefofa" prefHeight="23.0" prefWidth="61.0" text="保 存" />
<TextField fx:id="mail_account" layoutX="73.0" layoutY="12.0" prefHeight="23.0" prefWidth="224.0" />
<TextField fx:id="key_id" layoutX="339.0" layoutY="11.0" prefHeight="27.0" prefWidth="327.0" />
<Label layoutX="21.0" layoutY="16.0" text="mail:" />
<Label layoutX="297.0" layoutY="16.0" text=" key:" />
</children>
</Pane>
</top>
<center>
<TextArea fx:id="fofa_acc_text" prefHeight="352.0" prefWidth="755.0" />
</center>
</BorderPane>
gitextract_zno1ssb6/
├── .idea/
│ ├── .gitignore
│ ├── .name
│ ├── artifacts/
│ │ └── FofaCollect_jar.xml
│ ├── compiler.xml
│ ├── jarRepositories.xml
│ ├── libraries/
│ │ ├── Maven__cn_hutool_hutool_core_5_7_3.xml
│ │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml
│ │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml
│ │ └── Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml
│ ├── misc.xml
│ ├── modules.xml
│ └── vcs.xml
├── FofaCollect.iml
├── META-INF/
│ └── MANIFEST.MF
├── README.md
├── pom.xml
└── src/
├── META-INF/
│ └── MANIFEST.MF
└── main/
└── java/
├── META-INF/
│ └── MANIFEST.MF
└── com/
└── suyu/
├── Main.java
├── controller/
│ ├── FofaController.java
│ ├── FofaPwdController.java
│ └── MainController.java
├── core/
│ ├── DO/
│ │ ├── FofaData.java
│ │ ├── User.java
│ │ └── UserLogin.java
│ ├── client/
│ │ └── FofaClient.java
│ ├── constants/
│ │ ├── FofaClientConsts.java
│ │ ├── FofaFieldsConsts.java
│ │ └── UserConsts.java
│ ├── enmus/
│ │ └── UserVipLevelEnum.java
│ ├── exception/
│ │ └── FofaException.java
│ └── util/
│ └── HttpUtils.java
├── utils/
│ ├── FileTools.java
│ ├── Path.java
│ └── Tools.java
└── views/
├── FoFa.fxml
├── Main.fxml
└── fofa_pwd.fxml
SYMBOL INDEX (103 symbols across 17 files)
FILE: src/main/java/com/suyu/Main.java
class Main (line 9) | public class Main extends Application {
method start (line 11) | @Override
method main (line 19) | public static void main(String[] args) {
FILE: src/main/java/com/suyu/controller/FofaController.java
class FofaController (line 21) | public class FofaController extends Main implements Initializable {
method FofaController (line 40) | public FofaController() {
method getMain (line 43) | public MainController getMain() {
method setMain (line 47) | public void setMain(MainController main) {
method syslog (line 57) | public void syslog(String log) {
method go (line 61) | private void go() throws JsonProcessingException {
method fofa_search (line 92) | public void fofa_search(ActionEvent actionEvent) {
method fofa_search_stop (line 98) | public void fofa_search_stop(ActionEvent actionEvent) {
method fofa_clear (line 103) | public void fofa_clear(ActionEvent actionEvent) {
method initialize (line 108) | @Override
class GoThread (line 113) | class GoThread extends Thread {
method run (line 114) | @Override
FILE: src/main/java/com/suyu/controller/FofaPwdController.java
class FofaPwdController (line 10) | public class FofaPwdController implements Initializable {
method syslog (line 25) | public void syslog(final String log) {
method savefofa (line 29) | @FXML
method initialize (line 37) | @Override
FILE: src/main/java/com/suyu/controller/MainController.java
class MainController (line 13) | public class MainController implements Initializable {
method syslog (line 31) | public void syslog(final String log) {
method about (line 35) | @FXML
method openFofacollect (line 54) | public void openFofacollect(final Event e) {
method fofa_pwd (line 72) | @FXML
method initialize (line 90) | @Override
FILE: src/main/java/com/suyu/core/DO/FofaData.java
class FofaData (line 30) | public class FofaData {
method setQuery (line 62) | public void setQuery(String query) {
method getQuery (line 66) | public String getQuery() {
method setTotalPage (line 70) | public void setTotalPage(Integer totalPage) {
method getTotalPage (line 74) | public Integer getTotalPage() {
method getMode (line 78) | public String getMode() {
method getPage (line 82) | public Integer getPage() {
method getSize (line 86) | public Integer getSize() {
method getResults (line 90) | public List<List<String>> getResults() {
method setResults (line 94) | public void setResults(List<List<String>> results) {
method setMode (line 98) | public void setMode(String mode) {
method setPage (line 102) | public void setPage(Integer page) {
method setSize (line 106) | public void setSize(Integer size) {
method toString (line 110) | @Override
FILE: src/main/java/com/suyu/core/DO/User.java
class User (line 29) | public class User {
method User (line 93) | public User(String email, String userName, Integer fCoin, Boolean isVi...
method setEmail (line 106) | public void setEmail(String email) {
method setUserName (line 110) | public void setUserName(String userName) {
method setfCoin (line 114) | public void setfCoin(Integer fCoin) {
method setVip (line 118) | public void setVip(Boolean vip) {
method setVipLevel (line 122) | public void setVipLevel(UserVipLevelEnum vipLevel) {
method setVerified (line 126) | public void setVerified(Boolean verified) {
method setAvatar (line 130) | public void setAvatar(String avatar) {
method setMessage (line 134) | public void setMessage(Integer message) {
method setFofacliVersion (line 138) | public void setFofacliVersion(String fofacliVersion) {
method setFofaServer (line 142) | public void setFofaServer(Boolean fofaServer) {
method getEmail (line 146) | public String getEmail() {
method getUserName (line 150) | public String getUserName() {
method getfCoin (line 154) | public Integer getfCoin() {
method getVip (line 158) | public Boolean getVip() {
method getVipLevel (line 162) | public UserVipLevelEnum getVipLevel() {
method getVerified (line 166) | public Boolean getVerified() {
method getAvatar (line 170) | public String getAvatar() {
method getMessage (line 174) | public Integer getMessage() {
method getFofacliVersion (line 178) | public String getFofacliVersion() {
method getFofaServer (line 182) | public Boolean getFofaServer() {
method toString (line 186) | @Override
FILE: src/main/java/com/suyu/core/DO/UserLogin.java
class UserLogin (line 27) | public class UserLogin {
method UserLogin (line 44) | public UserLogin(String email, String key) {
method getEmail (line 49) | public String getEmail() {
method getKey (line 53) | public String getKey() {
method setEmail (line 57) | public void setEmail(String email) {
method setKey (line 61) | public void setKey(String key) {
FILE: src/main/java/com/suyu/core/client/FofaClient.java
class FofaClient (line 41) | public class FofaClient {
method FofaClient (line 52) | public FofaClient(String email, String key){
method getUserLogin (line 66) | public UserLogin getUserLogin(){
method getUser (line 74) | public User getUser() throws Exception{
method getData (line 115) | public FofaData getData(String q) throws Exception {
method getData (line 131) | public FofaData getData(String q,Integer page) throws Exception {
method getData (line 147) | public FofaData getData(String q,Integer page,Integer size) throws Ex...
method getData (line 163) | public FofaData getData(String q,Integer page,Integer size,String fiel...
method getData (line 176) | public FofaData getData(String q, Integer page, Integer size, String f...
method checkParam (line 221) | public void checkParam(String q,Integer size, String fields)throws Fof...
FILE: src/main/java/com/suyu/core/constants/FofaClientConsts.java
class FofaClientConsts (line 28) | public class FofaClientConsts {
FILE: src/main/java/com/suyu/core/constants/FofaFieldsConsts.java
class FofaFieldsConsts (line 31) | public class FofaFieldsConsts {
FILE: src/main/java/com/suyu/core/constants/UserConsts.java
class UserConsts (line 28) | public class UserConsts {
FILE: src/main/java/com/suyu/core/enmus/UserVipLevelEnum.java
type UserVipLevelEnum (line 28) | public enum UserVipLevelEnum {
method UserVipLevelEnum (line 39) | UserVipLevelEnum(Integer code,String levelName){
FILE: src/main/java/com/suyu/core/exception/FofaException.java
class FofaException (line 28) | public class FofaException extends Exception{
method FofaException (line 34) | public FofaException(String msg){
FILE: src/main/java/com/suyu/core/util/HttpUtils.java
class HttpUtils (line 33) | public class HttpUtils {
method HttpUtils (line 37) | private HttpUtils(){}
method doGet (line 44) | public static String doGet(String url){
method doGet (line 54) | public static String doGet(String actionUrl,Map<String,Object> map) {
FILE: src/main/java/com/suyu/utils/FileTools.java
class FileTools (line 5) | public class FileTools
method getBytesByFile (line 7) | public static byte[] getBytesByFile(final String filePath) throws IOEx...
method toByteArray (line 14) | public static byte[] toByteArray(final InputStream in) throws IOExcept...
method readToBytes (line 25) | public static byte[] readToBytes(final String path) throws IOException {
method readFileToString (line 41) | public static String readFileToString(final String path) throws IOExce...
method writeFile (line 47) | public static void writeFile(final String filePath, final String conte...
method readOneLineTxtFile (line 59) | public static String readOneLineTxtFile(final String filePath) {
method readFileAllContent (line 80) | public static String readFileAllContent(final String filePath, final S...
FILE: src/main/java/com/suyu/utils/Path.java
class Path (line 6) | public class Path
method getRootPath (line 8) | public static String getRootPath() {
method getClassResources (line 25) | public static String getClassResources() {
FILE: src/main/java/com/suyu/utils/Tools.java
class Tools (line 6) | public class Tools
method date2Str (line 8) | public static String date2Str(final Date date, final String format) {
method getTimeNow (line 16) | public static String getTimeNow() {
Condensed preview — 38 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (59K chars).
[
{
"path": ".idea/.gitignore",
"chars": 120,
"preview": "# 默认忽略的文件\n/shelf/\n/workspace.xml\n# 数据源本地存储已忽略文件\n/dataSources/\n/dataSources.local.xml\n# 基于编辑器的 HTTP 客户端请求\n/httpRequests/\n"
},
{
"path": ".idea/.name",
"chars": 11,
"preview": "FofaCollect"
},
{
"path": ".idea/artifacts/FofaCollect_jar.xml",
"chars": 1064,
"preview": "<component name=\"ArtifactManager\">\n <artifact type=\"jar\" name=\"FofaCollect:jar\">\n <output-path>$PROJECT_DIR$/out/art"
},
{
"path": ".idea/compiler.xml",
"chars": 632,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"CompilerConfiguration\">\n <annotationP"
},
{
"path": ".idea/jarRepositories.xml",
"chars": 1089,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"RemoteRepositoriesConfiguration\">\n <r"
},
{
"path": ".idea/libraries/Maven__cn_hutool_hutool_core_5_7_3.xml",
"chars": 508,
"preview": "<component name=\"libraryTable\">\n <library name=\"Maven: cn.hutool:hutool-core:5.7.3\">\n <CLASSES>\n <root url=\"jar"
},
{
"path": ".idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml",
"chars": 639,
"preview": "<component name=\"libraryTable\">\n <library name=\"Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.4\">\n <CLA"
},
{
"path": ".idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml",
"chars": 590,
"preview": "<component name=\"libraryTable\">\n <library name=\"Maven: com.fasterxml.jackson.core:jackson-core:2.12.4\">\n <CLASSES>\n "
},
{
"path": ".idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml",
"chars": 618,
"preview": "<component name=\"libraryTable\">\n <library name=\"Maven: com.fasterxml.jackson.core:jackson-databind:2.12.4\">\n <CLASSE"
},
{
"path": ".idea/misc.xml",
"chars": 380,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"MavenProjectsManager\">\n <option name="
},
{
"path": ".idea/modules.xml",
"chars": 262,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectModuleManager\">\n <modules>\n "
},
{
"path": ".idea/vcs.xml",
"chars": 180,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"VcsDirectoryMappings\">\n <mapping dire"
},
{
"path": "FofaCollect.iml",
"chars": 1266,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=\"true"
},
{
"path": "META-INF/MANIFEST.MF",
"chars": 52,
"preview": "Manifest-Version: 1.0\r\nMain-Class: com.suyu.Main\r\n\r\n"
},
{
"path": "README.md",
"chars": 385,
"preview": "# Fofa-collect\n\n\n### 版本说明\n\n支持jdk8直接运行\n\njdk11因为没有javafx这个依赖需要自己再加上参数\n\n```\njava -Dfile.encoding=\"UTF-8\" --module-path \"C:\\"
},
{
"path": "pom.xml",
"chars": 2549,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n xmlns:xsi=\"http://www"
},
{
"path": "src/META-INF/MANIFEST.MF",
"chars": 52,
"preview": "Manifest-Version: 1.0\r\nMain-Class: com.suyu.Main\r\n\r\n"
},
{
"path": "src/main/java/META-INF/MANIFEST.MF",
"chars": 52,
"preview": "Manifest-Version: 1.0\r\nMain-Class: com.suyu.Main\r\n\r\n"
},
{
"path": "src/main/java/com/suyu/Main.java",
"chars": 608,
"preview": "package com.suyu;\n\nimport javafx.application.Application;\nimport javafx.fxml.FXMLLoader;\nimport javafx.scene.Parent;\nimp"
},
{
"path": "src/main/java/com/suyu/controller/FofaController.java",
"chars": 3405,
"preview": "package com.suyu.controller;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\n\n\nimport com.suyu.Main;\nimport "
},
{
"path": "src/main/java/com/suyu/controller/FofaPwdController.java",
"chars": 996,
"preview": "package com.suyu.controller;\n\nimport com.suyu.utils.*;\nimport javafx.fxml.*;\nimport javafx.scene.control.*;\nimport javaf"
},
{
"path": "src/main/java/com/suyu/controller/MainController.java",
"chars": 2810,
"preview": "package com.suyu.controller;\n\nimport com.suyu.utils.*;\nimport javafx.event.*;\nimport javafx.stage.*;\nimport javafx.fxml."
},
{
"path": "src/main/java/com/suyu/core/DO/FofaData.java",
"chars": 2427,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/DO/User.java",
"chars": 4478,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/DO/UserLogin.java",
"chars": 1418,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/client/FofaClient.java",
"chars": 7600,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/constants/FofaClientConsts.java",
"chars": 1331,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/constants/FofaFieldsConsts.java",
"chars": 1206,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/constants/UserConsts.java",
"chars": 837,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/enmus/UserVipLevelEnum.java",
"chars": 1089,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/exception/FofaException.java",
"chars": 974,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/core/util/HttpUtils.java",
"chars": 2687,
"preview": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use "
},
{
"path": "src/main/java/com/suyu/utils/FileTools.java",
"chars": 3922,
"preview": "package com.suyu.utils;\n\nimport java.io.*;\n\npublic class FileTools\n{\n public static byte[] getBytesByFile(final Strin"
},
{
"path": "src/main/java/com/suyu/utils/Path.java",
"chars": 1132,
"preview": "package com.suyu.utils;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class Path\n{\n public static String getRootPath("
},
{
"path": "src/main/java/com/suyu/utils/Tools.java",
"chars": 463,
"preview": "package com.suyu.utils;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\npublic class Tools\n{\n public stat"
},
{
"path": "src/main/java/com/suyu/views/FoFa.fxml",
"chars": 2198,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<?import javafx.geometry.*?>\n<?import java.lang.*?>\n<?import java.util.*?>\n<?imp"
},
{
"path": "src/main/java/com/suyu/views/Main.fxml",
"chars": 2379,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<?import javafx.scene.*?>\n<?import javafx.scene.text.*?>\n<?import javafx.scene.c"
},
{
"path": "src/main/java/com/suyu/views/fofa_pwd.fxml",
"chars": 1127,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<?import javafx.scene.control.*?>\n<?import java.lang.*?>\n<?import javafx.scene.l"
}
]
About this extraction
This page contains the full source code of the tangxiaofeng7/Fofa-collect GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 38 files (52.3 KB), approximately 14.9k tokens, and a symbol index with 103 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.