Summery
SharpLansweeperDecrypt is designed to automatically extract and decrypt all configured scanning credentials of a Lansweeper instance, provided there is local access to the server.
You can run it eaither with the .exe file which you need to compiler, but is more flexible, or .ps1 which performs the exploitation fully by itself but can’t be configured - it just assumed the defults.
The tool perfroms this actions when run automatically:
- Automatically identifies and decrypts the database connection strings contained within Lansweeper’s
web.configfile. - Utilizes the decrypted connection strings to query the Lansweeper SQL database, retrieving all configured
Scanning Credentials. - Locates the
Encryption.txtfile on the disk, which Lansweeper uses for credential encryption. - Applies the encryption key to decrypt and display the scanning credentials.
Commands
Import-Modole LansweeperDecrypt.ps1 - Run the PowerShell version automatically
.\SharpLansweeperDecrypt.exe - Run the .exe version automatically
For a manual exploitation with the .exe, you can configure these flags:
-p - Optional path to the encryption key. If not provided, a default path is used
-e - Decrypts the provided encrypted password without decrypting web.config or connecting to the SQL database
Compilation
I haven’t done that myself, but here are the steps to do that with Visual Studio:
- Manage NuGet packages for your project and add
System.Configuration.ConfigurationManageras it’s required by the tool to work properly. - Build it as an
.exeexecutable.
References
Used in Sweep
Related notes: Lansweeper