Bugfix vulns for wp_version not in the list
parent
d8a08a163b
commit
7b50368282
|
@ -138,8 +138,11 @@ def is_lower(str_one, str_two):
|
|||
str_two = str_two[::-1].split('.')
|
||||
|
||||
for i in range(len(str_one)):
|
||||
sum_one += ((i+1) ** 10) * (int(str_one[i]))
|
||||
sum_two += ((i+1) ** 10) * (int(str_two[i]))
|
||||
try:
|
||||
sum_one += ((i+1) ** 10) * (int(str_one[i]))
|
||||
sum_two += ((i+1) ** 10) * (int(str_two[i]))
|
||||
except Exception as e:
|
||||
return True
|
||||
|
||||
if sum_one < sum_two:
|
||||
return True
|
||||
|
|
|
@ -67,7 +67,16 @@ class Scan_Engine:
|
|||
with open('database/'+file+'.json') as data_file:
|
||||
data = json.load(data_file)
|
||||
|
||||
for vuln in data[wordpress.version]["vulnerabilities"]:
|
||||
# Try to get a close result if the version is not in the list
|
||||
version = wordpress.version
|
||||
if data[wordpress.version]["vulnerabilities"] == []:
|
||||
versions = data.keys()
|
||||
for v in versions:
|
||||
if v[:4] in wordpress.version and is_lower(wordpress.version, v):
|
||||
version = v
|
||||
|
||||
# Best accurate result
|
||||
for vuln in data[version]["vulnerabilities"]:
|
||||
|
||||
# Basic infos
|
||||
print warning("\t%s : %s - ID:%s" % (vuln['vuln_type'], vuln['title'] , vuln['id']) )
|
||||
|
|
|
@ -27,7 +27,6 @@ class Wordpress:
|
|||
self.enum_wordpress_users()
|
||||
|
||||
|
||||
|
||||
"""
|
||||
name : clean_url()
|
||||
description : set the url to http(s)://example.com/
|
||||
|
|
Loading…
Reference in New Issue