From 162636e60f15c868d7f962f0b7ac5995c92f5801 Mon Sep 17 00:00:00 2001 From: pemontto <939704+pemontto@users.noreply.github.com> Date: Thu, 2 May 2019 07:58:18 +0100 Subject: [PATCH] Fix newlines in MAC Address field output (#178) * fix newlines in all MAC Address field * remove newline * only cleanse if col exists --- vulnwhisp/vulnwhisp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vulnwhisp/vulnwhisp.py b/vulnwhisp/vulnwhisp.py index 5903630..0630724 100755 --- a/vulnwhisp/vulnwhisp.py +++ b/vulnwhisp/vulnwhisp.py @@ -440,15 +440,16 @@ class vulnWhispererNessus(vulnWhispererBase): self.logger.error('Could not download {} scan {}: {}'.format(self.CONFIG_SECTION, scan_id, str(e))) self.exit_code += 1 continue - + clean_csv = \ pd.read_csv(io.StringIO(file_req.decode('utf-8'))) if len(clean_csv) > 2: self.logger.info('Processing {}/{} for scan: {}'.format(scan_count, len(scan_list), scan_name.encode('utf8'))) - columns_to_cleanse = ['CVSS','CVE','Description','Synopsis','Solution','See Also','Plugin Output'] + columns_to_cleanse = ['CVSS','CVE','Description','Synopsis','Solution','See Also','Plugin Output', 'MAC Address'] for col in columns_to_cleanse: - clean_csv[col] = clean_csv[col].astype(str).apply(self.cleanser) + if col in clean_csv: + clean_csv[col] = clean_csv[col].astype(str).apply(self.cleanser) clean_csv.to_csv(relative_path_name, index=False) record_meta = (