🔴
Hacking
  • 1. Hacking Infrastructure
    • Infra Planification
      • Infrastructure Diagram & Requirements
    • Infra Configuration
      • Attack Server & Machine Configurations
      • C2 Server
      • Redirector
      • Payload Server
      • Phishing Server
  • 2. Reconnaissance and Information Gathering
    • OSINT (Open-Source Intelligence)
      • Enviroment
      • Android Virtualization
      • Web Browsers
      • Sock Puppets (Covert Accounts)
      • All-purpose Advanced Tools
      • Search Engines
      • People Search Engines
      • Websites & Domains
      • IP Addresses
      • Users & Emails
      • Social Media
      • Documents
      • Images
      • Videos & Lives
      • Metadata
      • Telephone Numbers
      • Online Maps
      • Virtual Currencies
      • Leaks, Breaches, Logs and Ransomware
      • Government & Business Records
    • Port, Version, Vuln Scanning
      • Nmap
      • Shodan
      • Network Mapping
      • Researching Potential Vulnerabilities
      • Dark Web Scanning
  • 3. Social Engeniering
    • Phising
      • Recycling Domains
      • Header Manipulation
      • Email Creation and Delivery
      • Email Spoofing & Warning Disabling
      • Site Building
      • Evilginx
      • Payload Hosting Obfuscation
      • Diverting the Analysts
      • VBA Macros & RTI
      • HTML Smuggling & HTA Files
      • JS Files
      • Other File Types
    • SMS Spoofing
      • SMSpubli
    • Social Engineering Toolkit (SET)
      • SET Installation
  • 4. Exploitation
    • Password Cracking
      • SetUp
      • Wordlist Building
      • Tools
    • Payloads - File Transfer - Coding - MalDev - ExploitDev
      • Payload Triggering
        • Shell File Transfer
        • PS Execution - Donwload Craddles
      • Normal Shells, Revshells and Webshells
        • Reverse Shells vs Bind Shells
        • Direct Reverse Shell Commands
        • Interactive Shell
        • Normal Reverse Shell Tools
        • PHP Webshells
        • ASP/ASPX Webshells
        • Kraken Webshell
        • Python Webshells
      • Coding Basics
        • Bash
        • Python
        • C
        • C++
        • C#
        • x86-64 (Intel) Assembly - NASM & MASM
      • Windows MalDev
        • MDLC & Tools
        • Architecture, Memory Management, APIs & Processes
        • PEs & DLLs
        • Malware Binary Signing & Metadata Modification
        • Payload Placement
        • Payload Execution Control
        • Payload Encryption & Obfuscation
        • Malware Optimization: Entropy Reduction & Compile Settings
        • Local Payload Execution
        • Process Enum, Injection & Hollowing
        • Payload Staging
        • Thread Hijacking
        • APC Injection
        • Callback Code Execution
        • Mapping Injection
        • Function Stomping Injection
        • PPID Spoofing
        • Process Argument Spoofing
        • API Hooking
        • String Hashing
        • IAT Hiding, Obfuscation & Camouflage
        • Anti-Debugging
        • Anti-Virtualization
        • Syscalls
        • NTDLL Refreshing
      • Windows ExploitDev
        • Tools
        • x86 Vanilla Stack BOF
      • Linux ExploitDev
        • BOF GNU/Linux 32-bit
    • Active Directory
      • Host and Domain Recon
        • SMB (139,445) Enum
        • RPC (135, 1024-5000) Enum
        • LDAP (389,636,3268,3269) Enum
        • PowerView
        • RSAT tools & others
        • BloodHound
      • Attacks and procedures
        • Password Spraying
        • User Impersonation
        • Lateral Movement
        • Kerberos (88)
        • Certificate Services (AD CS)
        • ACLs/ACEs
        • Group Policy
        • MS SQL Servers
        • LAPS (Local Administrator Password Solution)
        • Group Managed Service Accounts (gMSAs)
        • Microsoft Configuration Manager
        • Domain Dominance
        • Forest & Domain Trusts
        • MiTM & Relaying Attack
    • Cloud
      • Azure
        • Basic Info
        • Initial Access
        • Enumeration
        • Privilege Escalation
        • Lateral Movement
        • Persistence
        • Data Exfiltration
      • AWS
        • Basic Info
        • Initial Access
        • Enumeration
        • Privilege Escalation
        • Lateral Movement
        • Post-Exp & Persistence
        • Data Exfiltration
      • Google Cloud and Workspace
        • Basic Info
        • Initial Access
        • Enumeration
        • Privilege Escalation & Lateral Movement
        • Credential Access
        • Data Exfiltration
        • Persistance
    • Web
      • Fingerprinting
      • Automated Scanners
      • Proxies
        • WAFs & Attack Obfuscation
        • HTTP Request Smuggling
      • CMS's: Content Management Systems
      • Authentication
        • Authentication vulnerabilities
        • OAuth 2.0 Authentication Vulnerabilities
        • Access Control
      • Files
        • File Upload
      • Reflected Values
        • Command Injection
        • HTML & XSS Injection
        • SSRF: Server-Side Request Forgery
        • SSTI: Server-Side Template Injection
        • CRLF Injection
        • CSV Injection
        • Openredirect
        • Prototype Pollution
        • ShellShock Attack
      • Search functionalities
        • LFI - RFI - Path traversal
        • SQL Injection
        • NoSQL injection
        • LDAP Injection
        • XPath Injection
      • Forms, WebSockets and PostMsgs
        • CSRF: Croos-Site Request Forgery
        • WebSocket Attacks
      • HTTP Headers
        • Clickjacking
        • CORS
        • Host Header Injection
      • Structured objects - Specific functionalities
        • XML External Entity (XXE) Injection
        • Deserialization Attacks
        • Padding Oracle Attack
      • Whitebox
        • Source Code Recovery, Analysis & Debugging
        • Python PoC Building
        • File Upload
        • SQL Injection
        • JavaScript Injection
        • SSTI (Server-Side Template Injection)
        • PHP Type Juggling
        • Prototype Pollution
        • Password Reset Attacks
    • Network Services
      • FTP 21
      • SSH 22
      • DNS 53,5353
      • FINGER 79
      • POP3 110,995
      • SNMP 161,162,10161,10162
      • MYSQL 3306
      • VNC 5800,5801,5900,5901
      • Ansible
      • Artifactory (8081)
      • Citrix & VDIs
      • vSphere & ESXi
    • Wireless Pentesting
      • Wireless Reconnaissance
      • Wifite
      • RogueAP
      • WiFi Pineapple Mark VII
    • Camera Pentesting
      • Identifying Unsecured Web Cams
      • Default Passwords
      • Cameraradar
    • SCADA/ICS
      • Reconnaissance
      • Metasploit Modbus
      • modbus-cli
    • Mobile Pentesting
      • Enviroment SetUp
      • Android Pentest
      • iOS Pentest
  • 5. Privesc and Post-explotation
    • Linux Privilege Escalation
      • Manual Testing Elevation of privileges
      • Enumeration Commands
      • Enumeration Scripts
      • Looting for passwords & Interesting Information
      • Writable Files
      • SUDO
      • SSH Key
      • Scheduled tasks
      • SUID
      • Capbilities
      • NFS Root Squashing (Network File Sharing)
      • Shared Library
      • Docker Breakeout
      • Hijack TMUX session
      • Wildcard
      • Kernel Exploits
    • Linux Post-Explotation
      • SSH Backdoor
      • Manual Backdoors
      • Pillaging/Data Harvesting
    • Windows Privilege Escalation
      • Enumeration Scripts
      • Manual Enumeration
      • Metasploit tools
      • Processes Enumeration and Tasks
      • Incorrect permissions in services
      • Unquoted Service Paths
      • Insecure GUI Apps
      • Autorun
      • AlwaysInstallElevated
      • $PATH Interception
      • Looting for passwords
      • Runas
      • Impersonation Privileges
      • From local administrator to NT SYSTEM
      • Common Vulnerabilities and Exposure (CVE)
      • Kernel Exploitation
      • Named Pipes
      • Vulnerable Drivers
      • Abusing Shadow Copies
    • Windows Post-Explotation
      • Credential Theft
      • RDP Hijacking
      • Session Spying
      • WDigest
      • User backdoor
      • Manual Backdoors
      • Scheduled Tasks, Startup Folder, Autoruns and Services
      • WMI Event Subscriptions Persistance
      • Hunting for COM Hijacks
      • Mail Harvesting
    • Data Exfiltration
  • 6. Evasion Techniques
    • Linux - Evasion Techniques
    • Windows - Evasion Techniques
      • Detection Mechanisms & Evasion Techniques
      • Microsoft Defender Antivirus
      • AMSI & UAC Bypasses
      • AppLocker and Powershell CLM
      • PowerShell Script Block Logging
      • MDE (Microsoft Defender for Endpoint)
      • Altered scripts & Automations
      • Command Reimplementation C#/C
      • EDR Killing
  • 7. Tunneling
    • Port Forwarding
      • SSH Port Forwarding
      • Chisel Port Forwarding
      • Metasploit SSH Port Forwarding
    • Pivoting
      • Linux Tools & Methedology
      • Windows Tools
      • SSH Pivoting
    • C2 (Command and Control)
      • Cobalt Strike
        • Set Up and Team Server
        • Listeners
        • Payloads
        • Attacks
        • Beacon Commands
        • Session Passing
        • Maleable Profiles
        • Artifact Kit
        • Resource Kit
        • Behavioural Detections
        • Aggressor Scripts
        • Beacon Object Files (BOFs)
        • NTLM Relaying Methodology w/ Cobalt
      • Metasploit
        • Schema Cheat Sheet
        • Staged vs Non-Staged Payloads
        • Metasploit Options
        • Start MSF DB (Kali)
        • Listeners
        • Meterpreter Commands
        • Pivoting
        • Meterpreter Pass a Shell
        • Msfvenom Payloads
        • Meterpreter Pillaging/Data Harvesting
      • Havoc
        • Set Up and Team Server
        • Listeners
        • Payloads
        • Deamon Commands
      • Empire
      • Custom C2s
        • HTTP mini C2
  • 8. Profesional Reports
    • LaTeX
      • Tools
      • Variable Config
      • Template definition & PDF Preview
      • Commands
      • Pentest Report Template
    • Documentation Tools
      • Note-Taking
      • Advanced Text Editors
      • Appendix
      • Quality and Diversity of Sources
      • Document Sanitization
    • Report Anatomy
      • OSINT Report Anatomy
