2009-03-26 Evi Vanoost <vanooste@rcbi.rochester.edu>

* lib/PandoraFMS/Tools.pm: Added Apple to the detected OS'es
	
	* bin/pandora_recon: Added TCP scanning if ICMP fails to more accurately
	detect systems that are firewalled from pings.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1571 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
guruevi 2009-03-26 16:33:28 +00:00
parent 91315bf164
commit e64a1cac01
3 changed files with 31 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2009-03-26 Evi Vanoost <vanooste@rcbi.rochester.edu>
* lib/PandoraFMS/Tools.pm: Added Apple to the detected OS'es
* bin/pandora_recon: Added TCP scanning if ICMP fails to more accurately
detect systems that are firewalled from pings.
2009-03-05 Sancho Lerena <slerena@artica.es>
* bin/pandora_network: Better management of snmpget binary call, using

View File

@ -310,6 +310,8 @@ sub pandora_recon_exec_task {
my $id_parent = 0;
my $id_os = 0;
my $detected = 0;
# Asign target dir to netaddr object "space"
$space = new NetAddr::IP $target_network;
if (!defined($space)){
@ -329,8 +331,25 @@ sub pandora_recon_exec_task {
$add_host = 0;
# Is this IP listed for any agent ?
if (pandora_check_ip ($pa_config, $dbh, $target_ip) == 0){
# Check ICMP for this IP
$detected = 0;
# Check first for ICMP for this IP. Sometimes ICMP is blocked so check for other ports as well
if ( scan_icmp ($target_ip, $pa_config->{'networktimeout'}) == 1) {
$detected = 1;
} elsif ( scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 3389) == 1 || scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 5900) == 1) {
#Check for Remote Desktop & VNC (Desktop & Server machines)
$detected = 1;
} elsif ( scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 10000) == 1 || scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 161) == 1) {
#Check for management ports 10000 = Webmin, 161 = SNMP (Most embedded devices)
$detected = 1;
} elsif ( scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 22) == 1 || scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 25) == 1) {
#Check for SSH & Mail (Servers and Unix machines)
$detected = 1;
} elsif ( scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 80) == 1 || scan_tcp ($target_ip, $pa_config->{'networktimeout'}, 3306) == 1) {
#Check for WWW & MySQL (Webservers and systems in a DMZ)
$detected = 1;
}
if ($detected == 1){
$id_os = pandora_detect_os ($pa_config, $target_ip);
if ($task_id_os == -1){
$add_host = 1;

View File

@ -94,6 +94,9 @@ sub pandora_get_os ($) {
elsif ($command =~ m/HP-UX/i){
return 5;
}
elsif ($command =~ m/Apple/i){
return 8;
}
else {
return 10; # Unknown / Other
}
@ -301,7 +304,7 @@ sub sqlWrap {
my $toBeWrapped = shift(@_);
if (defined $toBeWrapped){
$toBeWrapped =~ s/\'/\\\'/g;
$toBeWrapped =~ s/\"/\\\'/g;
$toBeWrapped =~ s/\"/\\\'/g; # " This is for highlighters that don't understand escaped quotes
return "'".$toBeWrapped."'";
}
}