Nmap Development mailing list archives

Re: New patch for XML output


From: Fyodor <fyodor () insecure org>
Date: Sun, 13 Jan 2008 14:20:04 -0800

On Fri, Dec 14, 2007 at 10:28:39AM -0700, David Fifield wrote:

You're right, I didn't realize that this was a follow-up patch. I'm also
more ignorant of XML than I thought. It seems painful, because it will
create a bunch of long ugly lines in the XML output (that can't be cut
and pasted), but your solution seems like the right one. Escaping
whitespace characters is only required in attribute values, but then
almost everything in Nmap XML is stored in attributes anyway. I'll think
about it and leave some time for others to comment but I think I'll
commit the rest of your patch.

I talked with João today and I agree that this is the way to go.  I
integrated the rest of his patch so that \n\r\t are all escaped by
xml_convert() now.  One issue we need to deal with though is that the
os fingerprints in XML look like:

<osfingerprint 
fingerprint="SCAN(V=4.53%D=1/13%OT=22%CT=70%CU=%PV=N%G=N%TM=478A8C05%P=x86_64-unknown-linux-gnu)&#xa;SEQ(SP=C5%GCD=1%ISR=CD%TI=Z%II=I%TS=A)&#xa;OPS(O1=M5ACST11NW7%O2=M5ACST11NW7%O3=M5ACNNT11NW7%O4=M5ACST11NW7%O5=M5ACST11NW7%O6=M5ACST11)&#xa;WIN(W1=16A0%W2=16A0%W3=16A0%W4=16A0%W5=16A0%W6=16A0)&#xa;ECN(R=Y%DF=Y%TG=40%W=16D0%O=M5ACNNSNW7%CC=N%Q=)&#xa;T1(R=Y%DF=Y%TG=40%S=O%A=S+%F=AS%RD=0%Q=)&#xa;T2(R=N)&#xa;T3(R=Y%DF=Y%TG=40%W=16A0%S=O%A=S+%F=AS%O=M5ACST11NW7%RD=0%Q=)&#xa;T4(R=Y%DF=Y%TG=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)&#xa;T5(R=Y%DF=Y%TG=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)&#xa;T6(R=Y%DF=Y%TG=40%W=0%S=A%A=Z%F=R%O=%RD=0%Q=)&#xa;T7(R=Y%DF=Y%TG=40%W=0%S=Z%A=S+%F=AR%O=%RD=0%Q=)&#xa;U1(R=N)&#xa;IE(R=Y%DFI=N%TG=40%TOSI=Z%CD=S%SI=S%DLI=S)&#xa;"
 
/>

We should modify the submitter such that it accepts this monstrosity
(accepts &#xa; as a newline).

Cheers,
-F

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: