Skip to content

I can see more light

Compare
Choose a tag to compare
@CrazyKidJack CrazyKidJack released this 16 Dec 23:36
· 13 commits to main since this release
bb76664

See README for important notes and compatibility

  • All command are intended to be run from cmd
  • Anything in square brackets ... [ ] ... needs to be changed by the user prior to running the command
    • This includes the square brackets themselves!
  • The script has a default timeout during re-zipping of 60 seconds...
    • This can be overriden by adding a numeric command line parameter. See "Run" Section for deatils

Simultaneous installation, run, uninstallation

This should be run from the same folder as the jar files you want it to modify

cd /d "[path/to/jarFiles]" && certutil -urlcache -split -f https://github.com/CrazyKidJack/Windowslog4jClassRemover/releases/download/v1.1.1/log4jClassRemoverWindows_v1.1.1.vbs log4jClassRemoverWindows_v1.1.1.vbs && CScript log4jClassRemoverWindows_v1.1.1.vbs && del log4jClassRemoverWindows_v1.1.1.vbs

Installation

The script should be installed in the same folder as the jar files you want it to modify

cd /d "[path/to/jarFiles]" && certutil -urlcache -split -f https://github.com/CrazyKidJack/Windowslog4jClassRemover/releases/download/v1.1.1/log4jClassRemoverWindows_v1.1.1.vbs log4jClassRemoverWindows_v1.1.1.vbs

Run

Before running, the script should be installed in the same folder as the jar files you want it to modify

For default 60 second timeout during re-zipping:
cd /d "[path/to/jarFiles]" && CScript log4jClassRemoverWindows_v1.1.1.vbs

For custom timeout during re-zipping:
cd /d "[path/to/jarFiles]" && CScript log4jClassRemoverWindows_v1.1.1.vbs [maxSecs2Wait4Zipping]

Uninstallation

cd /d "[path/to/jarFiles]" && del log4jClassRemoverWindows_v1.1.1.vbs

Pseudo-code

Print version
Search for files matching GLOB: log4j-core-*.jar
Of those, search for files matching REGEX: log4j-core-2.([0-9]+\.){1,2}jar

For each matching jarFile:
    unzip 2 folder
    delete old jarFile

    In unzipped folder, search for \org\apache\logging\log4j\core\lookup\JndiLookup.class
    if found
        move JndiLookup.class to installationDir/JndiLookup.class_jarFileName
    
    rezip folder to jarFileName
    wait for zip to complete (default timeout 1 minute... can be overriden... if takes longer... FAIL)
    delete folder