예제 #1
0
 case "make_nessusrc":
     require_once _ABSPATH . '/lib/ScanMaker.php';
     if (!(include_once _ABSPATH . '/lib/pear/HTTP/Download.php')) {
         die("Could not find the PEAR HTTP/Download.php file");
     }
     $profile_id = import_var('profile_id');
     $_snm = new ScanMaker($profile_id);
     $_snm->scanner_set = $_snm->getAllPlugins();
     $settings = $_snm->getProfileSettings($profile_id);
     $_snm->merge_severities();
     $_snm->merge_families();
     $_snm->merge_plugin_profiles();
     $_snm->merge_plugins();
     $_snm->merge_all();
     // Make the nessusrc file that contains scanner settings
     $output = $_snm->get_nrc_file_data($_snm->scanner_set, $settings);
     $filename = "nessusrc";
     $format = "txt";
     $params = array('data' => $output, 'cache' => false, 'contenttype' => 'application/octet-stream', 'contentdisposition' => array(HTTP_DOWNLOAD_ATTACHMENT, "{$filename}.{$format}"));
     HTTP_DOWNLOAD::staticSend($params, false);
     break;
     break;
 case "make_machine_list":
     require_once _ABSPATH . '/lib/ScanMaker.php';
     if (!@(include_once _ABSPATH . '/lib/pear/HTTP/Download.php')) {
         die("Could not find the PEAR HTTP/Download.php file");
     }
     $profile_id = import_var('profile_id');
     $_snm = new ScanMaker($profile_id);
     // Make the machine list that specifies all the machines that need to be scanned
     $machine_list = $_snm->getMachines($profile_id);