Cisco Cisco Firepower Management Center 2000 Entwickleranleitung

Seite von 102
 
2-45
FireSIGHT System Host Input API Guide
 
Chapter 2      Using the Host Input API
  Example Host Input API Scripts
'name' => 'Using NetBIOS to retrieve info from a Windows host',
'desc' => 'The following 2 NetBIOS names have been gathered ...',
} ];
my $rval = SF::SFDataCorrelator::HostInput::AddScanResult($params,
$mapping_vuln_list,$generic_item_list,$flag);
Example: Deleting a Scan Result from a Host
The script deletes a scan result from the network map. 
my ($scanner_id,$vuln_id,$mapping_vuln_id);
my $ip = '1.2.3.4';
$scanner_id = 'Scanner_ID';
$mapping_vuln_list = [
{
'cve_ids' => [ '2003-0988' ],
'vuln_id' => '10150A',
# 3rd party scanner vuln id
'port' => 107,
'proto' => 17,
'name' => 'Using NetBIOS to retrieve info from a Windows host',
'desc' => 'The following 2 NetBIOS names have been gathered ...',
},
{
'cve_ids' => [],
'bugtraq_ids' => [ 29506,29507,29508 ],
'vuln_id' => '10159B',
# 3rd party scanner vuln id
'port' => 109,
'proto' => 17,
'name' => 'Name 2',
'desc' => 'description 2',
},
];
my $rval = SF::SFDataCorrelator::HostInput::DeleteScanResult($params,
$mapping_vuln_list,$generic_item_list,$flag);
Full Example Script
The full script explained in the sections above looks like this: 
#!/usr/bin/perl
use FlyLoader;
use SF::SFDataCorrelator::HostInput;
# Set the Source Type
my $source_type_id = SF::SFDataCorrelator::HostInput::GetSourceTypeIDByName 
('Scanner');
# Set the Application ID
SF::SFDataCorrelator::HostInput::SetCurrentSource ($source_type_id,"CustomApp");
# Retrieve the Application ID you set
my $source_id =
SF::SFDataCorrelator::HostInput::GetCurrentSource();
# Add an IP host with a Primary MAC address
if ($retval = SF::SFDataCorrelator::HostInput::AddHost(
$source_type_id, $source_id, "1.2.3.4", "01:02:03:04:05:06" ))
{