Read the response from handler() and skip skipping the socket if active
git-svn-id: file:///home/svn/framework3/trunk@6142 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
70feb8152c
commit
4678430946
|
@ -57,6 +57,7 @@ module Exploit::Remote::Dialup
|
|||
when 'Both' : Telephony::Modem::HARD | Telephony::Modem::SOFT
|
||||
else Telephony::Modem::NONE
|
||||
end
|
||||
|
||||
initstring = datastore['INITSTRING']
|
||||
dialprefix = datastore['DIALPREFIX']
|
||||
dialsuffix = datastore['DIALSUFFIX']
|
||||
|
@ -98,6 +99,7 @@ module Exploit::Remote::Dialup
|
|||
case result
|
||||
when /CONNECT/i:
|
||||
print_status("Carrier: #{result}" )
|
||||
self.modem = modem if global
|
||||
return modem
|
||||
else
|
||||
#print_error("No Carrier")
|
||||
|
@ -108,10 +110,26 @@ module Exploit::Remote::Dialup
|
|||
end
|
||||
|
||||
# Closes the modem connection
|
||||
def disconnect_dialup(modem)
|
||||
modem.hangup
|
||||
modem.close
|
||||
def disconnect_dialup(nmodem = self.modem)
|
||||
if(nmodem)
|
||||
nmodem.hangup
|
||||
nmodem.close
|
||||
end
|
||||
end
|
||||
|
||||
def handler(nmodem = self.modem)
|
||||
# If the handler claims the modem, then we don't want it to get closed
|
||||
# during cleanup
|
||||
if ((rv = super) == Handler::Claimed)
|
||||
if (nmodem == self.modem)
|
||||
self.modem = nil
|
||||
end
|
||||
end
|
||||
|
||||
return rv
|
||||
end
|
||||
|
||||
attr_accessor :modem
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue