8000 GitHub - Ocel0tSec/linWinPwn: linWinPwn is a bash script that streamlines the use of a number of Active Directory tools
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

linWinPwn is a bash script that streamlines the use of a number of Active Directory tools

License

Notifications You must be signed in to change notification settings

Ocel0tSec/linWinPwn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

linWinPwn - Swiss-Army knife for Active Directory Enumeration

Description

linWinPwn is a bash script that wraps a number of Active Directory tools for enumeration (LDAP, RPC, ADCS, MSSQL, Kerberos), vulnerability checks, object modifications and password dumping. The script streamlines the use a number of tools including: impacket, bloodhound, netexec, enum4linux-ng, ldapdomaindump, lsassy, smbmap, kerbrute, adidnsdump, certipy, silenthound, bloodyAD, DonPAPI and many others.

linWinPwn can be particularly useful when you have access to an Active Directory environment for a limited time only, and you wish to be more efficient in the enumeration process and in the collection of evidence. In addition, linWinPwn can replace the use of enumeration tools on Windows in the aim of reducing the number of created artifacts (e.g., PowerShell commands, Windows Events, created files on disk), and bypassing certain Anti-Virus or EDRs. This can be achieved by performing remote dynamic port forwarding through the creation of an SSH tunnel from the Windows host (e.g., VDI machine or workstation or laptop) to a remote Linux machine (e.g., Pentest laptop or VPS), and running linWinPwn with proxychains.

On the Windows host, run using PowerShell:

ssh kali@<linux_machine> -R 1080 -NCqf

On the Linux machine, first update /etc/proxychains4.conf to include socks5 127.0.0.1 1080, then run:

proxychains ./linWinPwn.sh -t <Domain_Controller_IP>

Setup

Git clone the repository and make the script executable

git clone https://github.com/lefayjey/linWinPwn
cd linWinPwn; chmod +x linWinPwn.sh

Install requirements using the install.sh script (using standard account)

chmod +x install.sh
./install.sh

Usage

Modules

The linWinPwn script can be ran in interactive mode, or in automation mode.

Default: interactive - Open interactive menu to run checks separately

./linWinPwn.sh -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>]

Using the --auto parameter - Run automatically the enumeration steps only (no exploitation nor modifications to the AD)

./linWinPwn.sh -t <Domain_Controller_IP> --auto -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>]

Parameters

Auto config - Run NTP sync with target DC and add entry to /etc/hosts before running the modules

./linWinPwn.sh -t <Domain_Controller_IP> --auto-config

LDAPS - Use LDAPS instead of LDAP (port 636)

./linWinPwn.sh -t <Domain_Controller_IP> --ldaps

Force Kerberos Auth - Force using Kerberos authentication instead of NTLM (when possible)

./linWinPwn.sh -t <Domain_Controller_IP> --force-kerb

Verbose - Enable all verbose and debug outputs

./linWinPwn.sh -t <Domain_Controller_IP> --verbose

Interface - Choose attacker's network interface

./linWinPwn.sh -t <Domain_Controller_IP> -I tun0
./linWinPwn.sh -t <Domain_Controller_IP> --interface eth0

Targets - Choose targets to be scanned (DC, All, IP=IP_or_hostname, File=./path_to_file)

./linWinPwn.sh -t <Domain_Controller_IP> -T All
./linWinPwn.sh -t <Domain_Controller_IP> --targets DC
./linWinPwn.sh -t <Domain_Controller_IP> -T IP=192.168.0.1
./linWinPwn.sh -t <Domain_Controller_IP> -T File=./list_servers.txt

Demos

  • HackTheBox Forest

Interactive Mode: asciicast

Automated Mode: asciicast

  • TryHackme AttacktiveDirectory

asciicast

Automated mode

When using the automated mode, different checks are performed based on the provided credentials.

Unauthenticated (no credentials provided)

  • Anonymous enumeration using netexec, enum4linux-ng, ldapdomaindump, ldeep
  • RID bruteforce using netexec
  • kerbrute user spray
  • Pre2k authentication check on collected list of computers
  • ASREPRoast using collected list of users (and cracking hashes using john-the-ripper and the rockyou wordlist)
  • Blind Kerberoast
  • CVE-2022-33679 exploit
  • Check for DNS unsecure updates for AS-REQ abuse using krbjack
  • SMB shares anonymous enumeration on identified servers
  • Enumeration for WebDav, dfscoerce, shadowcoerce and Spooler services on identified servers
  • Check for ms17-010, zerologon, petitpotam, nopac, smb-sigining, ntlmv1, runasppl weaknesses
./linWinPwn.sh -t <Domain_Controller_IP_or_Target_Domain> --auto

Authenticated (using password, NTLM hash, Kerberos ticket, AES key or pfx Certificate)

  • DNS extraction using adidnsdump
  • BloodHound data collection
  • Enumeration using netexec, enum4linux-ng, ldapdomaindump, bloodyAD, sccmhunter, rdwatool, sccmhunter, GPOwned
  • Generate wordlist for password cracking
  • netexec find accounts with user=pass
  • Pre2k authentication check on domain computers
  • Extract ADCS information using certipy and certi.py
  • kerbrute 6DA9 find accounts with user=pas
  • ASREPRoasting (and cracking hashes using john-the-ripper and the rockyou wordlist)
  • Kerberoasting (and cracking hashes using john-the-ripper and the rockyou wordlist)
  • Targeted Kerberoasting (and cracking hashes using john-the-ripper and the rockyou wordlist)
  • SMB shares enumeration on all domain servers using smbmap, manspider and cme's spider_plus
  • Enumeration for WebDav, dfscoerce, shadowcoerce and Spooler services on all domain servers (using cme, Coercer and RPC Dump)
  • Check for ms17-010, ms14-068, zerologon, petitpotam, nopac, smb-signing, ntlmv1, runasppl, certifried weaknesses
  • Check mssql privilege escalation paths
  • Check mssql relay possibilities
./linWinPwn.sh -t <Domain_Controller_IP_or_Target_Domain> -d <AD_domain> -u <AD_user> -p <AD_password> -H <hash[LM:NT]> -K <kerbticket[./krb5cc_ticket]> -A <AES_key> -C <cert[./cert.pfx]> --auto

TO DO

  • Add more enumeration and exploitation tools...

Credits

Legal Disclamer

Usage of linWinPwn for attacking targets without prior mutual consent is illegal. It's the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program. Only use for educational purposes.

About

linWinPwn is a bash script that streamlines the use of a number of Active Directory tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%
0