|
I'm having an difficulty with parsing next type of scan:
$np->parsescan('nmap', -sO, '-p1,6,17', $ip);
it return next xml answer in "port" section:
<ports>
<port protocol="ip" portid="1"><state state="open" reason="port-unreach" reason_ttl="64"/>
<service name="icmp" conf="8" method="table" /></port>
<port protocol="ip" portid="6"><state state="open" reason="proto-response" reason_ttl="64"/>
<service name="tcp" conf="8" method="table" /></port>
<port protocol="ip" portid="17"><state state="open" reason="port-unreach" reason_ttl="64"/>
<service name="udp" conf="8" method="table" /></port>
</ports>
We have only 2 Nmap::Parser::Host methods :
tcp_ports()
udp_ports()
But in my case protocol have name "ip". In short I add some tcp_ports() like subs and strings to Nmap::Parser :
Near #Parsing regular port information
my $ip_port_count = 0;
and below
$ip_port_count++ if ($proto eq 'ip');
and even more below
$port_hashref->{ip_port_count} = $ip_port_count;
And I add some subs, like existing tcp_ports, tcp_port_count, tcp_port_state and tcp_service. I just change all "tcp" string to "ip" in that subs.
It work but I don't sure about it work correctly. Anybody can clear to me this question or add needed subs to source?
Thanks and sorry for my English ;)
|