Skip to content
This repository has been archived by the owner on Nov 7, 2021. It is now read-only.

Commit

Permalink
Database dump complete for httpd and nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
gideontong committed Feb 29, 2020
1 parent ee0087b commit 9c2b0d0
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 0 deletions.
56 changes: 56 additions & 0 deletions server/download.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import requests, json, re
from datetime import datetime

targetFile = open('targets.json')
targetData = json.load(targetFile)

endpoint = "https://access.redhat.com/hydra/rest/securitydata/cve.json"
cveUri = "https://access.redhat.com/hydra/rest/securitydata/cve/"

payload = {}
headers = {}

for target in targetData:
url = endpoint + "?" + "package=" + target
responseData = requests.request("GET", url, headers=headers, data = payload)
response = json.loads(responseData.text)
with open('target_' + target + '.json', 'w') as outfile:
json.dump(response, outfile)
cveData = {}
size = len(response)
i = 0
for CVE in response:
i += 1
if CVE['severity'] == 'low':
continue
cveEndpoint = cveUri + CVE['CVE'] + ".json"
cveResponseData = requests.request("GET", cveEndpoint, headers=headers, data = payload)
cveResponse = json.loads(cveResponseData.text)
# print(cveResponse)
print("[", datetime.now(), "]", i, "/", size, CVE['CVE'])
if 'affected_release' not in cveResponse:
continue
try:
for release in cveResponse['affected_release']:
if target not in release['package']:
continue
versionMatch = re.search('[0-9]*\.[0-9]*', release['package'])
# print(versionMatch)
# print(release)
# print(release['package'])
version = versionMatch.group()
# print(version)
if version not in cveData:
cveData[version] = []
if CVE['CVE'] not in cveData[version]:
# print(cveData[version])
major = ""
for detail in cveResponse['details']:
major += " " + detail
cveData[version].append(CVE['CVE'])
except:
pass
with open('target_' + target + '_cve_backup.txt', 'w') as outfile:
outfile.write(str(cveData))
with open('target_' + target + '_cve.json', 'w') as outfile:
json.dump(cveData, outfile)
1 change: 1 addition & 0 deletions server/target_httpd.json

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions server/target_httpd_cve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"2.4": [
"CVE-2019-10097",
"CVE-2019-0215",
"CVE-2017-7659",
"CVE-2017-7668",
"CVE-2016-5387",
"CVE-2016-4979",
"CVE-2016-1546",
"CVE-2015-3183",
"CVE-2014-0231",
"CVE-2014-0117",
"CVE-2014-0118",
"CVE-2014-0226",
"CVE-2013-4352"
],
"7.61": [
"CVE-2018-1000301",
"CVE-2017-8816",
"CVE-2017-8817",
"CVE-2016-8620",
"CVE-2016-5421"
],
"0.13": [
"CVE-2019-3878"
],
"2.2": [
"CVE-2017-12171",
"CVE-2016-5387",
"CVE-2015-3183",
"CVE-2014-0231",
"CVE-2014-0118",
"CVE-2014-0226",
"CVE-2013-6438",
"CVE-2013-1896",
"CVE-2012-3499",
"CVE-2012-4558",
"CVE-2012-0053",
"CVE-2011-4317",
"CVE-2011-3639",
"CVE-2011-3368",
"CVE-2011-3348",
"CVE-2011-3192",
"CVE-2010-1623",
"CVE-2010-2791",
"CVE-2010-0408",
"CVE-2009-3555",
"CVE-2009-2412",
"CVE-2009-1890",
"CVE-2009-0023",
"CVE-2009-1955",
"CVE-2009-1191",
"CVE-2008-1678"
],
"2.0": [
"CVE-2011-3368",
"CVE-2011-3192",
"CVE-2005-2088",
"CVE-2004-0942",
"CVE-2004-0786",
"CVE-2004-0748",
"CVE-2005-2728",
"CVE-2004-0493",
"CVE-2004-1834",
"CVE-2004-0113"
]
}
1 change: 1 addition & 0 deletions server/target_httpd_cve_backup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{'2.4': ['CVE-2019-10097', 'CVE-2019-0215', 'CVE-2017-7659', 'CVE-2017-7668', 'CVE-2016-5387', 'CVE-2016-4979', 'CVE-2016-1546', 'CVE-2015-3183', 'CVE-2014-0231', 'CVE-2014-0117', 'CVE-2014-0118', 'CVE-2014-0226', 'CVE-2013-4352'], '7.61': ['CVE-2018-1000301', 'CVE-2017-8816', 'CVE-2017-8817', 'CVE-2016-8620', 'CVE-2016-5421'], '0.13': ['CVE-2019-3878'], '2.2': ['CVE-2017-12171', 'CVE-2016-5387', 'CVE-2015-3183', 'CVE-2014-0231', 'CVE-2014-0118', 'CVE-2014-0226', 'CVE-2013-6438', 'CVE-2013-1896', 'CVE-2012-3499', 'CVE-2012-4558', 'CVE-2012-0053', 'CVE-2011-4317', 'CVE-2011-3639', 'CVE-2011-3368', 'CVE-2011-3348', 'CVE-2011-3192', 'CVE-2010-1623', 'CVE-2010-2791', 'CVE-2010-0408', 'CVE-2009-3555', 'CVE-2009-2412', 'CVE-2009-1890', 'CVE-2009-0023', 'CVE-2009-1955', 'CVE-2009-1191', 'CVE-2008-1678'], '2.0': ['CVE-2011-3368', 'CVE-2011-3192', 'CVE-2005-2088', 'CVE-2004-0942', 'CVE-2004-0786', 'CVE-2004-0748', 'CVE-2005-2728', 'CVE-2004-0493', 'CVE-2004-1834', 'CVE-2004-0113']}
1 change: 1 addition & 0 deletions server/target_nginx.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions server/target_nginx_cve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"1.8": ["CVE-2018-16845", "CVE-2016-4450", "CVE-2016-0742", "CVE-2016-0746", "CVE-2016-0747"], "1.10": ["CVE-2018-16845", "CVE-2018-16843"], "1.12": ["CVE-2018-16845", "CVE-2018-16844", "CVE-2018-16843"], "1.14": ["CVE-2018-16845", "CVE-2018-16844", "CVE-2018-16843"]}
1 change: 1 addition & 0 deletions server/target_nginx_cve_backup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{'1.8': ['CVE-2018-16845', 'CVE-2016-4450', 'CVE-2016-0742', 'CVE-2016-0746', 'CVE-2016-0747'], '1.10': ['CVE-2018-16845', 'CVE-2018-16843'], '1.12': ['CVE-2018-16845', 'CVE-2018-16844', 'CVE-2018-16843'], '1.14': ['CVE-2018-16845', 'CVE-2018-16844', 'CVE-2018-16843']}
4 changes: 4 additions & 0 deletions server/targets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"httpd",
"nginx"
]
11 changes: 11 additions & 0 deletions src/drivers/webextension/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ function updateThemeMode(res) {
document.body.classList.add('theme-mode-sync');
}
}

function displayApps(response) {
pinnedCategory = response.pinnedCategory; // eslint-disable-line prefer-destructuring
termsAccepted = response.termsAccepted; // eslint-disable-line prefer-destructuring
Expand Down Expand Up @@ -254,11 +255,21 @@ function displayApps(response) {
}
}

function getCVEs(name, version = "0.0") {

return;
}

port.onMessage.addListener((message) => {
switch (message.id) {
case 'get_apps':
// console.log(message.response.tabCache.detected);
for (var a in message.response.tabCache.detected) {
const name = message.response.tabCache.detected[a].name;
var version = message.response.tabCache.detected[a].version;
if (version.length == 0) {
// do something
}
console.log(message.response.tabCache.detected[a].name + " " + message.response.tabCache.detected[a].version);
}
displayApps(message.response);
Expand Down

0 comments on commit 9c2b0d0

Please sign in to comment.