Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
log4shell-finder — Scanner del filesystem più veloce per log4shell (CVE-2021-44228, CVE-2021-45046) e altre istanze vulnerabili (CVE-2017-5645, CVE-2019-17571, CVE-2022-23305, CVE-2022-23307 ... ) della libreria log4j. Prestazioni eccellenti e basso consumo di memoria. | Kitploit
Strumenti/GitHubGitHub/hynekpetrak/log4shell-finder
Analisi StaticaScanner di VulnerabilitàAnalisi delle VulnerabilitàAnalisi del CodiceSicurezza della Supply ChainConfigurazione Errata
GitHubhynekpetrak/log4shell-finder

log4shell-finder

Scanner del filesystem più veloce per log4shell (CVE-2021-44228, CVE-2021-45046) e altre istanze vulnerabili (CVE-2017-5645, CVE-2019-17571, CVE-2022-23305, CVE-2022-23307 ... ) della libreria log4j. Prestazioni eccellenti e basso consumo di memoria.

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Vedi Repository
391343 anni faRevisionato da Kitploit
Condividi

log4shell-finder - Scanner del file system più veloce per istanze log4j

Porting Python di https://github.com/mergebase/log4j-detector log4j-detector è copyright (C) Copyright 2021 Mergebase Software Inc. https://mergebase.com/ Concesso in licenza GPLv3.

La motivazione per portare in Python era migliorare le prestazioni, ridurre il consumo di memoria e aumentare la leggibilità del codice. Vedi la sezione su prestazioni per il confronto.

*E sembra che questo sia lo strumento di scansione più veloce con il minor fabbisogno di memoria *

Identifica le versioni di log4j (1.x), reload4j (1.2.18+) e log4j-core (2.x) sul tuo file system vulnerabili a CVE-2021-44228, CVE-2021-45046 e molti altri - vedi tabella sotto. È in grado di trovare istanze incorporate in applicazioni più grandi a diversi livelli di profondità. Funziona su Linux, Windows, Mac o ovunque sia eseguito Python 3.8+.

Può rilevare correttamente log4j all'interno di jar/war eseguibili spring-boot, dipendenze mescolate in uber jar, jar shaded e persino file jar esplosi non compressi sul file system (aka *.class).
Può anche gestire file di classe shaded - estensioni .esclazz (elastic) e .classdata (Azure).

Estensioni di archivio Java cercate: .zip, , , , , , , , , , , , , , ,

.jar
.war
.ear
.aar
.jpi
.hpi
.rar
.nar
.wab
.eba
.ejb
.sar
.apk
.par
.kar

Vulnerabilità rilevate

RilevaCVECVSSv3GravitàJavaVulnerabile daVulnerabile fino aRisolto inlibreria
YESCVE-2021-4422810.0Critica82.0-beta92.14.12.15.0log4jv2
YESCVE-2017-56459.8Critica72.0-alpha12.8.12.8.2log4jv2
YESCVE-2019-175719.8Critica1.2.01.2.17nofixlog4jv1
YESCVE-2021-450469.0Critica7/82.0-beta92.15.0 esclusa 2.12.22.12.2/2.16.0log4jv2
YESCVE-2022-233059.8Critica1.2.01.2.17nofix / 1.2.18.1log4jv1, reload4j
YESCVE-2022-233079.8Critica1.2.01.2.17nofix / 1.2.18.1log4jv1, reload4j
YESCVE-2022-233028.8Alta1.01.2.17nofix / 1.2.18.1log4jv1, reload4j
YESCVE-2021-41047.5Alta-1.01.2.17

Ogni istanza viene segnalata con l'elenco appropriato di CVE. Per ogni CVE, il file della libreria log4j viene analizzato per verificare se le soluzioni alternative raccomandate (ad es. JndiLookup.class o JMSAppender.class rimossi) sono state applicate e in tal caso è considerato non vulnerabile. Lo stato STRANGE viene segnalato per archivi con file pom.properties di log4j-core, ma senza classi di bytecode effettive, di solito si tratta di pacchetti sorgente e possono essere ignorati.

