-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
- Loading branch information
There are no files selected for viewing
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.
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.
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: com.suyu.Main | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: com.suyu.Main | ||
|
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); | ||
} | ||
} |
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(); | ||
} | ||
} | ||
} |