-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Fix WinPEAS In-Memory Execution: Use Compatible .NET Execution Methods Instead of Injection into Notepad on Windows 10 x64 "#20434" #20439
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
base: master
Are you sure you want to change the base?
Conversation
Thank you for the PR! I understand this solution, but I think that it might not be the path we would prefer to take- we no longer support scripts (See @sinn3r's documentation here: https://docs.metasploit.com/docs/using-metasploit/advanced/meterpreter/how-to-get-started-with-writing-a-meterpreter-script.html) Instead, if the root cause for the failure to inject is that the CLR is not loaded and working in the receiving binary, I think the best temporary solution would be to find a way to identify .NET binaries passed to the Alternatively, a cooler, longer-term solution might be expanding the Meterpreter |
Hey, what the new change you expect?? could you brief me with an example code and test case scenario too, so that i can get an idea about it |
Hello @Wopseeion, as stated by @bwatters-r7, the best first easy solution is to prevent the execution of the framework side:
metasploit-framework/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/sys.rb Line 215 in 8ad35c0
or from meterpreter side: |
@Wopseeion any update on this? |
Description
This PR addresses the issue where running the Metasploit command exec -m winpeas.exe -d notepad.exe on Windows 10 x64 causes the error "The parameter is incorrect" or crashes the Meterpreter session.
Problem Summary:
Direct in-memory injection of WinPEAS, a .NET executable, into Notepad fails because Notepad is a native Win32 process that does not load the .NET Common Language Runtime (CLR). This mismatch leads to session instability or execution errors.
Proposed Solution:
Benefits:
Testing and Validation:
1)Verified successful in-memory execution of WinPEAS via execute_dotnet_assembly across Windows 10 x64 versions.
2)Confirmed fallback PowerShell method works as intended on targets lacking the post module.
3)Tested architecture checks ensure no cross-bitness mismatches causing crashes.