Skip to content

Commit 3e3fd62

Browse files
committed
fastjson
1 parent a85554a commit 3e3fd62

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
[Shiro框架相关的安全问题 - 7个](https://github.com/4ra1n/JavaSecInterview/tree/master/shiro)
2424

25+
[Fastjson组件相关的安全问题 - 6个](https://github.com/4ra1n/JavaSecInterview/tree/master/fastjson)
26+
2527
[Log4j2组件相关的安全问题 - 7个](https://github.com/4ra1n/JavaSecInterview/tree/master/log4j2)
2628

2729
[内存马专题 - 7个](https://github.com/4ra1n/JavaSecInterview/tree/master/memshell)

fastjson/README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Fastjson
2+
3+
- 使用`JSON.parse()``JSON.parseObject()`的不同(★)
4+
5+
前者会在JSON字符串中解析字符串获取`@type`指定的类,后者则会直接使用参数中的`class`,并且对应类中所有`getter``setter`都会被调用
6+
7+
8+
9+
- 什么情况下反序列化过程会反射调用`getter`(★)
10+
11+
符合`getter`规范的情况且不存在`setter`
12+
13+
14+
15+
- 如果不存在`setter``getter`方法可以反射设置值吗(★)
16+
17+
需要服务端开启`Feature.SupportNonPublicFiel`参数,实战无用
18+
19+
20+
21+
- Fastjson在反序列化`byte[]`类型的属性时会做什么事情(★)
22+
23+
将会在反序列化时候进行`base64`编码
24+
25+
26+
27+
- 谈谈常见的几种Payload(★★★)
28+
29+
首先是最常见的`JdbcRowSetImpl`利用`JDNI`注入方式触发,需要出网
30+
31+
利用`TemplatesImpl`类比较鸡肋,需要服务端开启特殊参数
32+
33+
不出网的利用方式有一种`BasicDataSource`配合`BCEL`可实现不出网`RCE`
34+
35+
另外某个版本之后支持`$ref`的功能,也可以构造一些Payload
36+
37+
38+
39+
- 谈谈1.2.47版本之前的绕过(★★★)
40+
41+
首先是利用解析问题可以加括号或大写L绕过低版本,高版本利用了哈希黑名单,之所以要哈希是因为防止黑客进行分析。但黑名单还是被破解了,有师傅找到可以绕过了类。在1.2.47版本中利用缓存绕过

0 commit comments

Comments
 (0)