mirror of
https://github.com/NetsecExplained/Nmap-XML-to-CSV.git
synced 2026-08-27 08:20:12 +03:00
Update nmap_xml_parser.py
This commit is contained in:
parent
694763aacc
commit
e0899c7327
@ -237,12 +237,14 @@ def main():
|
|||||||
print("\n[-] The file {} cannot be found or you do not have permission to open the file.".format(filename))
|
print("\n[-] The file {} cannot be found or you do not have permission to open the file.".format(filename))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Read the file and check for entities
|
if not args.skip_entity_check:
|
||||||
with open(filename) as fh:
|
# Read the file and check for entities
|
||||||
contents = fh.read()
|
with open(filename) as fh:
|
||||||
if '<!entity' in contents.lower():
|
contents = fh.read()
|
||||||
print("[-] Error! This program does not permit XML entities. Exiting!")
|
if '<!entity' in contents.lower():
|
||||||
continue
|
print("[-] Error! This program does not permit XML entities. Ignoring {}".format(filename))
|
||||||
|
print("[*] Use -s (--skip_entity_check) to ignore this check for XML entities.")
|
||||||
|
continue
|
||||||
data = parse_xml(filename)
|
data = parse_xml(filename)
|
||||||
if not data:
|
if not data:
|
||||||
print("[*] Zero hosts identitified as 'Up'. Exiting.")
|
print("[*] Zero hosts identitified as 'Up'. Exiting.")
|
||||||
@ -272,6 +274,9 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument("-d", "--debug",
|
parser.add_argument("-d", "--debug",
|
||||||
help="Display error information",
|
help="Display error information",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
|
parser.add_argument("-s", "--skip_entity_check",
|
||||||
|
help="Skip the check for XML entities",
|
||||||
|
action="store_true")
|
||||||
parser.add_argument("-p", "--print_all",
|
parser.add_argument("-p", "--print_all",
|
||||||
help="Display scan information to the screen",
|
help="Display scan information to the screen",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user