Powered by GitBook
On this page
  1. 4. Exploitation
  2. Active Directory
  3. Host and Domain Recon

RSAT tools & others

PreviousPowerViewNextBloodHound

Last updated 2 hours ago

- Remote Server Administration Tools (RSAT) Tools

With GUI (RDP or physical) Access we can use the following RSAT Tools to map the domain:

  • dsa.msc (Active Directory Users and Computers)

    • runas /netonly /user:<DOMAIN>\<user> cmd.exe

    • dsa.msc

  • AD Explorer

  • dssite.msc (Active Directory Sites and Services)

  • domain.msc (Active Directory Domains and Trusts)

  • dsac.exe (Active Directory Administrative Center)

  • gpmc.msc (Group Policy Management)

  • dnsmgmt.msc (DNS Manager)

  • Server Manager

To dump info from AD Explorer and load it into Bloodhound: Create snapshot, then:

- Proxy Enumeration

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings --> AutoConfigURL (then dump pac file) or PorxyServer

- Seatbelt ()

To collect enumeration data for a host (Notice if there's a web proxy in place):

Seatbelt.exe -group=system

To enumerate the configurations and defences of a target before jumping to it:

execute-assembly C:\Tools\Seatbelt\Seatbelt\bin\Release\Seatbelt.exe OSInfo -ComputerName=web

To enumerate privileges for privesc:

Seatbelt.exe TokenPrivileges

To enumerate a user's vaults (Credential Manager):

run vaultcmd /list

run vaultcmd /listcreds:"Windows Credentials" /all

Get-ChildItem C:\Users\User\AppData\Local\Microsoft\Credentials\ -force

execute-assembly C:\Tools\Seatbelt\Seatbelt\bin\Release\Seatbelt.exe WindowsVault

execute-assembly C:\Tools\Seatbelt\Seatbelt\bin\Release\Seatbelt.exe WindowsCredentialFiles

To enumerate certificates on a machine:

execute-assembly C:\Tools\Seatbelt\Seatbelt\bin\Release\Seatbelt.exe Certificates

ADSearch allow us to specify custom Lightweight Directory Access Protocol (LDAP) searches. These can be used to identify entries in the directory that match a given criteria.

--json parameter can be used to format the output in JSON.

To search for all objects whose category is "user" (i.e. domain users):

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "objectCategory=user"

To search for groups which end in the word "admins".

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(&(objectCategory=group)(cn=*Admins))"

To find users who have an SPN set (Kerberoasting):

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(&(objectCategory=user)(servicePrincipalName=*))" --attributes cn,servicePrincipalName,samAccountName

To find users who does not have Kerberos pre-authentication enabled (ASREP Roasting):

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(&(objectCategory=user)(userAccountControl:1.2.840.113556.1.4.803:=4194304))" --attributes cn,distinguishedname,samaccountname

To identify all computers that are permitted for unconstrained delegation:

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(&(objectCategory=computer)(userAccountControl:1.2.840.113556.1.4.803:=524288))" --attributes samaccountname,dnshostname

To identify all computers and users configured for constrained delegation:

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(&(objectCategory=computer)(msds-allowedtodelegateto=*))" --attributes dnshostname,samaccountname,msds-allowedtodelegateto --json

To see trust attributes beteween our current domain and a target domain:

execute-assembly C:\Tools\ADSearch\ADSearch\bin\Release\ADSearch.exe --search "(objectCategory=trustedDomain)" --domain {target domain} --attributes distinguishedName,name,flatName,trustDirection

- Wadcoms (command checklist)

- Active Network Connections and Port Monitoring

List currently established connection:

netstat –an | netstat –a

- Network interface and routing table

To gather information about the networking interface (we may find a VPN tunnel already established to a sensitive network):

ipconfig /all

netsh interface ip show addresses

To discover other networks by printing the routing table:

route print

- ARP Cache

To list ARP Cache and potentially discover new hosts:

arp -a

- DNS Enumeration

To query the current DNS Domain:

echo %userdnsdomain%

Write-Output $env:userdnsdomain

Discover server’s range. Nslookup on the domain will return DCs:

nslookup DOMAIN

Rreturn all the DCs:

nslookup %USERDOMAIN%

To query all hosts within a subnt, firs. get all IP addresses using ipconfig or netsh:

ipconfig /all

netsh interface ip show addresses

Then, perform nslookup for the range 1 to 255:

1..255 | ForEach-Object { nslookup "192.168.4.$_" }

- Computer Enumeration via net

net group "Domain Computers" /domain | Tee-Object domain-computers.txt

Then, in bash:

iconv -f UTF-16LE -t UTF-8 domain-computers.txt > domain-computers_utf8.txt

tr -s ' \t\r\n' '\n' < domain-computers_utf8.txt | grep -v '^\s*$' | sort | uniq > domain-computers-ordered.txt

sed 's/\$$//' domain-computers-ordered.txt > domain-computers-ordered-no-dollar.txt

Then, to get their IPs:

Get-Content .\domain-computers-ordered-no-dollar.txt | ForEach-Object { [PSCustomObject]@{ ComputerName = $_; IPAddress = ([System.Net.Dns]::GetHostAddresses($_) | Where-Object { $_.AddressFamily -eq "InterNetwork" }).IPAddressToString } } | Tee-Object computers-ips.txt

or

Get-Content .\domain-computers-ordered-no-dollar.txt | ForEach-Object { $ip="Timeout"; try { $ip = ([System.Net.Dns]::GetHostAddresses($_) | Where-Object { $_.AddressFamily -eq "InterNetwork" } | Select-Object -First 1).IPAddressToString } catch { $ip = "Unresponsive" } ; [PSCustomObject]@{ComputerName=$_; IPAddress=$ip} } | Tee-Object computers-ips.txt

or

Get-Content .\domain-computers-ordered-no-dollar.txt | ForEach-Object { $ip="Timeout"; try { $ip = ([System.Net.Dns]::GetHostAddresses($_) | Where-Object { $_.AddressFamily -eq "InterNetwork" } | Select-Object -First 1).IPAddressToString } catch { $ip = "Unresponsive" } ; [PSCustomObject]@{ComputerName=$_; IPAddress=$ip} } | Export-Csv -Path computers-ips.csv -NoTypeInformation

or

./GetIPs.ps1:

# Load the list of computer names
$computerList = Get-Content .\domain-computers-ordered-no-dollar.txt
$totalComputers = $computerList.Count
$currentCount = 0

# Process each computer and track progress
$computerList | ForEach-Object {
    $ComputerName = $_
    $currentCount++

    # Display progress
    Write-Progress -Activity "Resolving IP Addresses" `
                   -Status "Processing $ComputerName" `
                   -PercentComplete (($currentCount / $totalComputers) * 100)

    $job = Start-Job -ScriptBlock {
        param($CompName)
        try {
            $IP = ([System.Net.Dns]::GetHostAddresses($CompName) | Where-Object { $_.AddressFamily -eq "InterNetwork" }).IPAddressToString
            if (-not $IP) { throw "No IPv4 address found" }
            return $IP
        } catch {
            return $null
        }
    } -ArgumentList $ComputerName

    $timeoutSeconds = 5
    Wait-Job $job -Timeout $timeoutSeconds | Out-Null
    $ipAddress = Receive-Job -Job $job
    Remove-Job -Job $job

    if ($ipAddress -eq $null) {
        $ipAddress = "Unresponsive"
    }

    # Save each result immediately
    [PSCustomObject]@{
        ComputerName = $ComputerName
        IPAddress = $ipAddress
    } | Export-Csv -Path .\computers-ips.csv -Append -NoTypeInformation -Force
}

# Optional: Confirm completion
Write-Output "IP resolution completed and saved to computers-ips.csv."

- DC Enumeration via nltest and net

To enumerate all Domain Controllers (DCs) within the domain, including Read-Only Domain Controllers (RODC) and the Primary Domain Controller (PDC), which may reside in more critical subnets, use the following command. This query is performed through RPC (Remote Procedure Call) via the NetLogon service:

nltest.exe /dclist:<EXAMPLE.DOMAIN.COM>

nltest.exe /dsgetdc:<domain>

To query the Active Directory "Domain Controllers" group and list all domain controllers within the domain, use the following command:

net group /domain "Domain Controllers"

- DC Enumeration via nslookup

To enumerate the DCs via nslookup:

nslookup -type=SRV _ldap._tcp.dc._msdcs.<domain>

nslookup -type=SRV _kerberos._tcp.dc._msdcs.<domain>

nslookup -type=SRV _kerberos._udp.dc._msdcs.<domain>

- Printer Enumeration

To locate printers:

Get-WmiObject -class Win32_printer | ft name,location

wmi printer get name, location

- Browser Homepage and Bookmark Dump

- ADSearch ()

https://github.com/c3c/ADExplorerSnapshot.py
https://github.com/GhostPack/Seatbelt
https://github.com/tomcarver16/ADSearch
https://wadcoms.github.io/#
https://github.com/MrUn1k0d3r/RedTeamPowershellScripts/blob/master/scripts/GetBrowserHomepage.ps1 https://github.com/MrUn1k0d3r/RedTeamPowershellScripts/blob/master/scripts/GetIEBookmarks.ps1