๐Enumeration Checklist
REVERT AFTER INITIAL ENUMERATION
IF PHP SHELL REQUIRED USE PHP Ivan Sincek from revshells
Sometimes if the payload is not working try:
Windows Privesc Checklist
If windows then just use rdesktop to connect without credentials and check version
To check if Powershell or CMD:
Enumeration
Rustscan:
Netexec
Add name at end if administrator is a different user
or with wordlist :
Quickly add user to domain admin:
HTTP
SNMP (UDP 161)
Add one of these at the end in snmpwalk
1.3.6.1.2.1.25.1.6.0 | System Processes |
---|---|
1.3.6.1.2.1.25.4.2.1.2 | Running Programs |
1.3.6.1.2.1.25.4.2.1.4 | Processes Path |
1.3.6.1.2.1.25.2.3.1.4 | Storage Units |
1.3.6.1.2.1.25.6.3.1.2 | Software Name |
1.3.6.1.4.1.77.1.2.25 | User Accounts |
1.3.6.1.2.1.6.13.1.3 | TCP Local Ports |
Then try:
-v
- 1 ,2c ,3
To bruteforce community strings:
Then can use snmp-check to get more info:
For brute-forcing ip:
tftp
To bruteforce files in tftp:
ICMP
SMTP
To send an email with smtp server:
Add -ap
for authentication
Or:
DNS
SMB(139,445)
Scan SMB:
If hashes are acquired from mssql or smb then try SMB Relaying if message signing disabled. Check with
Check for interesting scripts in SYSVOL:
ls \\academy-ea-dc01\SYSVOL\INLANEFREIGHT.LOCAL\scripts
and might find passwords in .vbs filesTo bruteforce usernames:
To mount a share:
If the share looks like it is being accessed try to capture NTLMv2 hashes by using evil url and responder(analysis mode):
For OS discovery
nmap -v -p 139,445 --script smb-os-discovery 192.168.50.152
For older windows version:
sudo nmap --script smb-vuln* 192.168.180.40
If a shared share is discovered try multiple poisoned files. Easiest is ntlmtheft.
FTP(21)
Check for ftp anonyomous access:
ftp <ip>
To bruteforce use medusa
medusa -u fiona -P /usr/share/wordlists/rockyou.txt -h 10.129.203.7 -M ftp
Default location is /var/ftp
quote PASV
to fix ftp or usepassive
List files:
Upload/Download
Postgres
Try authentication with admin:admin or postgres:postgres and such variations
To view current user:
To get list of databases:
To check version:
Now check for exploits and use searchsploit -m multiple/remote/50847.py
if version from 9.3 to 11.7
MSSQL
Check version
Check databases
Check tables in database:
We can check user:
Check as what user the db is running:
Catch with responder or smbserver
If chain try SMB Relaying
To get an interactive mssql shell:
mssqlclient.py user:pass@sequel.htb
If password present try /
To enable xp_cmdshell:
or
Check for impersonation:
Refer PG Practice- hokkaido
To audit:
Invoke-SQLAudit -Verbose
from PowerUpSQLlook for privesc cheatsheat in powerupsql github
RPC
enumerate
rpcclient -U '' -N <ip>
then tryenumdomusers
,querydispinfo
,etc.Only users:
User info can be changed with
setuserinfo
. To change oassword:
RDP
To connect to rdp:
If any black screen problems:
If administrator get RDP by using Enable_RDP.ps1 script:
Ldap
Netexec ldap more to less info order:
Change the name here
To get descriptions for users:
ldapnomnom for bruteforcing usernames fast asf. Check for usernames with
Extract rootDSE attributes:
Using nmap to enumerate ldap
Check ldap using ldapsearch:
ldapsearch -x -H ldap://<ip>
Get FQDN :
ldapsearch -x -H ldap://<ip> -s base namingcontexts
Get all info:
Get everything to grep for:
Analysing:
Print first word then sort then print unique and then show non repeating.grep ':'
removes the base64 stuff.
To enumerate users over ldap (ldap can be finicky revert):
Optionally use authentication with -U
and -w
for username and password
To get everything:
[ ]
To enumerate various things use windapsearch.py
use -PU for potential users with elevated privileges that might have gone unnoticed
To check for domain admins
TO check for privileged users
Miscellaneous
Use lazagne to search for stored credentials in web browsers,applications,etc.
If Groupds.xml found use gpp-decrypt
Active Directory
If linux and sudo user check: /etc/krb5.keytab
Try kerberoasting if you have credentials or a shell on the target machine
Linux
GetUserSPNs.py -dc-ip dc01.hybrid.vl hybrid.vl/peter.turner
Use kerbrute to bruteforce usernames and asreproast
For etype 23 hash:
--downgrade
For bruteforce:
/usr/share/seclists/Usernames/xato-net-10-million-usernames.txt
bruteforce from https://github.com/insidetrust/statistically-likely-usernames
To get Ticket Granting Ticket:
getTGT.py absolute.htb/d.klay
Bloodhound with TGT:
Hunting for Users with Kerberoast Pre-auth Not Required:
Windows
To enumerate for asreproastable users (PowerView):
Rubeus method:
.\Rubeus.exe asreproast /user:mmorgan /nowrap /format:hashcat
Certificate Authority(CA)
nxc ldap sendai.vl -u Elliot.Yates -p 'aditya123@' -M adcs
To check for vulnerable certificates
sudo certipy-ad find -u 'a.briggs' -p 'password' -dc-ip <ip> -stdout -vulnerable
To get in bloodhound:-old-bloodhound
Add custom queries in
~./config/bloodhound/customqueries.json
Esc1
To request certificate:
To auth:
Esc4
Convert to ESC1 and follow ESC1 procedure:
Try PetitPotam
Check nmap for certificate authority
If found enumerate post exploitation with certify.exe
Refer Absolute-HTB for more details
DNS Records
Add a new computer:
Then use dnstool.py:
Bloodhound
If SID is displayed it is a local account. BloodHound uses this representation of a principal when the domain identifier of the SID is from a local machine
Use Collection Loops to not miss information.
bloodhound.py ingestor
can also use -dns-tcp
Manual commands: Format for cypher:
All computers in domain:
All Users in domain:
To get active sessions:
If error try dnschef:
If we have shell access on the target
--Loop --LoopDuration 00:10:00
to loop
To get all users
If object-id of a group is above 1000 it is non default
Bloodhound doesn't collect Info so check that with ldapsearch
Raw query to enumerate users with SQLAdmin:
MATCH p1=shortestPath((u1:User)-[r1:MemberOf*1..]->(g1:Group)) MATCH p2=(u1)-[:SQLAdmin*1..]->(c:Computer) RETURN p2
Raw query to enumerate users with CanPSRemote:
MATCH p1=shortestPath((u1:User)-[r1:MemberOf*1..]->(g1:Group)) MATCH p2=(u1)-[:CanPSRemote*1..]->(c:Computer) RETURN p2
Security and Obfuscation
Powershell command for windows defender
Get-MpComputerStatus
There are multiple locations for powershell if blocked:
%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe
To check whitelist apps:
Get-AppLockerPolicy
To find the users who can read Local Administrator Password Solution (LAPS) passwords
Find-LAPSDelegatedGroups
To check if LAPS enabled or cleartext passwords sometimes
Get-LAPSComputers
Impacket
GetNPUsers - This script will attempt to list and get TGTs for those users that have the property 'Do not require Kerberos preauthentication' for asrep roasting.
GetNPUsers.py -dc-ip 10.10.10.161 -request 'htb.local/' -format hashcat
GetUserSPN - For kerberoasting as it Queries target domain for SPNs that are running under a user account
List SPN accounts
GetUserSPNs.py -dc-ip 172.16.5.5 INLANEFREIGHT.LOCAL/forend
add-request
to get in hashcat format or-request-user
to get only for the user
ACL(Access Control List)
PowerView
Suppose we have a single user and want to enumerate ACL from there. In these examples the user is wley
Now to get ACL:
Without PowerView
To get all users list
Now getting the data with Get-ACL:
Here we have access over damundsen
Then to convert the GUID use:
To further enumerate damundsen
To enumerate Help Desk
To get passwords in descriptions:
Checking for PASSWD_NOTREQD Setting
Checking for pre auth kerberos not required
Enumerating GPO names: PowerShell:
Get-DomainGPO |select displayname
Built-in:Get-GPO -All | Select DisplayName
Rights Over GPO:
To abuse GPO misconfiguration: SharpGPOAbuse
PFX
To open certificate
If pfx file is encountered and it is password protected use pfx2john
To extract certificate and key:
We can use winrm to login using keys.
Last updated