Attenzione La funzionalità --fix è sperimentale, usala a tuo rischio, assicurati di eseguire il backup dei tuoi file jar prima di usarla.

L'argomento --fix tenta di rinominare le istanze di JndiLookup.class in JndiLookup.vulne, impedendo così il caricamento della classe. All'interno degli archivi Java viene eseguito tramite rinomina in-place, non richiede la rizippatura dell'archivio ed è istantaneamente veloce.

I binari sono disponibili per Linux 64bit, MS Windows 64bit e 32bit - vedi Releases

La versione minima supportata di Python è 3.8. Secondo i miei test, l'implementazione zip di Python 3.6 non può aprire molti file .jar dai miei dati di test.

Prestazioni

log4shell finder è ottimizzato per prestazioni e basso consumo di memoria.

Aggiornato il 23.1.2022, prestazioni misurate su una directory con 26237 file in 2005 cartelle.

Tempo di esecuzione ridotto della metà, consumo di memoria di 2/3, letture del file system di almeno il 90%

log4shell-finder (questo strumento)

root@kitploit:~
Command being timed: "./test_log4shell.py /home/hynek/war/ --exclude-dirs /mnt --same-fs"
User time (seconds): 17.68
System time (seconds): 1.20
Percent of CPU this job got: 127%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:14.47
Maximum resident set size (kbytes): 64144
File system inputs: 114424

