Method: Msf::Sessions::Meterpreter#_interact

Defined in:
lib/msf/base/sessions/meterpreter.rb

#_interactObject

:category: Msf::Session::Interactive implementors

Interacts with the meterpreter client at a user interface level.

Raises:

  • (EOFError)

571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
# File 'lib/msf/base/sessions/meterpreter.rb', line 571

def _interact
  framework.events.on_session_interact(self)

  console.framework = framework
  if framework.datastore['MeterpreterPrompt']
    console.update_prompt(framework.datastore['MeterpreterPrompt'])
  end
  # Call the console interaction subsystem of the meterpreter client and
  # pass it a block that returns whether or not we should still be
  # interacting.  This will allow the shell to abort if interaction is
  # canceled.
  console.interact { self.interacting != true }
  console.framework = nil

  # If the stop flag has been set, then that means the user exited.  Raise
  # the EOFError so we can drop this handle like a bad habit.
  raise EOFError if (console.stopped? == true)
end