
Correla hash NTLM, dati BloodHound e password craccate per il penetration testing di Active Directory. Importa NTDS.dit, sincronizza con Neo4j, analizza la qualità delle password e genera wordlist personalizzate.
KnowsMore supporta ufficialmente Python 3.8+.
knowsmore.py --word-list -o wl.txt --batch --name companyname
knowsmore.py --word-list -o wl.txt --batch --name companyname -l 1
Nota: il parametro
-lindica lo spazio di caratteri leets, dove 1 è nessun leet e 3 è il massimo leet disponibile.
knowsmore --stats
Questo comando produrrà diverse statistiche sulle password come l'output seguente
KnowsMore v0.1.4 by Helvio Junior
Active Directory, BloodHound, NTDS hashes and Password Cracks correlation tool
https://github.com/helviojunior/knowsmore
[+] Startup parameters
command line: knowsmore --stats
module: stats
database file: knowsmore.db
[+] start time 2023-01-11 03:59:20
[?] General Statistics
+-------+----------------+-------+
| top | description | qty |
|-------+----------------+-------|
| 1 | Total Users | 95369 |
| 2 | Unique Hashes | 74299 |
| 3 | Cracked Hashes | 23177 |
| 4 | Cracked Users | 35078 |
+-------+----------------+-------+
[?] General Top 10 passwords
+-------+-------------+-------+
| top | password | qty |
|-------+-------------+-------|
| 1 | password | 1111 |
| 2 | 123456 | 824 |
| 3 | 123456789 | 815 |
| 4 | guest | 553 |
| 5 | qwerty | 329 |
| 6 | 12345678 | 277 |
| 7 | 111111 | 268 |
| 8 | 12345 | 202 |
| 9 | secret | 170 |
| 10 | sec4us | 165 |
+-------+-------------+-------+
[?] Top 10 weak passwords by company name similarity
+-------+--------------+---------+----------------------+-------+
| top | password | score | company_similarity | qty |
|-------+--------------+---------+----------------------+-------|
| 1 | company123 | 7024 | 80 | 1111 |
| 2 | Company123 | 5209 | 80 | 824 |
| 3 | company | 3674 | 100 | 553 |
| 4 | Company@10 | 2080 | 80 | 329 |
| 5 | company10 | 1722 | 86 | 268 |
| 6 | Company@2022 | 1242 | 71 | 202 |
| 7 | Company@2024 | 1015 | 71 | 165 |
| 8 | Company2022 | 978 | 75 | 157 |
| 9 | Company10 | 745 | 86 | 116 |
| 10 | Company21 | 707 | 86 | 110 |
+-------+--------------+---------+----------------------+-------+
pipx installa KnowsMore in un ambiente virtuale isolato, evitando conflitti con i pacchetti di sistema. Questo è il metodo consigliato su Kali Linux e altri ambienti Python gestiti esternamente (PEP 668).
# Install pipx (if you don't have it yet)
python3 -m pip install --user pipx
# Make sure pipx-installed apps are on your PATH
python3 -m pipx ensurepath
# Install KnowsMore
pipx install knowsmore
# Upgrade to the latest version
pipx upgrade knowsmore
Nota: dopo aver eseguito pipx ensurepath potrebbe essere necessario aprire un nuovo terminale (o eseguire source ~/.bashrc / source ~/.zshrc) affinché il comando knowsmore diventi disponibile.
Nota: su Python 3.12+ il modulo setuptools/pkg_resources non è più incluso per impostazione predefinita. Se si verifica un errore No module named 'pkg_resources', inietta setuptools nell'ambiente KnowsMore:
pipx inject knowsmore setuptools
pip3 install --upgrade knowsmore
Nota: Se incontri problemi con la versione delle dipendenze, controlla il file Virtual ENV
Non esiste un ordine obbligatorio per importare i dati, ma per ottenere una migliore correlazione dei dati suggeriamo il seguente flusso di esecuzione:
Tutti i dati sono memorizzati in un database SQLite
knowsmore --create-db
Possiamo importare tutti i file completi di BloodHound in KnowsMore, correlare i dati e sincronizzarli con il database Neo4J di BloodHound. Quindi puoi usare solo KnowsMore per importare i file JSON direttamente nel database Neo4j invece di usare l'interfaccia utente di BloodHound estremamente lenta.
# Bloodhound ZIP File
knowsmore --bloodhound --import-data ~/Desktop/client.zip
# Bloodhound JSON File
knowsmore --bloodhound --import-data ~/Desktop/20220912105336_users.json
Nota: KnowsMore è in grado di importare file ZIP e JSON di BloodHound, ma consigliamo di utilizzare il file ZIP, perché KnowsMore ordinerà automaticamente i file per una migliore correlazione dei dati.
# Bloodhound ZIP File
knowsmore --bloodhound --sync 10.10.10.10:7687 -d neo4j -u neo4j -p 12345678
Nota: L'implementazione di KnowsMore di bloodhound-importer è stata ispirata dall'implementazione di Fox-It BloodHound Import. Abbiamo implementato diverse modifiche per salvare tutti i dati nel database SQLite di KnowsMore e successivamente eseguire una sincronizzazione incrementale con il database Neo4J. Con questa strategia abbiamo diversi vantaggi, come una velocità almeno 10 volte superiore rispetto all'interfaccia utente originale di BloodHound.
Nota: Importa hash e password in chiaro direttamente da NTDS.dit e dal registro SYSTEM
knowsmore --secrets-dump -target LOCAL -ntds ~/Desktop/ntds.dit -system ~/Desktop/SYSTEM
Nota: Prima usa secretsdump per estrarre gli hash NTDS con il comando seguente
secretsdump.py -ntds ntds.dit -system system.reg -hashes lmhash:ntlmhash LOCAL -outputfile ~/Desktop/client_name
Dopo di che importa
knowsmore --ntlm-hash --import-ntds ~/Desktop/client_name.ntds
knowsmore --word-list -o "~/Desktop/Wordlist/my_custom_wordlist.txt" --batch --name company_name
Prima estrai tutti gli hash in un file txt
# Extract NTLM hashes to file
nowsmore --ntlm-hash --export-hashes "~/Desktop/ntlm_hash.txt"
# Or, extract NTLM hashes from NTDS file
cat ~/Desktop/client_name.ntds | cut -d ':' -f4 > ntlm_hashes.txt
Per craccare gli hash, di solito uso hashcat con il comando seguente
# Wordlist attack
hashcat -m 1000 -a 0 -O -o "~/Desktop/cracked.txt" --remove "~/Desktop/ntlm_hash.txt" "~/Desktop/Wordlist/*"
# Mask attack
hashcat -m 1000 -a 3 -O --increment --increment-min 4 -o "~/Desktop/cracked.txt" --remove "~/Desktop/ntlm_hash.txt" ?a?a?a?a?a?a?a?a
knowsmore --ntlm-hash --company clientCompanyName --import-cracked ~/Desktop/cracked.txt
Nota: Cambia clientCompanyName con il nome della tua azienda
Poiché le password e i relativi hash sono dati estremamente sensibili, esiste un modulo per sostituire le password in chiaro e i rispettivi hash.
Nota: Questo comando manterrà tutte le statistiche generate e i dati utente importati.
knowsmore --wipe
Durante la valutazione puoi trovare (in vari modi) la password degli utenti, quindi puoi aggiungerla al database di Knowsmore
knowsmore --user-pass --username administrator --password Sec4US@2023
# or adding the company name
knowsmore --user-pass --username administrator --password Sec4US@2023 --company sec4us
Integra tutte le credenziali craccate nel database Neo4j di BloodHound
knowsmore --bloodhound --mark-owned 10.10.10.10 -d neo4j -u neo4j -p 123456
Per la connessione remota, assicurati che il server del database Neo4j accetti connessioni remote. Modifica la riga seguente nel file di configurazione /etc/neo4j/neo4j.conf e riavvia il servizio.
server.bolt.listen_address=0.0.0.0:7687