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('.')
|
str_two = str_two[::-1].split('.')
|
||||||
|
|
||||||
for i in range(len(str_one)):
|
for i in range(len(str_one)):
|
||||||
sum_one += ((i+1) ** 10) * (int(str_one[i]))
|
try:
|
||||||
sum_two += ((i+1) ** 10) * (int(str_two[i]))
|
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:
|
if sum_one < sum_two:
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -67,7 +67,16 @@ class Scan_Engine:
|
||||||
with open('database/'+file+'.json') as data_file:
|
with open('database/'+file+'.json') as data_file:
|
||||||
data = json.load(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
|
# Basic infos
|
||||||
print warning("\t%s : %s - ID:%s" % (vuln['vuln_type'], vuln['title'] , vuln['id']) )
|
print warning("\t%s : %s - ID:%s" % (vuln['vuln_type'], vuln['title'] , vuln['id']) )
|
||||||
|
|
|
@ -27,7 +27,6 @@ class Wordpress:
|
||||||
self.enum_wordpress_users()
|
self.enum_wordpress_users()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
name : clean_url()
|
name : clean_url()
|
||||||
description : set the url to http(s)://example.com/
|
description : set the url to http(s)://example.com/
|
||||||
|
|
Loading…
Reference in New Issue