Created
December 21, 2021 22:51
-
-
Save deftoner/9035fc18e7c729e6e2fd3a6538519501 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Echo off | |
:: EventSentry Validation Script to search LOG4J Vulnerable libraries in all local hard drives. | |
ECHO Vulnerable Log4J Libraries Found (if any): | |
for /F "skip=1" %%C in ('%SystemRoot%\System32\wbem\wmic logicaldisk where drivetype^=3 get caption') do for /F %%D in ("%%C") do PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "gci %%D\ -rec -force -include log4j*.jar -ea 0 | foreach {select-string "JndiLookup.class" $_} | select -exp Path" | %SystemRoot%\System32\findstr.exe /V "2.16 2.17 2.18" | |
IF %ERRORLEVEL% == 0 EXIT /B 1 | |
IF %ERRORLEVEL% == 1 EXIT /B 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment