@@ -387,7 +387,7 @@ if($EverythingSearch) {
387
387
$roboCopyLogPath = " $workingPath \log4jfilescan.csv"
388
388
Write-Log - Text " Starting robocopy scan of '$drive \' for .jar, .txt, and .log files."
389
389
Remove-Item - Path $roboCopyLogPath - ErrorAction SilentlyContinue
390
- $robocopyExitCode = (Start-Process - FilePath robocopy - ArgumentList " $drive \ $drive \DOESNOTEXIST1000 *.jar *.txt *.log /S /XJ /L /FP /NS /NC /NDL /NJH /NJS /r:0 /w:0 /LOG:$roboCopyLogPath " - Wait - PassThru).ExitCode
390
+ $robocopyExitCode = (Start-Process - FilePath robocopy - ArgumentList " $drive \ $drive \DOESNOTEXIST1000 *.jar *.txt *.log /S /XJ /L /FP /NS /NC /NDL /NJH /NJS /r:0 /w:0 /LOG:$roboCopyLogPath " - Wait - PassThru - NoNewWindow ).ExitCode
391
391
if ((-not (Test-Path - Path " $workingPath \log4jfilescan.csv" )) -or ($robocopyExitCode -ge 16 )) { throw }
392
392
$filesDetected = Import-Csv - Path $roboCopyLogPath - Header H1 | Select-Object - ExpandProperty H1
393
393
Write-Log - Text " Robocopy found $ ( $filesDetected.Count ) files to scan on '$drive \'"
@@ -418,7 +418,7 @@ if(-not $skipYARA) {
418
418
Write-Verbose - Message " Running YARA scan on file '$file '"
419
419
if ($file -notmatch " Find-L4JVulnerabilities|yara-log|luna-log|L4Jdetections|L4JConsoleLog|luna\.log" ) {
420
420
$yaResult = $null
421
- $yaResult = cmd / c " "" $workingPath \yara$varch .exe"" "" $workingPath \yara.yar"" "" $file "" -s"
421
+ $yaResult = & " $workingPath \yara$varch .exe" " $workingPath \yara.yar" " $file " - s
422
422
if ($yaResult ) {
423
423
Write-Log - Text " ====================================================="
424
424
$script :varDetection = 1
@@ -444,7 +444,7 @@ Remove-Item -Path $lunaPath -Force -ErrorAction SilentlyContinue
444
444
(New-Object System.Net.WebClient).DownloadFile($lunaUrl , $lunaPath )
445
445
foreach ($drive in $script :varDrives ) {
446
446
Write-Log - Text " Starting Luna scan for drive '$drive '"
447
- $lunaResults = @ (cmd / c " "" $lunaPath "" scan --ignore-warnings --no-follow-symlinks --json $drive \ 2>&1" )
447
+ $lunaResults = & $lunaPath scan -- ignore- warnings -- no- follow- symlinks -- json $drive \ 2>&1
448
448
Write-Log - Text " Completed Luna scan for drive '$drive '"
449
449
Add-Content - Value $lunaResults - Path $lunaLog
450
450
foreach ($entry in $lunaResults ) {
0 commit comments