log4j-finder (https://github.com/fox-it/log4j-finder)

root@kitploit:~
Command being timed: "./log4j-finder.py /home/hynek/war/"
User time (seconds): 23.59
System time (seconds): 1.09
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:26.18
Maximum resident set size (kbytes): 38604
File system inputs: 142824

log4j-detector (https://github.com/mergebase/log4j-detector)

root@kitploit:~
Command being timed: "java -jar log4j-detector-latest.jar /home/hynek/war"
User time (seconds): 30.56
System time (seconds): 1.39
Percent of CPU this job got: 113%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:28.26
Maximum resident set size (kbytes): 214116
File system inputs: 14416

log4j2-scan (https://github.com/logpresso/CVE-2021-44228-Scanner)

root@kitploit:~
Command being timed: "./log4j2-scan /home/hynek/war --scan-log4j1 --scan-zip"
User time (seconds): 52.05
System time (seconds): 25.32
Percent of CPU this job got: 88%
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:27.86
Maximum resident set size (kbytes): 593080
File system inputs: 215416

Registro modifiche

Versione 1.22-20220222

  • Aggiunto: Lettura della versione e del nome della libreria (log4j, log4j-core, reload4j) da MANIFEST.MF e da pom.properties
  • Miglioramenti delle prestazioni di un ulteriore 15%
  • Aggiunto: Rilevamento automatico di tutte le unità locali in mswin con il parametro all
  • Aggiunto: --no-csv-header per omettere l'intestazione csv per consentire un più facile unione dei risultati da più host
  • Aggiunto: Rilevamento di CVE-2017-5645 (9.8), CVE-2019-17571 (9.8), CVE-2022-23307 (8.1), CVE-2022-23305 (9.8), CVE-2022-23305 (9.8), CVE-2022-23302 (8.1), rilevamento migliorato di CVE-2017-5645
  • Aggiunto: Parametro --threads per regolare manualmente il numero di thread di scansione
  • Aggiunto: Parametro --cvs-clean per scrivere una riga "CLEAN" nell'output csv in caso non venga rilevata alcuna libreria log4j
  • Aggiunto: Parametro --cvs-stats per scrivere una riga "STATS" nell'output csv con tempo di esecuzione in secondi e numero di file e cartelle scansionati

Versione 1.21-20220109

  • Bug risolto: il comando --fix nelle versioni 1.19 e 1.20 poteva corrompere gli archivi .jar.

Per le modifiche precedenti vedi Release Notes

Utilizzo

Esegui da un interprete python o usa i binari Windows/Linux dalla cartella dist.

Attenzione: eseguire come utente con accesso (almeno in lettura) all'intero filesystem. log4shell-finder attraversa solo le cartelle a cui può accedere, senza segnalare errori di permesso negato.

root@kitploit:~
PS C:\D\log4shell_finder> python3 .\test_log4shell.py --help
usage:  Type "test_log4shell.py --help" for more information
        On Windows "test_log4shell.py c:\ d:\"
        On Linux "test_log4shell.py /"

Searches file system for vulnerable log4j version.

positional arguments:
  folders               List of folders or files to scan. Use "-" to read list of files from stdin. On MS Windows use "all" to scan all local drives.

optional arguments:
  -h, --help            show this help message and exit
  --exclude-dirs DIR [DIR ...]
                        Exclude given directories from search.
  -s, --same-fs         Don't scan mounted volumens.
  -j [FILE], --json-out [FILE]
                        Save results to json file.
  -c [FILE], --csv-out [FILE]
                        Save results to csv file.
  --csv-clean           Add CLEAN status line in case no entries found
  --csv-stats           Add STATS line into csv output.
  --no-csv-header       Don't write CSV header to the output file.
  -f, --fix             Fix vulnerable by renaming JndiLookup.class into JndiLookup.vulne.
  --threads [THREADS]   Specify number of threads to use for parallel processing, default is 6.
  --file-log [LOGFILE]  Enable logging to log file, default is log4shell-finder.log.
  --progress [SEC]      Report progress every SEC seconds, default is 10 seconds.
  --no-errors           Suppress printing of file system errors.
  --strange             Report also strange occurences with pom.properties without binary classes (e.g. source or test packages)
  -d, --debug           Increase verbosity, mainly for debugging purposes.
  -v, --version         show program's version number and exit

Non richiede librerie python aggiuntive.

Compilare i binari

I binari sono stati prodotti con:

root@kitploit:~
pip install pyinstaller
pyinstaller -F ./test_log4shell.py

Se vuoi costruire una versione a 32 bit, installa un interprete Python a 32 bit, installa pyinstaller con:

root@kitploit:~
C:\Users\User\AppData\Local\Programs\Python\Python38-32\python.exe -m pip install pyinstaller

e poi:

root@kitploit:~
 C:\Users\User\AppData\Local\Programs\Python\Python38-32\Scripts\pyinstaller.exe -n test_log4shell-mswin32 -F test_log4shell.py 

Esecuzione di esempio

Su Linux puoi eseguire come:

root@kitploit:~
python3 ./test_log4shell.py / /opt --same-fs --no-errors

per MS Windows:

root@kitploit:~
python3 .\test_log4shell.py c:\ d:\ --same-fs --no-errors

Su MS Windows:

Assicurati di aver installato pywin32, ad esempio tramite pip install pywin32

root@kitploit:~
PS C:\D\log4shell_finder> python3 .\test_log4shell.py c:\ --same-fs --no-errors

 8                  .8         8             8 8        d'b  o            8
 8                 d'8         8             8 8        8                 8
 8 .oPYo. .oPYo.  d' 8  .oPYo. 8oPYo. .oPYo. 8 8       o8P  o8 odYo. .oPYo8 .oPYo. oPYo.
 8 8    8 8    8 Pooooo Yb..   8    8 8oooo8 8 8        8    8 8' `8 8    8 8oooo8 8  `'
 8 8    8 8    8     8    'Yb. 8    8 8.     8 8        8    8 8   8 8    8 8.     8
 8 `YooP' `YooP8     8  `YooP' 8    8 `Yooo' 8 8        8    8 8   8 `YooP' `Yooo' 8
 ..:.....::....8 ::::..::.....:..:::..:.....:....:::::::..:::....::..:.....::.....:..::::
 :::::::::::ooP'.:::::::::::::::::::::::::::::::::   Version 1.17-20220105   ::::::::::::
 :::::::::::...::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 Parameters: .\test_log4shell.py c:\ --same-fs --no-errors
 Host info: 'hostname': 'TESTHOST', 'fqdn': 'TESTHOST.example.com', 'ip': '10.0.0.1', 'system': 'Windows', 'release': '10', 'version': '10.0.19043', 'machine': 'AMD64', 'cpu': 'Intel64 Family 6 Model 142 Stepping 12, GenuineIntel'

[+] [CVE-2021-4104 (8.1)]  Package c:\Program Files\Microsoft SQL Server\150\DTS\Extensions\Common\Jars\log4j-1.2.17.jar contains Log4J-1.2.17 <= 1.2.17, JMSAppender.class found
[+] [CVE-2021-44832 (6.6), CVE-2021-45046 (9.0), CVE-2021-45105 (5.9)]  Package c:\Program Files\OWASP\Zed Attack Proxy\lib\log4j-core-2.15.0.jar contains Log4J-2.15.0 == 2.15.0
[+] [CVE-2021-44228 (10.0), CVE-2021-44832 (6.6), CVE-2021-45046 (9.0), CVE-2021-45105 (5.9)]  Package c:\Users\testuser\Downloads\sqldeveloper-20.4.1.407.0006-x64.zip -> sqldeveloper/sqldeveloper/lib/log4j-core.jar contains Log4J-2.13.3 >= 2.10.0
[+] [CVE-2021-44228 (10.0), CVE-2021-44832 (6.6), CVE-2021-45046 (9.0), CVE-2021-45105 (5.9)]  Package c:\Users\testuser\Downloads\sqldeveloper-20.4.1.407.0006-x64\sqldeveloper\sqldeveloper\lib\log4j-core.jar contains Log4J-2.13.3 >= 2.10.0


 Scanned 1162924 files in 286638 folders.
   Found 1 instances vulnerable to CVE-2021-4104 (8.1)
   Found 2 instances vulnerable to CVE-2021-44228 (10.0)
   Found 3 instances vulnerable to CVE-2021-44832 (6.6)
   Found 3 instances vulnerable to CVE-2021-45046 (9.0)
   Found 3 instances vulnerable to CVE-2021-45105 (5.9)

Scansione di Kali, con report ogni secondo e cartella zip-bomb esclusa:

root@kitploit:~
root@kali:/home/hynek/log4shell-finder# python3 test_log4shell.py / --same-fs --no-errors --progress 1  --exclude-dirs /usr/share/seclists/Payloads/Zip-Bombs/

 8                  .8         8             8 8        d'b  o            8
 8                 d'8         8             8 8        8                 8
 8 .oPYo. .oPYo.  d' 8  .oPYo. 8oPYo. .oPYo. 8 8       o8P  o8 odYo. .oPYo8 .oPYo. oPYo.
 8 8    8 8    8 Pooooo Yb..   8    8 8oooo8 8 8        8    8 8' `8 8    8 8oooo8 8  `'
 8 8    8 8    8     8    'Yb. 8    8 8.     8 8        8    8 8   8 8    8 8.     8
 8 `YooP' `YooP8     8  `YooP' 8    8 `Yooo' 8 8        8    8 8   8 `YooP' `Yooo' 8
 ..:.....::....8 ::::..::.....:..:::..:.....:....:::::::..:::....::..:.....::.....:..::::
 :::::::::::ooP'.:::::::::::::::::::::::::::::::::   Version 1.18-20220106   ::::::::::::
 :::::::::::...::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 Parameters: test_log4shell.py / --same-fs --no-errors --progress 1 --exclude-dirs /usr/share/seclists/Payloads/Zip-Bombs/
 Host info: 'hostname': 'kali', 'fqdn': 'kali', 'ip': '10.0.0.2', 'system': 'Linux', 'release': '5.14.0-kali4-amd64', 'version': '#1 SMP Debian 5.14.16-1kali1 (2021-11-05)', 'machine': 'x86_64', 'cpu': ''

Skipping mount point: /data
Skipping mount point: /home
Skipping mount point: /dev
Skipping mount point: /sys
[+] [CVE-2021-4104 (8.1)]  Package /usr/share/paros/paros.jar contains Log4J-1.x <= 1.2.17, JMSAppender.class found
 After 1 secs, scanned 119762 files in 4853 folders.
        Currently at: /usr/share/icons/hicolor/48x48/apps/kali-jd-gui.png
Skipping blaclisted folder: /usr/share/seclists/Payloads/Zip-Bombs
 After 2 secs, scanned 190067 files in 12980 folders.
        Currently at: /usr/share/plasma/desktoptheme/kali/metadata.desktop
[+] [CVE-2021-44228 (10.0), CVE-2021-44832 (6.6), CVE-2021-45046 (9.0), CVE-2021-45105 (5.9)]  Package /usr/share/jsql-injection/jsql-injection.jar contains Log4J-2.14.0 >= 2.10.0
 After 3 secs, scanned 221233 files in 17725 folders.
        Currently at: /usr/share/maltego/maltego-ui/modules/com-paterva-maltego-transform-finder.jar
[+] [CVE-2021-44228 (10.0), CVE-2021-44832 (6.6), CVE-2021-45046 (9.0), CVE-2021-45105 (5.9)]  Package /usr/share/zaproxy/lib/log4j-core-2.14.1.jar contains Log4J-2.14.1 >= 2.10.0
[+] [CVE-2021-4104 (8.1)]  Package /usr/share/javasnoop/lib/log4j-1.2.16.jar contains Log4J-1.2.16 <= 1.2.17, JMSAppender.class found
 After 7 secs, scanned 233394 files in 18705 folders.
        Currently at: /usr/share/images/desktop-base/login-background.svg
 After 8 secs, scanned 301417 files in 27952 folders.
        Currently at: /usr/lib/python3/dist-packages/faraday_plugins/plugins/repo/dirb/plugin.py
 After 9 secs, scanned 342342 files in 34421 folders.
        Currently at: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jexec
Skipping mount point: /run
Skipping mount point: /proc


 Scanned 379253 files in 37742 folders in 9.9 seconds.
   Found 2 instances vulnerable to CVE-2021-4104 (8.1)
   Found 2 instances vulnerable to CVE-2021-44228 (10.0)
   Found 2 instances vulnerable to CVE-2021-44832 (6.6)
   Found 2 instances vulnerable to CVE-2021-45046 (9.0)
   Found 2 instances vulnerable to CVE-2021-45105 (5.9)

Output JSON

L'output in json contiene tutti gli elementi trovati e le informazioni sull'host:

root@kitploit:~
{
  "hostname": "myserver",
  "fqdn": "myserver",
  "ip": "10.0.0.1",
  "system": "Linux",
  "release": "5.4.0-58-generic",
  "version": "#64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020",
  "machine": "x86_64",
  "cpu": "x86_64",
  "cmdline": "./test_log4shell.py / --exclude-dirs /mnt --same-fs --csv-out --json-out",
  "starttime": "2021-12-22 07:07:54",
  "items": [
    {
      "container": "Package",
      "path": "/home/hynek/.m2/repository/org/apache/logging/log4j/log4j-core/2.14.1/log4j-core-2.14.1.jar",
      "status": "CVE_2021_44228",
      "message": "contains Log4J-2.14.1 >= 2.10.0",
      "pom_version": "2.14.1"
    },
    {
      "container": "Package",
      "path": "/home/hynek/.m2/repository/org/apache/logging/log4j/log4j-core/2.16.0/log4j-core-2.16.0.jar",
      "status": "NOTOKAY",
      "message": "contains Log4J-2.16.0 == 2.16.0",
      "pom_version": "2.16.0"
    },
    {
      "container": "Package",
      "path": "/home/hynek/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar",
      "status": "CVE_2021_4104",
      "message": "contains Log4J-1.2.17 <= 1.2.17, JMSAppender.class found",
      "pom_version": "1.2.17"
    },
    {
      "container": "Package",
      "path": "/home/hynek/.m2/repository/log4j/log4j/1.2.12/log4j-1.2.12.jar",
      "status": "CVE_2021_4104",
      "message": "contains Log4J-1.x <= 1.2.17, JMSAppender.class found",
      "pom_version": "1.x"
    },
    {
      "container": "Package",
      "path": "/home/hynek/war/elastic-apm-java-aws-lambda-layer-1.28.1.zip:elastic-apm-agent-1.28.1.jar",
      "status": "MAYBESAFE",
      "message": "contains Log4J-2.12.1 <= 2.0-beta8 (JndiLookup.class not present)",
      "pom_version": "2.12.1"
    }
  ]
}

Output CSV

ha le seguenti colonne:

root@kitploit:~
"datetime","ver","ip","fqdn","OS","Release","arch","container","status","path","message","pom_version","product"
"2022-01-24 10:59:36","1.22pre-20220123","10.0.0.1","mylinux","Linux","5.4.0-58-generic","x86_64","Folder","CVE-2022-23302 (6.6), CVE-2022-23305 (8.1), CVE-2022-23307 (8.1)","/home/hynek/war.bak/reload4j/reload4j-1.2.18.0/org/apache/log4j","contains log4j-1.2.18.0","1.2.18.0","log4j"
"2022-01-24 10:59:36","1.22pre-20220123","10.0.0.1","mylinux","Linux","5.4.0-58-generic","x86_64","Package","OLDSAFE","/home/hynek/war.bak/reload4j/reload4j-1.2.18.2.jar","contains reload4j-1.2.18.2","1.2.18.2","reload4j"
"2022-01-24 10:59:36","1.22pre-20220123","10.0.0.1","mylinux","Linux","5.4.0-58-generic","x86_64","Package","OLDSAFE","/home/hynek/war.bak/reload4j/reload4j-1.2.18.1.jar","contains reload4j-1.2.18.1","1.2.18.1","reload4j"
"2022-01-24 10:59:36","1.22pre-20220123","10.0.0.1","mylinux","Linux","5.4.0-58-generic","x86_64","Package","CVE-2019-17571 (9.8), CVE-2021-4104 (7.5), CVE-2022-23302 (6.6), CVE-2022-23305 (8.1), CVE-2022-23307 (8.1)","/home/hynek/war.bak/reload4j/log4j-1.2.17.jar","contains log4j-1.2.17","1.2.17","log4j"
"2022-01-24 10:59:36","1.22pre-20220123","10.0.0.1","mylinux","Linux","5.4.0-58-generic","x86_64","Package","CVE-2022-23302 (6.6), CVE-2022-23305 (8.1), CVE-2022-23307 (8.1)","/home/hynek/war.bak/reload4j/reload4j-1.2.18.0.jar","contains log4j-1.2.18.0","1.2.18.0","log4j"
Scarica lo strumento
nofix
log4jv1
YESCVE-2021-448326.6Media6/7/82.0-alpha72.17.0, esclusa 2.3.2/2.12.42.3.2/2.12.4/2.17.1log4jv2
-CVE-2021-425506.6Media-1.01.2.71.2.8logback
YESCVE-2021-451055.9Media6/7/82.0-beta92.16.0, esclusa 2.12.32.3.1/2.12.3/2.17.0log4jv2
-CVE-2020-94883.7Bassa7/82.0-alpha12.13.12.12.3/2.13.2log4jv2