From b6e141e1860c98bcab1f292c7005946b1fda99b0 Mon Sep 17 00:00:00 2001 From: matevzerzen <jst.matevz@gmail.com> Date: Thu, 29 Dec 2022 17:16:43 +0100 Subject: [PATCH] Added missing license headers --- install/base.sh | 1 + install/cleanup.sh | 2 +- install/cscan.sh | 1 + install/profiles/extended_generic.py | 22 ++++++++++++---------- install/w3af.sh | 2 +- install/wiser-wcs.sh | 2 +- install/zap.sh | 1 + wiser-wcs-reports/main.py | 6 ++---- wiser-wcs-reports/nmap.py | 5 ++--- wiser-wcs-reports/w3af.py | 5 ++--- wiser-wcs-reports/wiser.py | 7 +++---- wiser-wcs-reports/zap.py | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/install/base.sh b/install/base.sh index 11087b1..eac1801 100644 --- a/install/base.sh +++ b/install/base.sh @@ -1,4 +1,5 @@ #!/bin/bash +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/install/cleanup.sh b/install/cleanup.sh index e4d636a..6ebd946 100644 --- a/install/cleanup.sh +++ b/install/cleanup.sh @@ -1,6 +1,6 @@ #!/bin/bash +# SPDX-License-Identifier: Apache-2.0 set -e rm -r /tmp/* - diff --git a/install/cscan.sh b/install/cscan.sh index c8af58f..627f92e 100644 --- a/install/cscan.sh +++ b/install/cscan.sh @@ -1,4 +1,5 @@ #!/bin/bash +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/install/profiles/extended_generic.py b/install/profiles/extended_generic.py index 44425ab..f63c0d1 100644 --- a/install/profiles/extended_generic.py +++ b/install/profiles/extended_generic.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from urllib import urlencode import w3af.core.controllers.output_manager as om @@ -51,7 +53,7 @@ class extended_generic(AuthPlugin): #GET the login page http_response = self._uri_opener.GET(self.auth_url, grep=False, - cache=False) + cache=False) body = http_response.get_body() ht = etree.HTML(body) forms = ht.xpath('//form') @@ -79,11 +81,11 @@ class extended_generic(AuthPlugin): try: http_response = self._uri_opener.POST(self.auth_url, - data=data, - grep=False, - cache=False, - follow_redirects=True, - debugging_id=self._debugging_id) + data=data, + grep=False, + cache=False, + follow_redirects=True, + debugging_id=self._debugging_id) except Exception, e: msg = 'Failed to login to the application because of exception: %s' self._log_debug(msg % e) @@ -119,10 +121,10 @@ class extended_generic(AuthPlugin): try: http_response = self._uri_opener.GET(self.check_url, - grep=False, - cache=False, - follow_redirects=True, - debugging_id=self._debugging_id) + grep=False, + cache=False, + follow_redirects=True, + debugging_id=self._debugging_id) except Exception, e: msg = 'Failed to check if session is active because of exception: %s' self._log_debug(msg % e) diff --git a/install/w3af.sh b/install/w3af.sh index cf0fbcc..207bbf6 100644 --- a/install/w3af.sh +++ b/install/w3af.sh @@ -1,4 +1,5 @@ #!/bin/bash +# SPDX-License-Identifier: Apache-2.0 set -e @@ -39,4 +40,3 @@ patch /service/w3af/w3af/core/ui/api/utils/scans.py /tmp/w3af-scans.py.patch #additional profiles and plugins cp /tmp/extended_generic.py /service/w3af/w3af/plugins/auth/ cp /tmp/auth_scan.template /service/w3af/profiles/ - diff --git a/install/wiser-wcs.sh b/install/wiser-wcs.sh index 38e5129..55fa5ac 100644 --- a/install/wiser-wcs.sh +++ b/install/wiser-wcs.sh @@ -1,6 +1,6 @@ #!/bin/bash +# SPDX-License-Identifier: Apache-2.0 set -e pip3 install -r /service/wiser-wcs-reports/requirements.txt - diff --git a/install/zap.sh b/install/zap.sh index f8f4832..66c01ca 100644 --- a/install/zap.sh +++ b/install/zap.sh @@ -1,4 +1,5 @@ #!/bin/bash +# SPDX-License-Identifier: Apache-2.0 set -e diff --git a/wiser-wcs-reports/main.py b/wiser-wcs-reports/main.py index ad9698f..7fabbe4 100644 --- a/wiser-wcs-reports/main.py +++ b/wiser-wcs-reports/main.py @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: Apache-2.0 + from xmljson import badgerfish from xml.etree.ElementTree import fromstring from os import listdir @@ -8,14 +10,12 @@ import w3af import zap import nmap - class Options(object): """ Dummy class """ pass - def parse_config_file(filename): """ Parse the config file. @@ -27,7 +27,6 @@ def parse_config_file(filename): config.read(filename) return config - def reports_json(dir): """ Iterate through directory. @@ -43,7 +42,6 @@ def reports_json(dir): reports[f] = out return reports - def list_vulnerabilities(reports): """ List all vulnerabilities based on the reports given. diff --git a/wiser-wcs-reports/nmap.py b/wiser-wcs-reports/nmap.py index e3d97f3..612475b 100644 --- a/wiser-wcs-reports/nmap.py +++ b/wiser-wcs-reports/nmap.py @@ -1,15 +1,15 @@ +# SPDX-License-Identifier: Apache-2.0 + from wiser import WiserReport, WiserVulnerability from collections import OrderedDict import re - def _safe_get(ordered_dict, key): try: return ordered_dict[key] except KeyError: return "" - class WiserNmapVulnerability(WiserVulnerability): def __init__(self): @@ -43,7 +43,6 @@ class WiserNmapVulnerability(WiserVulnerability): vuln.target = address return vuln - class WiserNmapReport(WiserReport): def __init__(self, report): diff --git a/wiser-wcs-reports/w3af.py b/wiser-wcs-reports/w3af.py index dec7d1a..3070c52 100644 --- a/wiser-wcs-reports/w3af.py +++ b/wiser-wcs-reports/w3af.py @@ -1,9 +1,10 @@ +# SPDX-License-Identifier: Apache-2.0 + from wiser import WiserReport, WiserVulnerability import re from collections import OrderedDict from urllib.parse import urlparse - class WiserW3afVulnerability(WiserVulnerability): def __init__(self, alert): @@ -38,7 +39,6 @@ class WiserW3afVulnerability(WiserVulnerability): except: pass - def set_wiser_risk_level(self): if self.risk_level == "Information": self.w_risk_level = 25 @@ -49,7 +49,6 @@ class WiserW3afVulnerability(WiserVulnerability): if self.risk_level == "High": self.w_risk_level = 100 - class WiserW3afReport(WiserReport): def __init__(self, report): diff --git a/wiser-wcs-reports/wiser.py b/wiser-wcs-reports/wiser.py index 9562831..477c5ba 100644 --- a/wiser-wcs-reports/wiser.py +++ b/wiser-wcs-reports/wiser.py @@ -1,12 +1,12 @@ -import json +# SPDX-License-Identifier: Apache-2.0 +import json class IterMixin(object): def __iter__(self): for attr, value in self.__dict__.iteritems(): yield attr, value - class WiserVulnerability(IterMixin): """ Super class of WISER vulnerabilities. @@ -43,7 +43,6 @@ class WiserVulnerability(IterMixin): def __str__(self): return json.dumps(self.__dict__) - class WiserReport(IterMixin): report = list() @@ -58,4 +57,4 @@ class WiserReport(IterMixin): """ Gets the report from the parsed list of vulnerabilities. """ def get_report(self): - return self.report \ No newline at end of file + return self.report diff --git a/wiser-wcs-reports/zap.py b/wiser-wcs-reports/zap.py index f3e9418..add5040 100644 --- a/wiser-wcs-reports/zap.py +++ b/wiser-wcs-reports/zap.py @@ -1,8 +1,9 @@ +# SPDX-License-Identifier: Apache-2.0 + from wiser import WiserReport, WiserVulnerability import re from urllib.parse import urlparse - class WiserZapVulnerability(WiserVulnerability): def __init__(self, alert): @@ -54,7 +55,6 @@ class WiserZapVulnerability(WiserVulnerability): if self.risk_level == "High (High)": self.w_risk_level = 100 - class WiserZapReport(WiserReport): def __init__(self, report): -- GitLab