Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working with appended nmap results #1

Open
DuoMorph opened this issue Aug 13, 2019 · 6 comments
Open

not working with appended nmap results #1

DuoMorph opened this issue Aug 13, 2019 · 6 comments

Comments

@DuoMorph
Copy link

command one:

nmap -p 80,445,443,21,22 -T5 --min-parallelism 16 -n --min-hostgroup 16 -Pn --append-output -oA testnmapappend --open 192.168.0.0/28

command two:

nmap -p 80,445,443,21,22 -T5 --min-parallelism 16 -n --min-hostgroup 16 -Pn --append-output -oA testnmapappend --open 192.168.0.16/28

output nmap-parse-output with result file (testnmapappend.xml):

$ nmap-parse-output testnmapappend.xml hosts
-:82: parser error : XML declaration allowed only at the start of the document
<?xml version="1.0" encoding="UTF-8"?>
     ^
-:83: parser error : Extra content at the end of the document
<!DOCTYPE nmaprun>
^
unable to parse -
@SvenTo
Copy link
Contributor

SvenTo commented Aug 13, 2019

Yes, the problem is that Nmap does just append the second XML output to the first XML output which results in an invalid XML file. In this case, nmap-parse-output must split the file into multiple XML files before passing it to xsltproc. I will probably look into this with the next release.

Example output of --append-output:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE nmaprun>
<?xml-stylesheet href="file:///usr/bin/../share/nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 7.70 scan initiated Tue Aug 13 16:19:30 2019 as: nmap -sS -p0- -oA test -&#45;privileged localhost -->
<nmaprun scanner="nmap" args="nmap -sS -p0- -oA test -&#45;privileged localhost" start="1565705970" startstr="Tue Aug 13 16:19:30 2019" version="7.70" xmloutputversion="1.04">
[...]
</nmaprun>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE nmaprun>
<?xml-stylesheet href="file:///usr/bin/../share/nmap/nmap.xsl" type="text/xsl"?>
<!-- Nmap 7.70 scan initiated Tue Aug 13 16:20:04 2019 as: nmap -sS -p0- -oA test -&#45;privileged -&#45;append-output localhost -->
<nmaprun scanner="nmap" args="nmap -sS -p0- -oA test -&#45;privileged -&#45;append-output localhost" start="1565706004" startstr="Tue Aug 13 16:20:04 2019" version="7.70" xmloutputversion="1.04">
[...]
</nmaprun>

@royharoush
Copy link

any chance this can be resolved ?

@SvenTo
Copy link
Contributor

SvenTo commented Aug 28, 2020

Yes, I'm planning to add support with the next release. However, it is still work in progress because I'm working on multi file support, too.

@0xtavian
Copy link

@royharoush one solution is to not append to the xml and instead merge both xmls https://github.com/CBHue/nMap_Merger

@royharoush
Copy link

royharoush commented Dec 19, 2020 via email

@0xtavian
Copy link

@royharoush yea works like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants