-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linqpad deserialization #19777
base: master
Are you sure you want to change the base?
Linqpad deserialization #19777
Conversation
) | ||
) | ||
register_options([ | ||
OptString.new('LINQPad_path', [true, "Path to LINQPad executable on target's machine", "C:\Users\ms\AppData\Local\LINQPad"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OptString.new('LINQPad_path', [true, "Path to LINQPad executable on target's machine", "C:\Users\ms\AppData\Local\LINQPad"]), | |
OptPath.new('LINQPad_PATH', [true, "Path to LINQPad executable on target's machine", "C:\Users\ms\AppData\Local\LINQPad"]), |
def check | ||
if datastore['LINQPad_path'].blank? || !file?(datastore['LINQPad_path']) | ||
return Exploit::CheckCode::Unknown('LINQPad binary not specified or doesn\'t exist') | ||
elsif datastore['Cache_path'].blank? || !directory?(datastore['Cache_path']) || !file?(datastore['cache_path'] + '/autorefcache46.1.dat') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elsif datastore['Cache_path'].blank? || !directory?(datastore['Cache_path']) || !file?(datastore['cache_path'] + '/autorefcache46.1.dat') | |
elsif datastore['CACHE_PATH'].blank? || !directory?(datastore['CACHE_PATH']) || !file?(datastore['CACHE_PATH'] + '/autorefcache46.1.dat') |
) | ||
register_options([ | ||
OptString.new('LINQPad_path', [true, "Path to LINQPad executable on target's machine", "C:\Users\ms\AppData\Local\LINQPad"]), | ||
OptString.new('Cache_path', [true, 'Path to cache file directory containing deserialized data']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OptString.new('Cache_path', [true, 'Path to cache file directory containing deserialized data']) | |
OptString.new('Cache_path', [true, 'Path to cache file directory containing deserialized data']), | |
OptBool.new('UNINSTALL', [true, 'Uninstall persistence', false]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or other way that is consistent/add action.....?
LINQPad 5.48 Deserialization
LINQPad is a scratchpad for .NET programming. Versions prior to 5.52 contain a deserialization vulnerability in processing cache file when program is starting. Application can be downloaded from here.
Verification Steps
Steps:
use windows/local/linqpad_deserialization
set payload cmd/windows/generic
- and corresponding parameterssession
,cache_path
,linqpad_path
Options
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.Example:
Previous example will run
calc.exe
when LINQPad will start.