From e9214c1df8fd4eaffb8fb136dc7a838353d74480 Mon Sep 17 00:00:00 2001 From: GijsCalis <51088038+GijsCalis@users.noreply.github.com> Date: Tue, 1 Nov 2022 14:03:25 +0100 Subject: [PATCH 1/3] Add openssl in Apache httpd and openssl executable , find only files and clean up output by printing only first matching string in files --- openssl_scan.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openssl_scan.sh b/openssl_scan.sh index 4a1cfd9..2d4d2dd 100644 --- a/openssl_scan.sh +++ b/openssl_scan.sh @@ -22,8 +22,8 @@ if [[ "$confirm" == "confirm" ]]; then exit fi - for file_name in $(find $search_directory -type f -name "libcrypto*.so*" -o -name "libssl*.so*" -o -name "libssl*.a*" -o -name "libcrypto*.a*"); do - openssl_version=$( strings "$file_name" | grep "$regex") + for file_name in $(find $search_directory -type f -a \( -name 'libcrypto*.so*' -o -name 'libssl*.so*' -o -name 'libssl*.a*' -o -name 'libcrypto*.a*' -o -name mod_ssl.so -o -name openssl \)); do + openssl_version=$( strings "$file_name" | grep -m1 "$regex") if [[ $openssl_version ]]; then echo "$openssl_version" - "$file_name" fi From 3f85a266b60dfacfaf4f466a3dd1bf8c181f1567 Mon Sep 17 00:00:00 2001 From: GijsCalis <51088038+GijsCalis@users.noreply.github.com> Date: Tue, 1 Nov 2022 15:04:09 +0100 Subject: [PATCH 2/3] Add openssl in Apache httpd mod_ssl, fix quotes --- openssl_scan.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openssl_scan.ps1 b/openssl_scan.ps1 index a3e37a6..d34bff7 100644 --- a/openssl_scan.ps1 +++ b/openssl_scan.ps1 @@ -4,7 +4,7 @@ $scan_all_drives = $false # set the directory to search for OpenSSL libraries in (default: C:\) # only needed if scanalldrives is $false ! -$search_directory = “C:\” +$search_directory = "C:\" # set to $true to show only OpenSSL version vulnerable to this bug $only_vulnerable = $false @@ -25,7 +25,7 @@ if ($confirm -eq "confirm") { } # search for any DLLs whose name begins with libcrypto - Get-ChildItem -Path $search_directory -Include libcrypto*.dll,libssl*.dll -File -Recurse -ErrorAction SilentlyContinue | Foreach-Object { + Get-ChildItem -Path $search_directory -Include libcrypto*.dll,libssl*.dll,mod_ssl.so -File -Recurse -ErrorAction SilentlyContinue | Foreach-Object { # use RegEx to parse the dll strings for an OpenSSL Version Number $openssl_version = select-string -Path $_ -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value } if ($openssl_version) { From 9656bfdbba980ff27f54736062ba32b0094b5dca Mon Sep 17 00:00:00 2001 From: GijsCalis <51088038+GijsCalis@users.noreply.github.com> Date: Tue, 1 Nov 2022 15:08:25 +0100 Subject: [PATCH 3/3] Also find openssl executable --- openssl_scan.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openssl_scan.ps1 b/openssl_scan.ps1 index d34bff7..444cc9d 100644 --- a/openssl_scan.ps1 +++ b/openssl_scan.ps1 @@ -25,7 +25,7 @@ if ($confirm -eq "confirm") { } # search for any DLLs whose name begins with libcrypto - Get-ChildItem -Path $search_directory -Include libcrypto*.dll,libssl*.dll,mod_ssl.so -File -Recurse -ErrorAction SilentlyContinue | Foreach-Object { + Get-ChildItem -Path $search_directory -Include libcrypto*.dll,libssl*.dll,mod_ssl.so,openssl.exe -File -Recurse -ErrorAction SilentlyContinue | Foreach-Object { # use RegEx to parse the dll strings for an OpenSSL Version Number $openssl_version = select-string -Path $_ -Pattern $regex -AllMatches | % { $_.Matches } | % { $_.Value } if ($openssl_version) {