home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 05_common.mo / usr / share / nmap / nmap.dtd < prev    next >
Encoding:
Text File  |  2005-03-09  |  7.9 KB  |  254 lines

  1. <!-- 
  2.      nmap.dtd
  3.      This is the DTD for nmap's XML output (-oX) format.
  4.      $Id: nmap.dtd,v 1.9 2004/12/12 00:46:19 fyodor Exp $
  5.  
  6.      Originally written by:
  7.      William McVey <wam@cisco.com> <wam+nmap@wamber.net>
  8.  
  9.      Now maintained by Fyodor <fyodor@insecure.org> as part of Nmap.     
  10.  
  11.      To validate using this file, simply add a DOCTYPE line similar to:
  12.      <!DOCTYPE nmaprun SYSTEM "nmap.dtd">
  13.      to the nmap output immediately below the prologue (the first line).  This
  14.      should allow you to run a validating parser against the output (so long
  15.      as the dtd is in your parser's dtd search path).
  16.  
  17.      Bugs:
  18.      Most of the elements are "locked" into the specific order that nmap
  19.      generates, when there really is no need for a specific ordering.
  20.      This is primarily because I don't know the xml DTD construct to
  21.      specify "one each of this list of elements, in any order".  If there
  22.      is a construct similar to SGML's '&' operator, please let me know.
  23.  
  24.      Since the work to write this DTD was done as part of WAM's
  25.      job duties for the Cisco Secure Consulting Services group
  26.      (http://www.cisco.com/go/securityconsulting), the following copyright 
  27.      needs to be included in this and any other derived works.
  28.  
  29. #   Copyright (c) 2001 by Cisco systems, Inc.
  30. #   Permission to use, copy, modify, and distribute modified and
  31. #   unmodified copies of this software for any purpose and without fee is
  32. #   hereby granted, provided that (a) this copyright and permission notice
  33. #   appear on all copies of the software and supporting documentation, (b)
  34. #   the name of Cisco Systems, Inc. not be used in advertising or
  35. #   publicity pertaining to distribution of the program without specific
  36. #   prior permission, and (c) notice be given in supporting documentation
  37. #   that use, modification, copying and distribution is by permission of
  38. #   Cisco Systems, Inc.
  39. #
  40. #   Cisco Systems, Inc. makes no representations about the suitability
  41. #   of this software for any purpose.  THIS SOFTWARE IS PROVIDED ``AS
  42. #   IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
  43. #   WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  44. #   FITNESS FOR A PARTICULAR PURPOSE.
  45. #
  46.  
  47. -->
  48.  
  49. <!-- parameter entities to specify common "types" used elsewhere in the DTD -->
  50. <!ENTITY % attr_numeric "CDATA" >
  51. <!ENTITY % attr_ipaddr "CDATA" >
  52. <!ENTITY % attr_numeric "CDATA" >
  53. <!ENTITY % attr_type "(ipv4 | ipv6 | mac)" >
  54.  
  55. <!ENTITY % host_states "(up|down|unknown|skipped)" >
  56.  
  57. <!-- see: nmap.c:statenum2str for list of port states -->
  58. <!-- Maybe they should be enumerated as in scan_types below , but I -->
  59. <!-- don't know how to escape states like open|filtered -->
  60. <!ENTITY % port_states "CDATA" >
  61.  
  62. <!ENTITY % hostname_types "(PTR)" >
  63.  
  64. <!-- see output.c:output_xml_scaninfo_records for scan types -->
  65. <!ENTITY % scan_types "(syn|ack|bounce|connect|null|xmas|window|maimon|fin|udp|ipproto)" >
  66.  
  67. <!-- <!ENTITY % ip_versions "(ipv4)" > -->
  68.  
  69. <!ENTITY % port_protocols "(ip|tcp|udp)" >
  70.  
  71. <!-- I don't know exactly what these are, but the values were enumerated via:
  72.      grep "conf=" *
  73. --> 
  74. <!ENTITY % service_confs  "( 3 | 5 | 10)" >
  75.  
  76. <!-- This element was started in nmap.c:nmap_main().
  77.      It represents to the topmost element of the output document.
  78. -->
  79. <!ELEMENT nmaprun      (scaninfo?, verbose, debugging, host*, runstats?) >
  80. <!ATTLIST nmaprun
  81.             scanner        (nmap)        #REQUIRED
  82.             args        CDATA        #IMPLIED
  83.             start        %attr_numeric;    #IMPLIED
  84.             startstr    CDATA            #IMPLIED
  85.             version        CDATA        #REQUIRED
  86.             xmloutputversion (1.01)        #REQUIRED
  87. >
  88.  
  89. <!-- this element is written in output.c:doscaninfo() -->
  90. <!ELEMENT scaninfo    EMPTY >
  91. <!ATTLIST scaninfo
  92.             type        %scan_types;    #REQUIRED
  93.             protocol    %port_protocols; #REQUIRED
  94.             numservices    %attr_numeric;    #REQUIRED
  95.             services    CDATA        #REQUIRED
  96. >
  97.  
  98. <!-- these elements are written in nmap.c:nmap_main() -->
  99. <!ELEMENT verbose    EMPTY >
  100. <!ATTLIST verbose    level        %attr_numeric;    #IMPLIED >
  101.  
  102.  
  103. <!ELEMENT debugging     EMPTY >
  104. <!ATTLIST debugging    level        %attr_numeric;    #IMPLIED >
  105.  
  106. <!-- 
  107.      this element is started in nmap.c:nmap_main() and filled by
  108.      output.c:write_host_status(), output.c:printportoutput(), and
  109.      output.c:printosscanoutput()
  110. -->
  111. <!ELEMENT host        ( status, address , (address | hostnames |
  112.                           smurf | ports | addport | os | uptime | 
  113.                           tcpsequence | ipidsequence | tcptssequence )* ) >
  114.  
  115.  
  116. <!-- these elements are written by output.c:write_xml_initial_hostinfo() -->
  117. <!ELEMENT status    EMPTY >
  118. <!ATTLIST status    state        %host_states;    #REQUIRED >
  119.  
  120. <!ELEMENT address    EMPTY >
  121. <!ATTLIST address    
  122.             addr        %attr_ipaddr;    #REQUIRED
  123.             addrtype    %attr_type;    "ipv4"
  124.             vendor        CDATA        #IMPLIED
  125. >
  126.  
  127. <!ELEMENT hostnames    (hostname)* >
  128. <!ELEMENT hostname    EMPTY >
  129. <!ATTLIST hostname
  130.             name        CDATA        #IMPLIED
  131.             type        %hostname_types; #IMPLIED
  132. >
  133.  
  134.  
  135. <!-- this element is written by output.c:write_host_status() -->
  136. <!ELEMENT smurf        EMPTY >
  137. <!ATTLIST smurf        responses    %attr_numeric;    #REQUIRED >
  138.  
  139. <!-- this element is written by portlist.cc:addport() -->
  140. <!ELEMENT addport         EMPTY >
  141. <!ATTLIST addport         
  142.                         state           %port_states;    #REQUIRED
  143.                         owner           CDATA            #IMPLIED
  144.                         portid          %attr_numeric;   #REQUIRED
  145.                         protocol        %port_protocols; #REQUIRED
  146. >
  147.  
  148.  
  149. <!-- these elements are written by output.c:printportoutput() -->
  150.  
  151. <!ELEMENT ports        (extraports? , port*) >
  152.  
  153. <!ELEMENT extraports    EMPTY >
  154. <!ATTLIST extraports
  155.             state        %port_states;    #REQUIRED
  156.             count        %attr_numeric;    "closed"
  157. >
  158.  
  159. <!ELEMENT port        (state , owner? , service? ) >
  160. <!ATTLIST port
  161.             protocol    %port_protocols;    #REQUIRED
  162.             portid        %attr_numeric;    #REQUIRED
  163. >
  164.  
  165. <!ELEMENT state        EMPTY >
  166. <!ATTLIST state        state        %port_states;    #REQUIRED >
  167.  
  168. <!ELEMENT owner        EMPTY >
  169. <!ATTLIST owner        name        CDATA        #REQUIRED >
  170.  
  171. <!ELEMENT service    EMPTY >
  172. <!ATTLIST service
  173.             name        CDATA        #REQUIRED
  174.             conf        %service_confs;    #REQUIRED
  175.                         method          (table|detection|probed) #REQUIRED
  176.                         version         CDATA           #IMPLIED
  177.                         product         CDATA           #IMPLIED
  178.                         extrainfo       CDATA           #IMPLIED
  179.             proto        (rpc)        #IMPLIED
  180.             rpcnum        %attr_numeric;    #IMPLIED
  181.             lowver        %attr_numeric;    #IMPLIED
  182.             highver        %attr_numeric;    #IMPLIED
  183. >
  184.  
  185.  
  186. <!-- these elements are written by output.c: printosscanoutput() -->
  187.  
  188. <!ELEMENT os        ( portused* , osclass*, osmatch* ) >
  189.  
  190. <!ELEMENT portused    EMPTY >
  191. <!ATTLIST portused
  192.             state         %port_states;    #REQUIRED
  193.             proto         %port_protocols; #REQUIRED
  194.             portid         %attr_numeric;    #REQUIRED
  195. >
  196. <!ELEMENT osclass      EMPTY >
  197. <!ATTLIST osclass
  198.                        vendor          CDATA           #REQUIRED
  199.                        osgen           CDATA           #IMPLIED
  200.                        type            CDATA           #IMPLIED
  201.                        accuracy        CDATA           #REQUIRED
  202.                        osfamily        CDATA           #REQUIRED
  203. >
  204.  
  205.  
  206. <!ELEMENT osmatch    EMPTY >
  207. <!ATTLIST osmatch
  208.             name        CDATA        #REQUIRED
  209.             accuracy    %attr_numeric;    #REQUIRED
  210. >
  211.  
  212. <!ELEMENT uptime    EMPTY >
  213. <!ATTLIST uptime
  214.             seconds        %attr_numeric;    #REQUIRED
  215.             lastboot    CDATA        #IMPLIED
  216. >
  217.  
  218. <!ELEMENT tcpsequence    EMPTY >
  219. <!ATTLIST tcpsequence
  220.             index        %attr_numeric;    #REQUIRED
  221.             class        CDATA        #REQUIRED
  222.             difficulty    CDATA        #REQUIRED
  223.             values        CDATA        #REQUIRED
  224. >
  225.  
  226. <!ELEMENT ipidsequence    EMPTY >
  227. <!ATTLIST ipidsequence
  228.             class        CDATA        #REQUIRED
  229.             values        CDATA        #REQUIRED
  230. >
  231.  
  232. <!ELEMENT tcptssequence    EMPTY >
  233. <!ATTLIST tcptssequence
  234.             class        CDATA        #REQUIRED
  235.             values        CDATA        #IMPLIED
  236. >
  237.  
  238. <!-- these elements are generated in output.c:printfinaloutput() -->
  239. <!ELEMENT runstats    (finished, hosts) >
  240.  
  241. <!ELEMENT finished    EMPTY >
  242. <!ATTLIST finished    time        %attr_numeric;    #REQUIRED 
  243.                         timestr        CDATA            #IMPLIED
  244. >
  245.  
  246. <!ELEMENT hosts        EMPTY >
  247. <!ATTLIST hosts
  248.             up        %attr_numeric;    "0"
  249.             down        %attr_numeric;    "0"
  250.             skipped        %attr_numeric;    "0"
  251.             total        %attr_numeric;    #REQUIRED
  252. >
  253.