32 |
|
|
33 |
my $count = 0; |
my $count = 0; |
34 |
|
|
35 |
|
my $port_name = { |
36 |
|
16992 => 'amt', |
37 |
|
4445 => 'asterisk', |
38 |
|
7777 => 'pxelator', |
39 |
|
}; |
40 |
|
|
41 |
while ( my $host = shift @{ $nmap->{host} } ) { |
while ( my $host = shift @{ $nmap->{host} } ) { |
42 |
|
|
43 |
warn '# host ',dump( $host ); |
warn '# host ',dump( $host ); |
53 |
client::conf( $ip, 'os' => $os ); |
client::conf( $ip, 'os' => $os ); |
54 |
} |
} |
55 |
|
|
56 |
my @ports = map { [ $_->{portid}, $_->{protocol}, $_->{service}->{name} ] } @{ $host->{ports}->{port} }; |
my @ports = map { [ $_->{portid}, $_->{protocol}, $port_name->{$_->{portid}} || $_->{service}->{name} ] } @{ $host->{ports}->{port} }; |
57 |
client::conf( $ip, 'ports' => join("\n", map { join("\t", @$_) } @ports) ) if @ports; |
client::conf( $ip, 'ports' => join("\n", map { join("\t", @$_) } @ports) ) if @ports; |
58 |
|
|
59 |
$count++; |
$count++; |