Files
metasploit-gs/lib/rex/script/shell.rb
T
HD Moore a71e8d2af0 Fix up meterpreter script changes
git-svn-id: file:///home/svn/framework3/trunk@8611 4d416f70-5f16-0410-b530-b9f4589650da
2010-02-23 20:16:45 +00:00

45 lines
989 B
Ruby

module Rex
module Script
class Shell
attr_accessor :client, :framework, :path, :error, :args
attr_accessor :session
def initialize(client, path)
self.client = client
self.framework = client.framework
self.path = path
# Convenience aliases
self.session = self.client
end
def completed
raise Rex::Script::Completed
end
def run(*argset)
args = argset.join(" ")
self.args = args
begin
eval(::File.read(self.path, ::File.size(self.path)), binding )
rescue ::Interrupt
rescue ::Rex::Script::Completed
rescue ::Exception => e
self.error = e
raise e
end
end
def print(*args); client.user_output.print(*args); end
def print_status(*args); client.user_output.print_status(*args); end
def print_error(*args); client.user_output.print_error(*args); end
def print_good(*args); client.user_output.print_good(*args); end
def print_line(*args); client.user_output.print_line(*args); end
end
end
end