예제 #1
0
        if (file_exists(realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php')) {
            include_once realpath(dirname(__FILE__)) . '/../dao/' . $className . '.php';
        }
    } elseif (preg_match('/.*Manager$/', $className) > 0) {
        # Managers interfaces
        if (file_exists(realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php')) {
            include_once realpath(dirname(__FILE__)) . '/../managers/' . $className . '.php';
        }
    } elseif (preg_match('/.*Module$/', $className) > 0) {
        # Get the module name
        $moduleName = strtolower(preg_replace('/^(.*)Module$/', '\\1', $className));
        if (file_exists(realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php')) {
            include_once realpath(dirname(__FILE__)) . '/../../modules/' . $moduleName . '/' . $className . '.php';
        }
    } else {
        #  Models
        if (file_exists(realpath(dirname(__FILE__)) . '/../model/' . $className . '.php')) {
            include_once realpath(dirname(__FILE__)) . '/../model/' . $className . '.php';
        }
    }
    Utils::log(LOG_DEBUG, "Class {$className} loaded", __FILE__, __LINE__);
}
# Create the Pakiti object
try {
    $pakiti = new Pakiti();
    $pakiti->init();
    $pakiti->checkDBVersion();
} catch (Exception $e) {
    syslog(LOG_ERR, $e->getMessage());
    exit;
}
예제 #2
0
 public function __construct(Pakiti &$pakiti)
 {
     $this->_pakiti =& $pakiti;
     $this->_db =& $pakiti->getManager("DbManager");
     $this->_subSourceDefs = array();
 }
예제 #3
0
<?php

/**
 * User: Vadym Yanovskyy
 * Date: 8/5/15
 * Time: 12:21 PM
 */
include realpath(dirname(__FILE__)) . '/../../common/Loader.php';
$pakiti = new Pakiti();
$htag = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("tag"));
//host Tag
$country = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("country"));
$hostGroup = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("group"));
$cve = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("cve"));
$roc = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("roc"));
$type = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("type"));
# Default output type is CSV
if ($type == "") {
    $type = "csv";
}
//TODO: Add authorization
$hosts =& $pakiti->getManager("VulnerabilitiesManager")->getHostsWithCvesThatContainsSomeTag($htag, $hostGroup, $cve);
switch ($type) {
    case "csv":
        header("Content-Type: text/plain");
        print "CVE Tag,Site Country,ROC,Host Group,Hostname,Host Architecture,Host OS,CVE Name,CSIRT Mails\n";
        foreach ($hosts as $host) {
            foreach ($host["HostGroups"] as $hostGroup) {
                foreach ($host["CVE"] as $cve) {
                    foreach ($cve->getTag() as $tag) {
                        print $tag->getName() . "," . "," . "," . $hostGroup->getName() . "," . $host["Host"]->getHostname() . "," . $host["Host"]->getArch()->getName() . "," . $host["Host"]->getOs()->getName() . "," . $cve->getName() . "," . ",";
예제 #4
0
<?php

/**
 * User: Vadym Yanovskyy
 * Date: 8/2/15
 * Time: 6:29 PM
 */
include realpath(dirname(__FILE__)) . '/../../common/Loader.php';
$pakiti = new Pakiti();
$osName = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("os"));
$cveName = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("cve"));
$type = $pakiti->getManager("DbManager")->escape(Utils::getHttpGetVar("type"));
//Default output type is CSV
if ($type == "") {
    $type = "csv";
}
//TODO: Add authorization
$vulnerabilities =& $pakiti->getManager("VulnerabilitiesManager")->getVulnerabilitiesByCveNameAndOsName($cveName, $osName);
switch ($type) {
    case "csv":
        header("Content-Type: text/plain");
        print "CVE,Os,Package name,Operator,Package version\n";
        foreach ($vulnerabilities as $vulnerability) {
            print $cveName . "," . $osName . "," . $vulnerability->getName() . "," . $vulnerability->getOperator() . "," . $vulnerability->getVersion() . "-" . $vulnerability->getRelease() . "\n";
        }
        break;
    case "xml":
        print header("Content-Type: text/xml; charset=utf-8");
        header("Content-Type: text/xml; charset=utf-8");
        $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?> <xml></xml>');
        foreach ($vulnerabilities as $vulnerability) {