diff --git a/data/msfweb/app/controllers/console_controller.rb b/data/msfweb/app/controllers/console_controller.rb index 9fd6c86378..55aa9a2f41 100644 --- a/data/msfweb/app/controllers/console_controller.rb +++ b/data/msfweb/app/controllers/console_controller.rb @@ -1,6 +1,7 @@ -# Author: LMH -# Description: The AJAX console controller of msfweb v.3. Handles commands, -# operations and sessions carried over the web interface. +# +# Author: Metasploit LLC +# Description: The AJAX console controller of msfweb +# class ConsoleController < ApplicationController # diff --git a/lib/msf/ui/web/driver.rb b/lib/msf/ui/web/driver.rb index 268f44d34c..e13947c371 100644 --- a/lib/msf/ui/web/driver.rb +++ b/lib/msf/ui/web/driver.rb @@ -30,10 +30,6 @@ class WebConsole attr_accessor :prompt attr_accessor :killed - def eof? - self.pipe_input.eof? - end - def intrinsic_shell? true end @@ -45,9 +41,40 @@ class WebConsole def _print_prompt end + + # + # Wrapper methods around input pipe + # + + + def close + self.pipe_input.close + end + + def put(*args) + self.pipe_input.put(*args) + end + + def gets + self.pipe_input.gets + end + def pgets self.pipe_input.gets end + + def eof? + self.pipe_input.eof? + end + + def fd(*args) + raise ::RuntimeError, "Session interaction should be performed via the Sessions tab" + self.pipe_input.fd(*args) + end + + def sysread(*args) + self.pipe_input.sysread(*args) + end end # @@ -58,16 +85,8 @@ class WebConsole def supports_color? false end - - def cmd_exploit(*args) - args.push('-z') - $stderr.puts "Weeeeeeeeeeee!" - super(*args) - end - end - def initialize(framework, console_id) # Configure the framework self.framework = framework