Class: Hijack::Console

Inherits:
Object
  • Object
show all
Defined in:
lib/hijack/console.rb

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ Console

Returns a new instance of Console.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/hijack/console.rb', line 3

def initialize(pid)
  @pid = pid
  @remote = nil
  check_pid
  str = "=> Hijacking..."
  $stdout.write(str)
  $stdout.flush
  Payload.inject(@pid)
  connect
  check_remote_ruby_version
  $stdout.write("\b" * str.size)
  $stdout.flush
  mirror_process
  banner
  execute_file
  setup_at_exit
  OutputReceiver.start(@remote) unless Hijack.options[:mute]
  start_irb      
end