From e50d6387ca05c0c63425b797212adda6a406fdf5 Mon Sep 17 00:00:00 2001 From: Jake Miller Date: Thu, 15 Feb 2018 08:42:37 -0600 Subject: [PATCH] Add files via upload --- nmap_xml_parser.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nmap_xml_parser.py b/nmap_xml_parser.py index 0332ce5..49650b4 100644 --- a/nmap_xml_parser.py +++ b/nmap_xml_parser.py @@ -219,7 +219,12 @@ def print_filtered_port(data, filtered_port): filtered_port. If it matches, print the IP address """ for item in data: - port = item[4] + try: + port = item[4] + except IndexError as e: + if args.debug: + print(e) + continue if port == filtered_port: print(item[0]) @@ -277,4 +282,4 @@ if __name__ == '__main__': exit() csv_name = args.csv - main() + main() \ No newline at end of file