(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
A great and handy python obfuscator for protecting code.

Python Code Obfuscator A handy and necessary tool that can protect your code anytime! Mostly Command Line tool that will obfuscate your code. Features

Karim 5 Nov 18, 2022
This is a partial and quick and dirty proof of concept implementation of the following specifications to configure a tor client to use trusted exit relays only.

This is a partial and quick and dirty proof of concept implementation of the following specifications to configure a tor client to use trusted exit re

22 Nov 09, 2022
SCodeScanner stands for Source Code scanner where the user can scans the source code for finding the Critical Vulnerabilities.

The SCodeScanner stands for Source Code Scanner, where you can scan your source code files like PHP and get identify the vulnerabilities inside it. The tool can use by Pentester, Developer to quickly

136 Dec 13, 2022
Discord exploit allowing you to be unbannable.

Discord-Ban-Immunity Discord exploit allowing you to be unbannable. 9/3/2021 Found in late August. Found by Passive and Me. Explanation If a user gets

orlando 9 Nov 23, 2022
This project is all about building an amazing application that will help users manage their passwords and even generate new passwords for them

An amazing application that will help us manage our passwords and even generate new passwords for us.

1 Jan 23, 2022
Show apps recorded storage files by jailbreak

0x101 Show registered storage files of apps by jailbreak Legal disclaimer: Usage of insTof for attacking targets without prior mutual consent is illeg

0x 4 Oct 24, 2022
this keylogger is only for pc not for android but it will only work on those pc who have python installed it is made for all linux,windows and macos

Keylogger this keylogger is only for pc not for android but it will only work on those pc who have python installed it is made for all linux,windows a

Titan_Exodous 1 Nov 04, 2021
Laravel RCE (CVE-2021-3129)

CVE-2021-3129 - Laravel RCE About The script has been made for exploiting the Laravel RCE (CVE-2021-3129) vulnerability. This script allows you to wri

Joshua van der Poll 21 Dec 27, 2022
Apache Solr SSRF(CVE-2021-27905)

Solr-SSRF Apache Solr SSRF #Use [-] Apache Solr SSRF漏洞 (CVE-2021-27905) [-] Options: -h or --help : 方法说明 -u or --url

Henry4E36 70 Nov 09, 2022
The Web Application Firewall Paranoia Level Test Tool.

Quick WAF "paranoid" Doctor Evaluation WAFPARAN01D3 The Web Application Firewall Paranoia Level Test Tool. — From alt3kx.github.io Introduction to Par

22 Jul 25, 2022
Fast subdomain scanner, Takes arguments from a Json file ("args.json") and outputs the subdomains.

Fast subdomain scanner, Takes arguments from a Json file ("args.json") and outputs the subdomains. File Structure core/ colors.py db/ wordlist.txt REA

whoami security 4 Jul 02, 2022
This tool allows to automatically test for Content Security Policy bypass payloads.

CSPass This tool allows to automatically test for Content Security Policy bypass payloads. Usage [cspass]$ ./cspass.py -h usage: cspass.py [-h] [--no-

Ruulian 30 Nov 22, 2022
A high-performance DNS stub resolver for bulk lookups and reconnaissance (subdomain enumeration)

MassDNS A high-performance DNS stub resolver MassDNS is a simple high-performance DNS stub resolver targeting those who seek to resolve a massive amou

B. Blechschmidt 2.5k Jan 07, 2023
Steal Files on a Windows Machine

File-Stealer Steal Files on a Windows Machine About This Script will steal certain Files on a Windows Machine and sends them to a FTP Server. Preview

Marcel 5 Nov 17, 2022
Static Token And Credential Scanner

Static Token And Credential Scanner What is it? STACS is a YARA powered static credential scanner which suports binary file formats, analysis of neste

STACS 81 Dec 27, 2022
log4j2 passive burp rce scanning tool get post cookie full parameter recognition

log4j2_burp_scan 自用脚本log4j2 被动 burp rce扫描工具 get post cookie 全参数识别,在ceye.io api速率限制下,最大线程扫描每一个参数,记录过滤已检测地址,重复地址 token替换为你自己的http://ceye.io/ token 和域名地址

5 Dec 10, 2021
Get important strings inside [Info.plist] & and Binary file also all output of result it will be saved in [app_binary].json , [app_plist_file].json file

Get important strings inside [Info.plist] & and Binary file also all output of result it will be saved in [app_binary].json , [app_plist_file].json file

12 Sep 28, 2022
OpenSource Poc && Vulnerable-Target Storage Box.

reapoc OpenSource Poc && Vulnerable-Target Storage Box. We are aming to collect different normalized poc and the vulerable target to verify it. Now re

cckuailong 560 Dec 23, 2022
Send CVE information to the specified mailbox (from Github)

Send CVE information to the specified mailbox (from Github)

91 Nov 08, 2022
windows电脑查看全部连接过的WiFi密码

python WIFI历史密码查看器 WIFI密码查看器 原理 win+R,输入cmd打开命令行窗口 #这个命令可以列出你所有连接过的wifi netsh wlan show profiles #替换你要查找的WiFi名称,就可以显示出这个wifi的所有信息,包括密码 netsh wlan show

GMYXDS 15 Dec 22, 2022