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