Skip to content

Commit

Permalink
更新linux环境下的一个bug
Browse files Browse the repository at this point in the history
  • Loading branch information
iSafeBlue committed Feb 2, 2019
1 parent 8585db0 commit 18a4dd8
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion base/src/main/java/com/trackray/base/handle/SystemInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ public class SystemInit

public void init(){

new Thread(){
@Override
public void run() {

check();

}
}.start();

}

private void check() {
String domain = PropertyUtil.getProperty("dict.domain");
String dir = PropertyUtil.getProperty("dict.dir");

Expand All @@ -36,12 +48,14 @@ public void init(){
SQLMap.API = PropertyUtil.getProperty("sqlmap.root");

try {
SysLog.info("正在检测sqlmap api 服务");
ResponseStatus resp = new HttpClient().get(SQLMap.API);
} catch (Exception e) {
SysLog.warn("检测到sqlmap api 服务未开启");
}

try {
SysLog.info("正在检测网络服务");
ResponseStatus resp = new HttpClient().get("http://www.baidu.com");
} catch (Exception e) {
SysLog.warn("网络连接异常,本程序运行需要连接连接互联网。");
Expand All @@ -50,6 +64,7 @@ public void init(){

Shell pyshell = new Shell();
try {
SysLog.info("正在检测python环境");
pyshell.target("python").exec("--version");
if (!pyshell.readAll().contains("Python ")){
SysLog.warn("未检测到python环境,本程序部分插件依赖于python,请保证已安装python。");
Expand All @@ -61,6 +76,7 @@ public void init(){
}

try {
SysLog.info("正在检测nmap");
Shell shell = new Shell();
shell.target("nmap").exec();
if (!shell.readAll().contains("nmap.org")){
Expand All @@ -71,7 +87,6 @@ public void init(){
}


Constant.Vuln.VULN_ADD_API = PropertyUtil.getProperty("vuln.root").concat("/task/vuln/put");
Constant.NmapComm.NMAP_DIR = PropertyUtil.getProperty("nmap.path");

try {
Expand Down

0 comments on commit 18a4dd8

Please sign in to comment.