4

为啥一个打日志的要去访问网络

 2 years ago
source link: https://www.v2ex.com/t/821297
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

V2EX  ›  程序员

为啥一个打日志的要去访问网络

  461da73c · 5 小时 1 分钟前 · 971 次点击

看到大家热传的 log4j 打日志爆了严重漏洞,本人不写 java ,不太理解打日志能打出个什么名堂,要去访问网络? 烦请各位 JAVA 大佬解答一下小弟的疑惑。

7 条回复    2021-12-10 16:16:34 +08:00

Kasumi20

Kasumi20      4 小时 44 分钟前

不清楚,只会 System.out.println 的路过。

aguesuka

aguesuka      4 小时 0 分钟前

作者想去访问 "java:comp/env/" 中的环境变量比如 "logging/context-name", 但是实际调用的 JNDI 相当于 Java 中的 eval

unco020511

unco020511      2 小时 23 分钟前   ❤️ 2

java 的东西哪个不是复杂的一笔哈哈,打日志也能打出花来

hfc

hfc      2 小时 11 分钟前

类似 SQL 注入吧,出现了预期外的行为

xuanbg

xuanbg      2 小时 0 分钟前

目的是调用 JNDI 实现获取外部信息的功能,但没有充分考虑这个功能的安全性。

怎么说呢,调用 JNDI 这个需求是存在的,但不应该由日志组件或者其他第三方组件来实现。自己来调用 JNDI 是可控的,第三方实现了这个功能,就变得不可控了。

gadfly3173

gadfly3173      1 小时 59 分钟前

访问网络是传入的不合法参数,也就是脚本执行的。这个漏洞本质是因为 log4j 不止日志能打进文件、console ,还可以调用各种本地服务打进各种地方,比如 ES 之类的,但是 log4j 又没有对恶意代码有什么防范,就像 SQL 注入一样被利用了。

461da73c

461da73c      36 分钟前

@gadfly3173 不是很理解,不搞骚操作怎么有机会注入执行,例如最简单的日志:System.out.println 。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK