Data360 Analyze

 View Only
  • 1.  Tabular XML file from nmap tool

    Posted 09-07-2021 15:50

    Hello, community.

    I need your help. After many hours of reading manual and testing i have decided to ask for a help. I have a XML file of from nmap port scanning tool which i need to transfer to table format. The field map is here: http://nmap.org/svn/docs/nmap.xsl

    The end result should be a table with a columns for address.addr with addrtype = ipv4, hostnames.hostname.name and then ports.port both protocol and portid.

    This seems to be a too complicated task for me. First issues is that address field repeats two times. I'm getting error there. I've ended up in renaming it manually to like address1 but that is not how it should normally work. Other issue is that i need to repeat address and hostnames columns for each row of ports.

    I would be supper happy if someone could take a look into attached file and give me a hand. Thanks a lot. 

     

    Attached files

    nmap.xml

     



  • 2.  RE: Tabular XML file from nmap tool

    Employee
    Posted 09-08-2021 03:35

    An example data flow is attached that converts the supplied XML data into tabular format, selects the required fields from the tabular data and then filters the records where the 'host.address.addrtype' field  contains the value "ip4".

     

     

    Attached files

    nmap_XML_to_Tabular_Data - 8 Sept 2021.lna

     



  • 3.  RE: Tabular XML file from nmap tool

    Posted 09-08-2021 13:19

    Hello, Adrian. Thanks for very fast response. The problem in your solution is that ipv4 row does not contain the required data and vice versa, the required port and hostname data does not contain ipv4 value in respective column.

    In the picture below i've opened the ml with excel. The red values are not there when you open the file. I've added manually red values to show that these lines (row 7-18) are applicable to the upper level ipv4 addr (row 5). But in XML, the data in columns addrtype and addr for rows 7-18 is not displayed. It is just the way how XML structure is built.

    I want the report to show me addr, name, portid. Basically filldown the values of row 5 col addrype addre down to row 7-18



  • 4.  RE: Tabular XML file from nmap tool

    Posted 09-08-2021 13:21

    Here is an example from Data360



  • 5.  RE: Tabular XML file from nmap tool

    Employee
    Posted 09-09-2021 02:22

    The values output in the original tabular data represent the contents of the XML tags. If you want to 'copy down' the values from one record and use them in a subsequent record if the fields are Null then you can use the logic in this updated data flow.

     

     

     

    Attached files

    nmap_XML_to_Tabular_Data_v2 - 9 Sept 2021.lna

     



  • 6.  RE: Tabular XML file from nmap tool

    Posted 10-02-2021 13:01

    Thanks, mate. It worked!!!