Path: blob/master/documentation/modules/exploit/windows/local/linqpad_deserialization_persistence.md
24441 views
Vulnerable Application
LINQPad is a scratchpad for .NET programming. Versions prior to 5.52.01 contain a deserialization vulnerability in processing cache file when program is starting. Application can be downloaded from here.
Verification Steps
Install the application
Start msfconsole
Get Meterpreter/cmd shell
Run:
use windows/local/linqpad_deserialization_persistenceSet payload - for example
set payload cmd/windows/generic- and corresponding parametersSet parameters
session,cache_path,linqpad_path,cleanupRun exploit
Options
cleanup
Enable cleanup of malicious file. The module will replace cache filewith malicious content. If cleanup is enabled, after successful execution, the module will remove malicious cache file. The original file will be restored upon re-execution of Linqpad.
cache_path
The parameter sets path for folder, where vulnerable cache file is present. This is crucial part of the exploit as the folder can be used to identify whether the current version is vulnerable and the payload delivery is performed through cache file.
linqpad_path
Final part of exploit runs the LINQPad to trigger deserialization procedure. The linpad_path parameter sets the path to LINQPad binary, which is ran at the end of exploit.
Scenarios
Previous example will run calc.exe when LINQPad will start.