logpresso / CVE-2021-44228-Scanner

Vulnerability scanner and mitigation patch for Log4j2 CVE-2021-44228
Apache License 2.0
852 stars 173 forks source link

Returning Error code in Batch File #284

Closed feolafonz closed 2 years ago

feolafonz commented 2 years ago

Currently creating an automation with our RMM. Because of our RMM, I need to write the exit code to a text file to handle the exit codes for reporting/further automation. I have a batch command running and writing the %ERRORLEVEL% to a txt file.

%windir%\temp\log4j\log4j2-scan.exe --force-fix c:\ --csv-log-path \\UNCPATH\log4reportlog.csv > \\UNCPATH\%computername%.txt
echo %ERRORLEVEL% > %windir%\temp\log4j\scanresults.txt

The above results return 0 even if vulnerabilities are found. If there is a cleaner way of getting the error code, please let me know. I did not find examples.

feolafonz commented 2 years ago

disregard, i am dumb