
Script Bash che integra strumenti Active Directory per enumerazione automatizzata, controlli delle vulnerabilità, sfruttamento e dump delle password tramite LDAP, RPC, Kerberos e SMB.
linWinPwn è uno script bash che racchiude numerosi strumenti per Active Directory per enumerazione (LDAP, RPC, ADCS, MSSQL, Kerberos, SCCM), controlli di vulnerabilità (noPac, ZeroLogon, MS17-010, MS14-068), modifiche agli oggetti (cambio password, aggiunta utente a gruppo, RBCD, Shadow Credentials) e dump di password (secretsdump, lsassy, nanodump, DonPAPI). Lo script semplifica l'uso di un gran numero di strumenti: impacket, bloodhound, netexec, enum4linux-ng, ldapdomaindump, lsassy, smbmap, kerbrute, certipy, silenthound, bloodyAD, DonPAPI e molti altri.
Clona il repository git e installa i requisiti usando lo script install.sh
git clone https://github.com/lefayjey/linWinPwn
cd linWinPwn
chmod +x install.sh
./install.sh
In alternativa, usa l'immagine Docker pre-costruita da Docker Hub
docker pull lefayjey/linwinpwn:latest
# Add linWinPwn_docker to PATH
echo -e "docker run --rm --init -it --net=host -v \$(pwd):/opt/lwp-output lefayjey/linwinpwn:latest \$@" | sudo tee "/usr/local/sbin/linWinPwn_docker"
sudo chmod 755 /usr/local/sbin/linWinPwn_docker
# Run linWinPwn_docker (output to host's current directory)
linWinPwn_docker -t <DC_IP>
linWinPwn_docker -t <DC_IP> -d <domain> -u <user> -p <password> --auto
Oppure compila dal sorgente
docker build -t linwinpwn .
docker run --rm --init -it --net=host -v $(pwd):/opt/lwp-output linwinpwn -t <DC_IP>
Lo script linWinPwn può essere eseguito in modalità interattiva (predefinita) o in modalità automatica (solo enumerazione).
1. Modalità Interattiva (Predefinita) - Apre un menu interattivo per eseguire i controlli separatamente
linWinPwn -t <Domain_Controller_IP> [-d <AD_domain> -u <AD_user> -p <AD_password> -H <hash[LM:NT]> -K <kerbticket[./krb5cc_ticket]> -A <AES_key> -C <cert[./cert.pfx]> -o <output_dir>]
2. Modalità Automatica - Usando il parametro --auto, esegue strumenti di enumerazione (nessuno sfruttamento, modifiche o dump di password)
Quando si utilizza la modalità automatica, vengono eseguiti diversi controlli in base al metodo di autenticazione.
linWinPwn -t <Domain_Controller_IP> --auto [-o <output_dir>]
linWinPwn -t <Domain_Controller_IP> -d <AD_domain> -u <AD_user> [-p <AD_password> -H <hash[LM:NT]> -K <kerbticket[./krb5cc_ticket]> -A <AES_key> -C <cert[./cert.pfx]>] [-o <output_dir>] --auto
Auto config - Esegue la sincronizzazione NTP con il DC target e aggiunge una voce in /etc/hosts prima di eseguire i moduli
linWinPwn -t <Domain_Controller_IP> --auto-config
LDAPS - Usa LDAPS invece di LDAP (porta 636)
linWinPwn -t <Domain_Controller_IP> --ldaps
Forza Autenticazione Kerberos - Forza l'uso dell'autenticazione Kerberos invece di NTLM (quando possibile)
linWinPwn -t <Domain_Controller_IP> --force-kerb
Verbose - Abilita tutti gli output verbose e di debug
linWinPwn -t <Domain_Controller_IP> --verbose
Interfaccia - Scegli l'interfaccia di rete dell'attaccante
linWinPwn -t <Domain_Controller_IP> -I tun0
linWinPwn -t <Domain_Controller_IP> --interface eth0
Target - Scegli i target da scansionare (DC, All, IP=IP_o_hostname, File=./percorso_file)
linWinPwn -t <Domain_Controller_IP> --targets All
linWinPwn -t <Domain_Controller_IP> --targets DC
linWinPwn -t <Domain_Controller_IP> -T IP=192.168.0.1
linWinPwn -t <Domain_Controller_IP> -T File=./list_servers.txt
Wordlist personalizzate - Scegli wordlist personalizzate per utenti e password
linWinPwn -t <Domain_Controller_IP> -U /usr/share/seclists/Usernames/xato-net-10-million-usernames.txt
linWinPwn -t <Domain_Controller_IP> -P /usr/share/seclists/Passwords/xato-net-10-million-passwords.txt
linWinPwn può essere particolarmente utile quando hai accesso a un ambiente Active Directory per un periodo di tempo limitato e desideri essere più efficiente nel processo di enumerazione e nella raccolta di prove. Inoltre, linWinPwn può sostituire l'uso di strumenti di enumerazione su Windows al fine di ridurre il numero di artefatti creati (ad esempio comandi PowerShell, eventi di Windows, file creati su disco) e bypassare alcuni Anti-Virus o EDR. Ciò può essere ottenuto eseguendo un port forwarding dinamico remoto tramite la creazione di un tunnel SSH dall'host Windows (ad esempio macchina VDI o workstation o laptop) a una macchina Linux remota (ad esempio laptop per pentest o VPS) ed eseguendo linWinPwn con proxychains.
Sull'host Windows, esegui usando PowerShell:
ssh.exe kali@<linux_machine> -R 1080 -NCqf
Sulla macchina Linux, aggiorna prima /etc/proxychains4.conf per includere socks5 127.0.0.1 1080, poi esegui:
linWinPwn_proxychains -t <Domain_Controller_IP> -d <AD_domain> -u <AD_user> [-p <AD_password> -H <hash[LM:NT]> -K <kerbticket[./krb5cc_ticket]> -A <AES_key> -C <cert[./cert.pfx]>] [-o <output_dir>] [--auto]
ldap3: netexec, ldapdomaindump (NTLM), Certipy, pre2k, bloodhound, ldeep, GroupPolicyBackdoor, relayking
msldap: bloodyAD
netexec, ldapdomaindump, ldeep, windapsearch, godap, pre2k, ldapnomnom
Ispirazione: S3cur3Th1sSh1t - WinPwn
Strumenti:
lwp_tool_integrator.py automatizza l'integrazione di nuovi strumenti. Applica patch a linWinPwn.sh, install.sh e README.md in un unico passaggio:
authenticate() con i flag appropriatiinstall.sh per l'installazione automaticaREADME.mdUtilizzo:
python3 lwp_tool_integrator.py <tool_config.json>
Vedi lwp_tool_template.json per un esempio di configurazione.
L'uso di linWinPwn per attaccare target senza previo consenso reciproco è illegale. È responsabilità dell'utente finale rispettare tutte le leggi locali, statali e federali applicabili. Gli sviluppatori non si assumono alcuna responsabilità e non sono responsabili per eventuali abusi o danni causati da questo programma. Utilizzare solo a scopo educativo.
| Tool | Null Session | Password | NTLM Hash | Kerberos Ticket | AES Key | Certificate |
|---|
netexec | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
Impacket | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
bloodhound-python | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
ldapdomaindump | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
enum4linux-ng | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
bloodyAD | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ |
SilentHound | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
ldeep | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ |
windapsearch | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
LDAPWordlistHarvester | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
LDAPConsole | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
pyLDAPmonitor | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
sccmhunter | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
ldapper | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
Adalanche | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
GPOwned | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
ACED | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
breads | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
godap | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
adcheck | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
certi.py | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
Certipy | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
certsync | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
pre2k | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
orpheus | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
smbmap | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
FindUncommonShares | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
smbclient-ng | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
manspider | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
coercer | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
privexchange | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
RunFinger.py | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
mssqlrelay | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
targetedKerberoast | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
pygpoabuse | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
DonPAPI | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
hekatomb | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
ExtractBitlockerKeys | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
evilwinrm | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ |
mssqlpwner | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
SoaPy | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
SCCMSecrets | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
Soaphound | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
gpoParser | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
spearspray | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
GroupPolicyBackdoor | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ |
NetworkHound | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ |
ShareHound | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
DACLSearch | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ |
ScriptScout | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ |
relayking | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ |
ADWS Domain Dump | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
PyADRecon | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ |
PyADRecon-ADWS | ❌ | ✅ | ❌ | ✅ | ❌ | ❌ |
ADPulse | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
PowerView.py | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
evil-winrm-py | ❌ | ✅ | ✅ | ❌ | ❌ | ✅ |
Riferimenti: