From fdace0cfc1b907024923d7186290bd11bd143ee6 Mon Sep 17 00:00:00 2001 From: Johannes Helmold Date: Mon, 4 Mar 2024 14:54:15 +0100 Subject: [PATCH 1/2] Fix: Replaced python call - avoid problems with installations. The python call and the function urlencode was replaced by directly assining the manually encoded simple constant strings to the variables to avoid problems with different python installations. --- src/alert_methods/TippingPoint/alert | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/alert_methods/TippingPoint/alert b/src/alert_methods/TippingPoint/alert index fcde932d2..518cb9a32 100644 --- a/src/alert_methods/TippingPoint/alert +++ b/src/alert_methods/TippingPoint/alert @@ -25,12 +25,6 @@ CONVERT_SCRIPT=$4 AUTH_PATH=$5 REPORT_PATH=$6 -# Function to encode for URL -urlencode () { - RET=$(python -c "import urllib, sys; print urllib.quote(sys.argv[1])" "$1") - echo "$RET" -} - # Create temp file for converted report REPORT_DATE=$(xmlstarlet sel -t -v "report/timestamp" < $REPORT_PATH) EXIT_CODE=$? @@ -76,9 +70,9 @@ END_TIME=$(TZ=UTC date -d "$END_TIME" +%Y-%m-%dT%H:%M:%S.000Z) RUNTIME="$START_TIME/$END_TIME" # Upload the report -VENDOR=$(urlencode "Greenbone") -PRODUCT=$(urlencode "Greenbone Vulnerability Manager") -FORMAT_VERSION=$(urlencode "1.0.0") +VENDOR="Greenbone" +PRODUCT="Greenbone%20Vulnerability%20Manager" +FORMAT_VERSION="1.0.0" CN_REPLACEMENT="Tippingpoint" if [ "1" = $CERT_WORKAROUND ] From edf71072fec7b1023ac333329dcb129cc3af2510 Mon Sep 17 00:00:00 2001 From: Johannes Helmold Date: Mon, 4 Mar 2024 17:16:10 +0100 Subject: [PATCH 2/2] Small fix of an other bug. --- src/alert_methods/TippingPoint/report-convert.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/alert_methods/TippingPoint/report-convert.py b/src/alert_methods/TippingPoint/report-convert.py index cf4a49322..c2768ff9c 100755 --- a/src/alert_methods/TippingPoint/report-convert.py +++ b/src/alert_methods/TippingPoint/report-convert.py @@ -137,6 +137,10 @@ def convert (xml_tree, out_file): nvt_cve = ''; nvt_elem = result_elem.find ('nvt') nvt_refs = nvt_elem.find ('refs'); + + if (nvt_refs is None): + continue + for ref in nvt_refs.findall('ref'): if (ref.attrib['type'] == 'cve'): if (nvt_cve == ''):