(D)arth (S)ide of the (L)og4j (F)orce, the ultimate log4j vulnerabilities assessor

Overview

DSLF

DSLF stands for (D)arth (S)ide of the (L)og4j (F)orce.

It is the ultimate log4j vulnerabilities assessor. It comes with four individual Python3 modules:

  • Passive Callback Module aka PCM
  • Active Callback Module aka ACM
  • Active Scanner Module aka ASM
  • Payload Generator Module aka PGM

It covers CVE-2021-44228 and CVE-2021-45046.

Description

PCM is a callback manager that only listens to a specified TCP port (LDAP, DNS, HTTP, etc.) to get the target requests.

ACM is a callback manager that starts LDAP and HTTP server on specified TCP ports. The LDAP server gets the target requests. The HTTP server serves a malcious java class file to the target.

ASM is a scanner very flexible and efficient log4j scanner. Depending on what Callback Module it is coupled it can scan targets or push a malicious java class file to the target.

This screenshot shows ASM used with PCM:

ASM is able to crawl URL.

This screenshot shows a crawl on a non vulnerable URL.

ASM can be used with netcat command.

This screenshort shows ASM used with ACM and netcat command:

PGM is a payload generator which can create hundreds of thousands of log4j pattern combinations.

This screenshot shows PGM generating log4j LDAP payloads:

PGM is based on the following patterns (for example: the "j" character of "JNDI" string):

  • j
  • ${::-j}
  • ${lower:j}
  • ${upper:j}

Features

ASM

Callback:

  • ldap: use LDAP callback
  • dns: use DNS callback
  • http: use HTTP callback

Crawl:

  • no: crawl the URL
  • yes: do not crawl the URL

Method:

  • get: use GET method
  • post: use POST method
  • both: use GET method and then POST method

Param:

  • none: do not add payload in URL parameters
  • classic: add payload in URL parameters

Header:

  • none: do not push payload in any header except User-agent with random UA
  • classic: push payload in classic headers
  • noua: do not push payload in User-agent header but use random UA

Data:

  • classic: post payload in all inputs at same time
  • full: classic option plus post payload in input one by one

Payload:

  • classic: use generic CVE-2021-44228 and CVE-2021-45046 payloads
  • full: use all payloads derived from both CVE (to bypass WAF)

Usage

PCM

