Skip to content

Bonus! Blue Log4Jack

A bonus Blue Team event appears surrounding the Log4j debacle!

Starts out with:

RU Ready?

After hitting yes

After hitting yes

After typing next

After typing next

After running ls

After running ls

After running cd vulnerable

After running cd vulnerable

Listing files in that directory: ls

Listing files

Displaying the contents of DisplayFilev1.java

Display contents of java file

Compiled the java with javac DisplayFilev1.java

Compiling java

Running the program with java DisplayFilev1 testfile.txt:

Running the program

Now trying to read a file that isn't there, forcing an exception:

Forcing Exception

Running next

Running next

Displaying the contents of a java program that properly utilizes the log4j utility.

Display contents of java program

Running next

Running next

Compling the new code with javac DisplayFilev2.java

Compiling again

Forcing it to fail by reading a file that doesn't exist:

Forcing it to fail

Running next

Running next

Injecting code via Log4j and displaying the java version

Injecting code via log4j

Even more scary stuff you can do with this vulnerability

Even more scary stuff

After typing next

After typing next

After running startserver.sh

Running startserver.sh

Exploiting and showing how an LDAP lookup can be created

Exploiting via ldap

Hitting Ctrl+C backs out of everything

Back out of everything

cd into ~/patched

cd into patched

Listing the contents of the directory

Listing contents

After sourcing the new classpath with source claspath.sh

Sourcing new classpath

Compiling the code with javac DisplayFilev2.java

Compiling the code

Now it doesn't work:

it don't work

Running cd to return to the home dir

cd to return to home dir

Running log4j2-scan ./vulnerable from the home dir

Running log4j2-scan

Running the same command on the ~/patched dir

Running same command in patched

Running the command under /var/log/solr

Running the command under /var/log/solr

After running next

After running next

After running ls /var/log/www and seeing only one file there, access.log

After running ls /var/log/www

After examining log4shell-search.sh

After examining log4shell-search.sh

After running log4shell-search.sh /var/log/www/access.log

After running log4shell-search.sh /var/log/www/access.log

After running ./logshell-search.sh /var/log/www | sed '1!d'

After getting one line of output

After running ./logshell-search.sh /var/log/www | sed '2!d'

After getting second line of output

After running ./logshell-search.sh /var/log/www | sed '3!d

After getting 3rd line of output

After hitting next

After hitting next