Module: Ronin::Payloads::Mixins::BindShell

Includes:
PostEx
Included in:
Shellcode::BindShellPayload
Defined in:
lib/ronin/payloads/mixins/bind_shell.rb

Overview

Common params and methods for bind shell payloads.

Instance Attribute Summary

Attributes included from PostEx

#session

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PostEx

#perform_cleanup

Class Method Details

.included(payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Adds the host and port required options to the payload.

Parameters:



42
43
44
45
46
47
48
# File 'lib/ronin/payloads/mixins/bind_shell.rb', line 42

def self.included(payload)
  payload.param :host, String, default: '0.0.0.0',
                               desc:    'The host to connect to'

  payload.param :port, Integer, required: true,
                                desc:     'The port to listen on'
end

Instance Method Details

#hostString

The host param value.

Returns:

  • (String)


55
56
57
# File 'lib/ronin/payloads/mixins/bind_shell.rb', line 55

def host
  params[:host]
end

#perform_postlaunchObject

Connects to the remote bind shell on #host and #port, then performs additional post-launch steps.



72
73
74
75
76
77
78
# File 'lib/ronin/payloads/mixins/bind_shell.rb', line 72

def perform_postlaunch
  print_info "Connecting to #{host}:#{port} ..."
  @session = Ronin::PostEx::Sessions::BindShell.connect(host,port)
  print_info "Connected to #{host}:#{port}!"

  super
end

#portInteger

The port param value.

Returns:

  • (Integer)


64
65
66
# File 'lib/ronin/payloads/mixins/bind_shell.rb', line 64

def port
  params[:port]
end