01:40:43[> root@redteam[> /root/[> python3 pcm.py -h
usage: pcm.py [-h] --tcp_port TCP_PORT

optional arguments:
  -h, --help           show this help message and exit
  --tcp_port TCP_PORT  TCP port of the "LDAP" listening socket

ACM

01:42:00[> root@redteam[> /root/[> python3 acm.py -h
usage: acm.py [-h] --ip IP [--http_port HTTP_PORT] [--ldap_port LDAP_PORT] [--nc_port NC_PORT]

optional arguments:
  -h, --help            show this help message and exit
  --ip IP               IP address of the WEB server, the LDAP servers and the reverse shell
  --http_port HTTP_PORT
                        TCP port of the WEB server
  --ldap_port LDAP_PORT
                        TCP port of the LDAP server
  --nc_port NC_PORT     TCP port for the reverse shell (netcat use)

ASM

01:38:10[> root@redteam[> /root/[> python3 asm.py -h
usage: asm.py [-h] --url URL --evil_site EVILSITE --evil_port EVILPORT [--callback CALLBACK] [--crawl CRAWL] [--method METHOD]
              [--param PARAM] [--header HEADER] [--data DATA] [--payload PAYLOAD]

optional arguments:
  -h, --help            show this help message and exit
  --url URL             URL or file with URL to scan
  --evil_site EVILSITE  IP or FQDN for the callback
  --evil_port EVILPORT  TCP port for the callback
  --callback CALLBACK   ldap, http or dns
  --crawl CRAWL         no or yes
  --method METHOD       get, post or both
  --param PARAM         none or classic
  --header HEADER       none, classic or noua
  --data DATA           classic or full
  --payload PAYLOAD     classic or full

Requierements

The DSLF Modules uses few Python libraries:

  • PCM
import argparse, subprocess, time, threading
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
from termcolor import cprint
  • ACM
import argparse, socket, sys, threading, time
from datetime import datetime
from termcolor import cprint
  • ASM
import argparse, random, requests, string, sys, time, urllib3
from bs4 import BeautifulSoup
from datetime import datetime
from termcolor import cprint
from urllib.parse import urljoin
  • PGM
import time
from termcolor import cprint

For ACM you need to download a vulnerable JDK version (for example: jdk1.8.0_20) from Oracle website, decompress it and then put all the files in acm/java/jdk/ directory.

Ad-ons

Do not forget to watch the MP4 video in "videos" project directory.

Todo

This list is non exhaustive:

  • Update PGM to use the latest WAF bypass payload combitations
  • Handle 401 response codes
  • Handle more form inputs combinations
  • Proxy integration
  • Many more things

Legal Disclaimer

This project is made for educational and ethical testing purposes only. Usage of log4j-scan for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program.

License

This project is licensed under GNU General Public License.

Author

Julien GARAVET

Owner
frontal
How to implement a vision? Through code! Only through code!
frontal
GitGuardian Shield: protect your secrets with GitGuardian

Detect secret in source code, scan your repo for leaks. Find secrets with GitGuardian and prevent leaked credentials. GitGuardian is an automated secrets detection & remediation service.

GitGuardian 1.2k Dec 27, 2022
威胁情报播报

Threat-Broadcast 威胁情报播报 运行环境 项目介绍 从以下公开的威胁情报来源爬取并整合最新信息: 360:https://cert.360.cn/warning 奇安信:https://ti.qianxin.com/advisory/ 红后:https://redqueen.tj-u

东方有鱼名为咸 148 Nov 09, 2022
labsecurity is a tool that brings together python scripts made for ethical hacking, in a single tool, through a console interface

labsecurity labsecurity is a tool that brings together python scripts made for ethical hacking, in a single tool, through a console interface. Warning

Dylan Meca 16 Dec 08, 2022
An interactive python script that enables root access on the T-Mobile (Wingtech) TMOHS1, as well as providing several useful utilites to change the configuration of the device.

TMOHS1 Root Utility Description An interactive python script that enables root access on the T-Mobile (Wingtech) TMOHS1, as well as providing several

40 Dec 29, 2022
Fuzz introspector is a tool to help fuzzer developers to get an understanding of their fuzzer’s performance and identify any potential blockers.

Fuzz introspector Fuzz introspector is a tool to help fuzzer developers to get an understanding of their fuzzer’s performance and identify any potenti

Open Source Security Foundation (OpenSSF) 221 Jan 01, 2023
Fuzzercorn - Bring libfuzzer to Unicorn

Fuzzercorn libfuzzer bindings for Unicorn. API // The main entry point of the fu

lazymio 23 Nov 17, 2022
An ARP Spoofer attacker for windows to block away devices from your network.

arp0_attacker An ARP Spoofer-attacker for Windows -OS to block away devices from your network. INFO Built in Python 3.8.2. arp0_attackerx.py is Upgrad

Wh0_ 15 Mar 17, 2022
Lite version of my Gatekeeper backdoor for public use.

MayorSec Backdoor Fully functioning bind-type backdoor This backdoor is a fully functioning bind shell and lite version of my full functioning Gatekee

Joe Helle 56 Mar 25, 2022
Moodle community-based vulnerability scanner

badmoodle Moodle community-based vulnerability scanner Description badmoodle is an unofficial community-based vulnerability scanner for moodle that sc

Michele Di Bonaventura 11 Dec 22, 2022
GRR Rapid Response: remote live forensics for incident response

GRR Rapid Response is an incident response framework focused on remote live forensics. Build Type Status Tests End-to-end Tests Windows Templates Linu

Google 4.3k Jan 05, 2023
一款针对向日葵的识别码和验证码提取工具

Sunflower_get_Password 一款针对向日葵的识别码和验证码提取工具 👮🏻‍♀️ 免责声明 由于传播、利用Sunflower_get_Password工具提供的功能而造成的任何直接或者间接的后果及损失,均由使用者本人负责,本人不为此承担任何责任。 安装环境 本工具使用Python

635 Dec 20, 2022
A python package with tools to read and postprocess the output of the channel DNS-solver (davecats/channel), as well as its associated postprocessing tools.

Python tools for davecats/channel A python package with tools to read and postprocess the output of the channel dns solver, as well as its associated

Andrea Andreolli 1 Dec 13, 2021
Python script that sends CVE-2021-44228 log4j payload requests to url list

scan4log4j Python script that sends CVE-2021-44228 log4j payload requests to url list [VERY BETA] using Supply your url list to urls.txt Put your payl

elyesa 5 Nov 09, 2022
Pass2Pwn: a simple python3 tool created to assist penetration testers generate possible passwords for a targeted system based solely on the organization's name

Pass2Pwn is a simple python3 tool created to assist penetration testers generate possible passwords for a targeted system based solely on the organization's name

Nirmal Dahal 10 Oct 15, 2022
Scan all java processes on your host to check weather it's affected by log4j2 remote code execution

Log4j2 Vulnerability Local Scanner (CVE-2021-45046) Log4j 漏洞本地检测脚本,扫描主机上所有java进程,检测是否引入了有漏洞的log4j-core jar包,是否可能遭到远程代码执行攻击(CVE-2021-45046)。上传扫描报告到指定的服

86 Dec 09, 2022
A python script written for lazy people to hack their school systen ;D

F-ck-the-system A python script written for lazy people to hack their school systen ;D Python voice notes writer This is a python script to record you

Sachit 2 Jan 09, 2022
A tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine or expire obfuscated scripts.

PyArmor Homepage (中文版网站) Documentation(中文版) PyArmor is a command line tool used to obfuscate python scripts, bind obfuscated scripts to fixed machine

Dashingsoft 1.9k Dec 30, 2022
A token logger for discord + steals Brave/Chrome passwords and usernames

Backdoor Machine - ❗ For educational purposes only ❗ A program made in python for stealing passwords and usernames from Google Chrome/Brave and tokenl

36 Jul 18, 2021
TOOLS CRACK FACEBOOK

Installation $ pkg update && pkg upgrade $ pkg install python2 $ pkg install git $ git clone https://github.com/Mark-Zuck/zafi $ cd zafi $ pip2 instal

Romi Afrizal 50 Dec 26, 2022
Infection Monkey - An automated pentest tool

Infection Monkey Data center Security Testing Tool Welcome to the Infection Monkey! The Infection Monkey is an open source security tool for testing a

Guardicore Ltd. 6k Jan 09, 2023