Log4j 是很嚴重的安裝漏洞, 影響也很廣泛, 駭客可以透過 Log4j 漏洞執行指令, Log4j 漏洞在 CVSS 評分高達 10.0, 所以十分值得關注。本文會講述測試系統是否存在 Log4j 漏洞的方法。
已經有人寫了在 Linux 檢查 Log4j 漏洞的 Shell Script,雖然目前還是 beta 版, 不保證有 100% 檢測成功率, 因為這個 Shell Script 不會檢查應用程式包裝的 jar 檔, 但還是很好的工具開始檢測。
要執行檢測系統是否存在 Log4j 漏洞, 執行以下指令:
1 |
# wget https://raw.githubusercontent.com/rubo77/log4j_checker_beta/main/log4j_checker_beta.sh -q -O - | bash |
沒有檢測到 Log4j 漏洞會出現以下結果:
1 2 3 4 5 6 7 8 9 10 11 |
[INFO] Looking for files containing log4j... [INFO] No files containing log4j [INFO] Checking installed packages Solr ElasticSearch and packages containing log4j [INFO] No yum packages found [INFO] Checking if Java is installed... [INFO] Java is not installed [INFO] Analyzing JAR/WAR/EAR files... [INFO] _________________________________________________ [WARNING] Some apps bundle the vulnerable library in their own compiled package, so 'java' might not be installed but one such apps could still be vulnerable. [WARNING] This whole script is not 100% proof you are not vulnerable, but a strong hint |
請留意這個 Shell Script 並不保證完全檢測成功, 但還是很好的開始檢查方向, 當沒有發現 Log4j 漏洞後, 建議還是繼續留意各廠商的 Log4j 更新。