Skip to content

Commit

Permalink
3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
suyu authored and suyu committed Apr 1, 2021
1 parent a764e67 commit 4ce42da
Show file tree
Hide file tree
Showing 34 changed files with 720 additions and 2 deletions.
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/artifacts/FofaCollect_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/jarRepositories.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/libraries/Maven__com_r4v3zn_fofa_fofa_core_1_0_2_RELEASE.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/libraries/fofa_core_1_0_2_RELEASE.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions FofaCollect.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?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_8">
<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.r4v3zn.fofa:fofa-core:1.0.2.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.9" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.10.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.10" level="project" />
<orderEntry type="library" name="fofa-core-1.0.2.RELEASE" level="project" />
</component>
</module>
3 changes: 3 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.suyu.Main

11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@

V3.0

有小伙伴提示Fofa更新了,返回的格式会乱掉,我这边抽空重写一下,因为源代码都没了,所以大家稍微等等。。。
只支持jdk8

因为接口问题,删除ip查询功能

增加Fofa采集进度条

V2.0
公开工具源码

![test](./test.gif)

V2.0

增加修改账号配置文件

增加ip批量查询定位


![工具截图](https://upload-images.jianshu.io/upload_images/14134003-116498e08c97b1fe.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

V1.0

提供接口查询资产

最大支持1000页查询
Expand Down
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/main/.DS_Store
Binary file not shown.
Binary file added src/main/java/.DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/main/java/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: com.suyu.Main

22 changes: 22 additions & 0 deletions src/main/java/com/suyu/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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("Main.fxml"));
primaryStage.setTitle("FofaCollect by 苏宇@涂鸦智能安全团队");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}

public static void main(String[] args) {
launch(args);
}
}
109 changes: 109 additions & 0 deletions src/main/java/com/suyu/controller/FofaController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package com.suyu.controller;

import com.suyu.Main;
import com.suyu.utils.*;
import javafx.fxml.*;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.collections.*;
import com.r4v3zn.fofa.core.client.*;
import javafx.event.*;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

import java.net.*;
import java.util.*;

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", "1000" });
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() {
String pa = Path.getRootPath() + "fofa.ini";
String pstr = FileTools.readFileAllContent(pa, "utf-8");
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);

for (int i = 1; i < p; ++i) {
processbar.setProgress((float)i/(float)p);
String a = null;
try {
a = String.valueOf(client.getData(String.valueOf(client.getData(q, i)))).trim();
} catch (Exception ex) {
ex.printStackTrace();
}
String b = a.substring(a.indexOf("[") + 1, a.indexOf("]")).replace(", ", "\n").replace("https://", "").replace("http://", ".");
this.syslog(b);
}

}

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() {
go();
}
}
}
Loading

0 comments on commit 4ce42da

Please sign in to comment.