当前位置: 首页>>代码示例>>PHP>>正文


PHP valid_hex32函数代码示例

本文整理汇总了PHP中valid_hex32函数的典型用法代码示例。如果您正苦于以下问题:PHP valid_hex32函数的具体用法?PHP valid_hex32怎么用?PHP valid_hex32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了valid_hex32函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: str_replace

     } else {
         if (!$rs->EOF) {
             $scan_END = $rs->fields['scantime'];
             $report_key = $rs->fields['report_key'];
         }
     }
     $file_path = "/usr/share/ossim/www/tmp/" . $result->fields["name"] . "_" . $scan_END . ".pdf";
     $file_path = str_replace(" ", "", $file_path);
     $file_name = $result->fields["name"] . "_" . $scan_END . ".pdf";
     $params = array($report_id, $file_path);
     Util::execute_command("/usr/bin/php /usr/share/ossim/scripts/vulnmeter/respdf.php ? > ?", $params);
     if (file_exists($file_path) && filesize($file_path) <= 5242880) {
         $attachments[] = array("path" => $file_path, "name" => $file_name);
     }
 }
 if (!valid_hex32($username)) {
     $body = get_timestamps($dbconn, $username, $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
     $email = get_email($dbconn, $username);
     Util::send_email($dbconn, $email, $subject, $body, $attachments);
 } else {
     // username is a entity
     $entity_data = Acl::get_entity($dbconn, $username, FALSE, FALSE);
     if ($entity_data["admin_user"] != "") {
         $body = get_timestamps($dbconn, $entity_data["admin_user"], $result->fields['scan_START'], $result->fields['scan_SUBMIT'], $body);
         $email = get_email($dbconn, $entity_data["admin_user"]);
         Util::send_email($dbconn, $email, $subject, $body, $attachments);
     } else {
         // doesn't exit pro admin
         $users_list = Acl::get_users_by_entity($dbconn, $username);
         foreach ($users_list as $k => $user_data) {
             if ($user_data['email'] != "") {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:send_notification.php

示例2: array

*
* You should have received a copy of the GNU General Public License
* along with this package; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
* MA  02110-1301  USA
*
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
$m_perms = array('environment-menu', 'environment-menu');
$sm_perms = array('PolicyHosts', 'PolicyNetworks');
Session::logcheck_ajax($m_perms, $sm_perms);
$data['status'] = 'success';
$data['data'] = _('Your changes have been saved');
$message_id = POST('message_id');
if (!valid_hex32($message_id, TRUE)) {
    Util::response_bad_request(_('Error! Message ID not allowed.  Action could not be completed'));
}
try {
    $status = new System_notifications();
    $flags = array('viewed' => 'true');
    $status->set_status_message($message_id, $flags);
} catch (Exception $e) {
    Util::response_bad_request($e->getMessage());
}
echo json_encode($data);
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:set_suggestion_status.php

示例3: list_results


//.........这里部分代码省略.........
            $riskcount = $resultt->fields['total'];
            $risk = $resultt->fields['risk'];
            if ($risk == 7) {
                $data['vInfo'] += $riskcount;
            } else {
                if ($risk == 6) {
                    $data['vLow'] += $riskcount;
                } else {
                    if ($risk == 3) {
                        $data['vMed'] += $riskcount;
                    } else {
                        if ($risk == 2) {
                            $data['vHigh'] += $riskcount;
                        } else {
                            if ($risk == 1) {
                                $data['vSerious'] += $riskcount;
                            }
                        }
                    }
                }
            }
            $resultt->MoveNext();
        }
        if ($data['vInfo'] == 0 && $data['vLow'] == 0 && $data['vMed'] == 0 && $data['vHigh'] == 0 && $data['vSerious'] == 0) {
            $tdata[] = array("report_id" => "All", "host_name" => "", "scantime" => "", "username" => "", "scantype" => "", "report_key" => "", "report_type" => "", "sid" => "", "profile" => "", "hlink" => "", "plink" => "", "xlink" => "", "vSerious" => $data['vSerious'], "vHigh" => $data['vHigh'], "vMed" => $data['vMed'], "vLow" => $data['vLow'], "vInfo" => $data['vInfo']);
        } else {
            $tdata[] = array("report_id" => "All", "host_name" => "", "scantime" => "", "username" => "", "scantype" => "", "report_key" => "", "report_type" => "", "sid" => "", "profile" => "", "hlink" => "lr_reshtml.php?ipl=all&disp=html&output=full&scantype=M", "plink" => "lr_respdf.php?ipl=all&scantype=M", "xlink" => "lr_rescsv.php?ipl=all&scantype=M", "dlink" => "", "vSerious" => $data['vSerious'], "vHigh" => $data['vHigh'], "vMed" => $data['vMed'], "vLow" => $data['vLow'], "vInfo" => $data['vInfo']);
        }
        foreach ($result as $data) {
            if (!Session::hostAllowed_by_ip_ctx($dbconn, $data["hostIP"], $data["ctx"])) {
                continue;
            }
            $host_id = key(Asset_host::get_id_by_ips($dbconn, $data["hostIP"], $data["ctx"]));
            if (valid_hex32($host_id)) {
                $data['host_name'] = Asset_host::get_name_by_id($dbconn, $host_id);
            }
            $data['vSerious'] = 0;
            $data['vHigh'] = 0;
            $data['vMed'] = 0;
            $data['vLow'] = 0;
            $data['vInfo'] = 0;
            // query for reports for each IP
            $query_risk = "SELECT distinct risk, port, protocol, app, scriptid, msg, hostIP FROM vuln_nessus_latest_results WHERE hostIP = '" . $data['hostIP'];
            $query_risk .= "' AND username = '" . $data['username'] . "' AND sid =" . $data['sid'] . " AND ctx = UNHEX('" . $data['ctx'] . "') AND falsepositive='N'";
            $result_risk = $dbconn->Execute($query_risk);
            while (!$result_risk->EOF) {
                if ($result_risk->fields["risk"] == 7) {
                    $data['vInfo']++;
                } else {
                    if ($result_risk->fields["risk"] == 6) {
                        $data['vLow']++;
                    } else {
                        if ($result_risk->fields["risk"] == 3) {
                            $data['vMed']++;
                        } else {
                            if ($result_risk->fields["risk"] == 2) {
                                $data['vHigh']++;
                            } else {
                                if ($result_risk->fields["risk"] == 1) {
                                    $data['vSerious']++;
                                }
                            }
                        }
                    }
                }
                $result_risk->MoveNext();
开发者ID:jackpf,项目名称:ossim-arc,代码行数:67,代码来源:index.php

示例4: while

 while (list($hostIP, $hostctx, $service, $service_num, $service_proto, $app, $risk, $scriptid, $pname, $msg) = $result->fields) {
     $arrResults[$hostIP . "#" . $hostctx][] = array('service' => $service, 'port' => $service_num, 'protocol' => $service_proto, 'application' => $app, 'risk' => $risk, 'scriptid' => $scriptid, 'exception' => $eid, 'msg' => preg_replace('/(<br\\s*?\\/??>)+/i', "\n", $msg), 'pname' => $pname);
     $result->MoveNext();
 }
 //Vulnerability table configs
 $vcols = array(_("Risk"), _("Details"));
 //widths for columns
 $vwidth_array = array(20, 170);
 // 196 total
 $count = 0;
 $oldip = "";
 // iterate through the IP is the results
 foreach ($arrResults as $hostIP_ctx => $scanData) {
     list($hostIP, $hostctx) = explode("#", $hostIP_ctx);
     $host_id = key(Asset_host::get_id_by_ips($dbconn, $hostIP, $hostctx));
     if (valid_hex32($host_id)) {
         $hostname = Asset_host::get_name_by_id($dbconn, $host_id);
     } else {
         $hostname = _('unknown');
     }
     $hostIP = htmlspecialchars_decode($hostIP);
     $hostname = htmlspecialchars_decode($hostname);
     $pdf->SetLink(${"IP_" . $hostIP_ctx}, $pdf->GetY());
     //print out the host cell
     $pdf->SetFillColor(229, 229, 229);
     $pdf->SetFont('', 'B', 10);
     $pdf->Cell(95, 6, $hostIP, 1, 0, 'C', 1);
     $pdf->Cell(95, 6, $hostname, 1, 0, 'C', 1);
     //$pdf->Cell(105, 6, "",1,0,'C');
     $pdf->SetFont('', '');
     $pdf->Ln();
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:respdf.php

示例5:

            ?>
" <?php 
            echo $selected;
            ?>
><?php 
            echo $template['name'];
            ?>
</option>
										<?php 
        }
        ?>
								</select>
								
								<?php 
        if ($am_i_admin) {
            if ($notemplates == 0 && valid_hex32($templates[0]['id'])) {
                ?>
										<a href="javascript:;" onclick="go_template('edit')">
											<img align="absmiddle" src="../pixmaps/tables/table_edit.png" border="0" class="info" alt="<?php 
                echo _('View template');
                ?>
" title="<?php 
                echo _('View template');
                ?>
"/>
										</a>
										<?php 
            }
            ?>
									<a href="javascript:;" onclick="go_template('new')">
										<img src="../pixmaps/tables/table_row_insert.png" align="absmiddle" alt="<?php 
开发者ID:alienfault,项目名称:ossim,代码行数:31,代码来源:user_form.php

示例6: _

                     $sensor_error = TRUE;
                 }
             }
         }
         $sname[] = $sensor_name;
         $sperm[] = "<img {$sclass} src='../pixmaps/" . (Session::sensorAllowed($sid) ? "tick" : "cross") . ".png' border='0'>";
         $vs[] = "<img {$vsclass} src='../pixmaps/" . (valid_hex32($scan_server) && $sid == $sensor_id ? "tick" : ($has_vuln_scanner ? "tick" : "cross")) . ".png' border='0'>";
         if (!$hosts_alive) {
             // don't do a Nmap scan
             $snmap[] = '<span style="font-size:9px;color:gray">' . _('No selected') . '</span>';
         } else {
             $snmap[] = "<img {$nmsclass} align='absmiddle' src='../pixmaps/" . ($scan_locally || $withnmap && $withnmapforced ? "tick" : ($withnmap ? "tick" : "cross")) . ".png' border='0'>" . ($scan_locally || $withnmap && $withnmapforced ? "<span style='font-size:9px;color:gray'>{$message_pre_scan}</span>" : ($withnmap ? "" : "<span style='font-size:9px;color:gray'>{$message_force_pre_scan}</span>"));
         }
         if ($ttargets[$target]['sensor'] == $sid) {
             $ttargets[$target]['sperm'] = Session::sensorAllowed($sid) ? TRUE : FALSE;
             $ttargets[$target]['vs'] = valid_hex32($scan_server) && $sid == $sensor_id ? TRUE : ($has_vuln_scanner ? TRUE : FALSE);
             if (!$hosts_alive) {
                 $ttargets[$target]['snmap'] = TRUE;
             } else {
                 $ttargets[$target]['snmap'] = $scan_locally || $withnmap && $withnmapforced ? TRUE : ($withnmap ? TRUE : FALSE);
             }
         }
     }
     $snames = implode('<br><br>', $sname);
 } else {
     $snames = '<span style="font-weight:bold;color:#ff0000">' . _('Sensor not found') . '</span>';
 }
 $sperms = implode('<br>', $sperm);
 $vulns = implode('<br>', $vs);
 $nmaps = implode('<br>', $snmap);
 $load = implode('<br><br>', $load);
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:simulate.php

示例7: ip_max_occurrences

function ip_max_occurrences($target, $date_from, $date_to)
{
    global $NUM_HOSTS;
    global $security_report;
    global $report_type;
    global $geoloc;
    /* ossim framework conf */
    $conf = $GLOBALS['CONF'];
    $report_graph_type = $conf->get_conf('report_graph_type');
    if (!strcmp($target, "ip_src")) {
        if ($report_type == "alarm") {
            $target = "src_ip";
        }
        $title = _("Attacker hosts");
    } elseif (!strcmp($target, "ip_dst")) {
        if ($report_type == "alarm") {
            $target = "dst_ip";
        }
        $title = _("Attacked hosts");
    }
    $list = $security_report->AttackHost($target, $NUM_HOSTS, $report_type, $date_from, $date_to);
    if (!is_array($list) || empty($list)) {
        return 0;
    }
    ?>
    <table class='t_alarms'>
        <thead>
            <tr><td colspan='2' class="headerpr"><?php 
    echo _("Top");
    echo " {$NUM_HOSTS} {$title}";
    ?>
</td></tr>
        </thead>
        
        <tbody>
            <tr>
                <td class='td_container'>
                    <table class="table_data">
                        <thead>                     
                            <tr>
                                <th> <?php 
    echo _("Host");
    ?>
 </th>
                                <th> <?php 
    echo _("Occurrences");
    ?>
 </th>
                            </tr>
                        </thead>
                        
                        <tbody>
                        <?php 
    foreach ($list as $l) {
        $ip = $l[0];
        $occurrences = number_format($l[1], 0, ",", ".");
        $id = $l[2];
        $ctx = $l[3];
        $host_output = Asset_host::get_extended_name($security_report->ossim_conn, $geoloc, $ip, $ctx, $id);
        $hostname = $host_output['name'];
        $icon = $host_output['html_icon'];
        $os = valid_hex32($id) ? Asset_host_properties::get_os_by_host($security_report->ossim_conn, $id) : "";
        $os_pixmap = preg_match("/unknown/", $os) ? '' : $os;
        $bold = $host_output['is_internal'];
        ?>
                            <tr>
                                <td class='td_data <?php 
        if ($bold) {
            echo 'bold';
        }
        ?>
'>                                
                                    <?php 
        echo $icon . ' ' . $hostname . ' ' . $os_pixmap;
        ?>
                                </td>
                                <td class='td_data'><?php 
        echo $occurrences;
        ?>
</td>
                            </tr>
                            <?php 
    }
    ?>
                        </tbody>
                    </table>
                </td>
                
                <td class='td_container'>
                    <?php 
    if ($report_graph_type == "applets") {
        jgraph_attack_graph($target, $NUM_HOSTS);
    } else {
        ?>
                        <img src="graphs/attack_graph.php?target=<?php 
        echo $target;
        ?>
&hosts=<?php 
        echo $NUM_HOSTS;
        ?>
//.........这里部分代码省略.........
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:101,代码来源:sec_report.php

示例8: origdetails

function origdetails()
{
    global $uroles, $user, $sid, $query_risk, $border, $report_id, $scantime, $scantype, $fp, $nfp, $filterip, $enableFP, $enableNotes, $output, $sortby, $dbconn, $arruser;
    global $treport, $ipl, $query_byuser, $ips_inrange, $ctx, $key;
    $colors = array("Serious" => "#FFCDFF", "High" => "#FFDBDB", "Medium" => "#FFF283", "Low" => "#FFFFC0", "Info" => "#FFFFE3");
    $images = array("Serious" => "./images/risk1.gif", "High" => "./images/risk2.gif", "Medium" => "./images/risk3.gif", "Low" => "./images/risk6.gif", "Info" => "./images/risk7.gif");
    $levels = array("Serious" => "1", "High" => "2", "Medium" => "3", "Low" => "6", "Info" => "7");
    $query_host = '';
    if ($filterip) {
        $query_host = " AND hostip='{$filterip}'";
    }
    echo "<center>";
    echo "<form>";
    echo "<table width=\"900\" class=\"noborder\" style=\"background:transparent;\">";
    echo "<tr><td style=\"text-align:left;\" class=\"nobborder\">";
    echo "<input id=\"checkboxFP\" type=\"checkbox\" onclick=\"showFalsePositives()\"> <span style=\"color:black\">" . _("View false positives") . "</span>";
    echo "</td><td class=\"nobborder\" style=\"text-align:center;\">";
    // print the icon legend
    if ($enableFP) {
        echo "<img alt='True' src='images/true.gif' border=0 align='absmiddle'> - " . _("True result") . "&nbsp;&nbsp;";
        echo "<img alt='False' src='images/false.png' border=0 align='absmiddle'> - " . _("False positive result") . "&nbsp;&nbsp;";
    }
    $feed = exists_feed_tables($dbconn);
    echo "<img alt='Info' src='images/info.png' border=0 align='absmiddle'> - " . _("Additional information is available");
    echo "</td></tr></table>";
    echo "</form>";
    echo "<br>";
    $perms_where = Session::get_ctx_where() != "" ? " AND res.ctx in (" . Session::get_ctx_where() . ")" : "";
    if ($ipl == "all") {
        $query = "select distinct res.hostIP, HEX(res.ctx) as ctx\n                    from vuln_nessus_latest_results res\n                    where falsepositive='N' \n                    {$perms_where}\n                    {$query_byuser}";
    } else {
        if (!empty($ipl) && !empty($ctx)) {
            $query = "select distinct res.hostIP, HEX(res.ctx) as ctx\n                    from vuln_nessus_latest_results res\n                    where falsepositive='N' \n                    and res.hostIP='{$ipl}'\n                    and res.ctx=UNHEX('{$ctx}')\n                    {$perms_where}\n                    {$query_byuser}";
        } else {
            if (!empty($scantime) && !empty($key)) {
                $query = "select distinct res.hostIP, HEX(res.ctx) as ctx\n                    from vuln_nessus_latest_results res, vuln_nessus_latest_reports rep\n                    where res.falsepositive='N'\n                    and res.scantime='{$scantime}' \n                    and res.hostIP=rep.hostIP\n                    and res.ctx=rep.ctx\n                    and res.username=rep.username\n                    and res.sid=rep.sid\n                    {$perms_where}\n                    and rep.report_key='{$key}' {$query_byuser}";
            }
        }
    }
    $resultp = $dbconn->execute($query);
    $host_range = array_keys($ips_inrange);
    while (list($hostip, $hostctx) = $resultp->fields) {
        $host_id = key(Asset_host::get_id_by_ips($dbconn, $hostip, $hostctx));
        if (valid_hex32($host_id)) {
            $hostname = Asset_host::get_name_by_id($dbconn, $host_id);
        } else {
            $hostname = _('unknown');
        }
        if (in_array($hostip . ";" . $hostctx, $host_range)) {
            echo "<div class='hostip'>";
            echo "<br><font color='red'><b><a name='{$hostip};{$hostctx}' href='javascript:;' ctx='{$hostctx}' id='{$hostip};{$hostname}' class='HostReportMenu'>{$hostip} - {$hostname}</a></b></font>";
            echo "<br><br><table summary=\"{$hostip} - " . _("Reported Ports") . "\">";
            echo "<tr><th colspan=2>" . _("Reported Ports") . "</th></tr>";
            if (!empty($scantime) && !empty($key)) {
                $query = "select distinct res.port, res.protocol\n                from vuln_nessus_latest_results res, vuln_nessus_latest_reports rep\n                where res.falsepositive='N'\n                and res.scantime='{$scantime}' \n                and res.hostIP=rep.hostIP\n                and res.ctx=rep.ctx\n                and res.username=rep.username\n                and res.sid=rep.sid\n                and res.hostIP='{$hostip}'\n                and res.ctx='{$hostctx}'\n                and rep.report_key='{$key}' {$query_byuser}) as t group by risk";
            } else {
                $query = "select distinct res.port, res.protocol\n                            from vuln_nessus_latest_results res \n                            where hostip='{$hostip}' and ctx=UNHEX('{$hostctx}') {$query_byuser} AND port > '0' ORDER BY port ASC";
            }
            $result1 = $dbconn->execute($query);
            $k = 1;
            $pos = '';
            if (!$result1->fields) {
                print "<tr><td>" . _("No reported ports found") . "</td></tr>";
            } else {
                while (list($port, $proto) = $result1->fields) {
                    if ($k % 2) {
                        echo "<tr><td>{$port}/{$proto}</td>";
                        $pos = "open";
                    } else {
                        echo "<td>{$port}/{$proto}</td></tr>";
                        $pos = "closed";
                    }
                    $k++;
                    $result1->MoveNext();
                }
                // end while
                // close up the table
                if ($pos != "closed") {
                    echo "<td>&nbsp;</td></tr>";
                }
            }
            echo "</table><br/>";
            echo "<table width='900' summary='{$hostip} - risks'><tr>";
            echo "<th>" . _("Vuln Name") . "</th>";
            echo "<th>" . _("VulnID") . "</th>";
            echo "<th>" . _("Service") . "</th>";
            echo "<th>" . _("Severity") . "</th>";
            echo "</tr>";
            if (!empty($scantime) && !empty($key)) {
                if ($feed) {
                    $query = "select res.result_id, res.service, res.risk, res.falsepositive, res.scriptid, v.name, res.msg, rep.sid\n                        from vuln_nessus_latest_results AS res LEFT JOIN vuln_nessus_plugins AS v ON v.id=res.scriptid, vuln_nessus_latest_reports rep\n                        where res.msg<>''\n                        and res.scantime='{$scantime}' \n                        and res.hostIP=rep.hostIP\n                        and res.ctx=rep.ctx\n                        and res.hostIP='{$hostip}'\n                        and res.ctx=UNHEX('{$hostctx}')\n                        and res.username=rep.username\n                        and res.sid=rep.sid\n                        and rep.report_key='{$key}' and rep.sid>=0 {$query_byuser}\n                        UNION DISTINCT\n                        select res.result_id, res.service, res.risk, res.falsepositive, res.scriptid, v.name, res.msg, rep.sid\n                        from vuln_nessus_latest_results AS res LEFT JOIN vuln_nessus_plugins_feed AS v ON v.id=res.scriptid, vuln_nessus_latest_reports rep\n                        where res.msg<>''\n                        and res.scantime='{$scantime}' \n                        and res.hostIP=rep.hostIP\n                        and res.ctx=rep.ctx\n                        and res.hostIP='{$hostip}'\n                        and res.ctx=UNHEX('{$hostctx}')\n                        and res.username=rep.username\n                        and res.sid=rep.sid\n                        and rep.report_key='{$key}' and rep.sid<0 {$query_byuser}\n                        ";
                } else {
                    $query = "select res.result_id, res.service, res.risk, res.falsepositive, res.scriptid, v.name, res.msg, rep.sid\n                        from vuln_nessus_latest_results AS res LEFT JOIN vuln_nessus_plugins AS v ON v.id=res.scriptid, vuln_nessus_latest_reports rep\n                        where res.msg<>''\n                        and res.scantime='{$scantime}' \n                        and res.hostIP=rep.hostIP\n                        and res.ctx=rep.ctx\n                        and res.hostIP='{$hostip}'\n                        and res.ctx=UNHEX('{$hostctx}')\n                        and res.username=rep.username\n                        and res.sid=rep.sid\n                        and rep.report_key='{$key}' {$query_byuser}";
                }
            } else {
                if ($feed) {
                    $query = "select res.result_id, res.service, res.risk, res.falsepositive, res.scriptid, v.name, res.msg, rep.sid\n                    FROM vuln_nessus_latest_results res LEFT JOIN vuln_nessus_plugins AS v ON v.id=res.scriptid, vuln_nessus_latest_reports rep\n                    WHERE\n                    res.hostIP=rep.hostIP\n                    and res.ctx=rep.ctx\n                    and res.username=rep.username\n                    and res.sid=rep.sid\n                    and res.hostIP='{$hostip}'\n                    and res.ctx=UNHEX('{$hostctx}')\n                    {$query_byuser} and msg<>'' and rep.sid>=0\n                    UNION DISTINCT\n                    select res.result_id, res.service, res.risk, res.falsepositive, res.scriptid, v.name, res.msg, rep.sid\n                    FROM vuln_nessus_latest_results res LEFT JOIN vuln_nessus_plugins_feed AS v ON v.id=res.scriptid, vuln_nessus_latest_reports rep\n                    WHERE\n                    res.hostIP=rep.hostIP\n                    and res.ctx=rep.ctx\n                    and res.username=rep.username\n                    and res.sid=rep.sid\n                    and res.hostIP='{$hostip}'\n                    and res.ctx=UNHEX('{$hostctx}')\n                    {$query_byuser} and msg<>'' and rep.sid<0";
                } else {
                    $query = "select res.result_id, res.service, res.risk, res.falsepositive, res.scriptid, v.name, res.msg, rep.sid\n                    FROM vuln_nessus_latest_results res LEFT JOIN vuln_nessus_plugins AS v ON v.id=res.scriptid, vuln_nessus_latest_reports rep\n                    WHERE\n                    res.hostIP=rep.hostIP\n                    and res.ctx=rep.ctx\n                    and res.username=rep.username\n                    and res.sid=rep.sid\n                    and res.hostIP='{$hostip}'\n                    and res.ctx=UNHEX('{$hostctx}')\n                    {$query_byuser} and msg<>''";
                }
//.........这里部分代码省略.........
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:101,代码来源:lr_reshtml.php

示例9: array

 $ret = NULL;
 $data['status'] = 'success';
 try {
     $new_agent = Ossec_agent::create($sensor_id, $agent_name, $ip_cidr, $asset_id);
     //If ossec-remoted is not running, we have to restart Ossec Server
     $ossec_status = Ossec_control::execute_action($sensor_id, 'status');
     if ('UP' !== $ossec_status['general_status']['ossec-remoted']) {
         Ossec_control::execute_action($sensor_id, 'restart');
     }
     if (is_array($new_agent) && !empty($new_agent)) {
         $agent_id = $new_agent['id'];
         $agent_info = array('name' => $new_agent['name'], 'ip_cidr' => $new_agent['ip_cidr'], 'status' => $new_agent['status']);
         $agent_actions = Ossec_agent::get_actions($agent_id, $new_agent);
         $data['data'] = _("HIDS agent has been created. To deploy the agent, please choose one of the options under the 'Actions' column") . "###" . $agent_id . "###";
         $a_unique_id = md5($agent_id);
         if (valid_hex32($new_agent['host_id'])) {
             $db = new Ossim_db();
             $conn = $db->connect();
             $asset_name = Asset_host::get_name_by_id($conn, $new_agent['host_id']);
             $db->close();
         } else {
             $asset_name = '-';
         }
         //Normalize status description (See asset list filters)
         if ($new_agent['status']['id'] == 1) {
             $new_agent['status']['descr'] = 'Disconnected';
         }
         $agent_elem = array("DT_RowId" => 'cont_agent_' . $agent_id, "DT_RowData" => array('agent_key' => $a_unique_id, 'asset_id' => $new_agent['host_id'], 'agent_status' => $new_agent['status']), '', $agent_id, $new_agent['name'], $asset_name, $new_agent['ip_cidr'], "-", "-", $new_agent['status']['descr'], $agent_actions);
         $data['data'] .= json_encode(array($agent_elem));
     }
 } catch (Exception $e) {
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:save_agent.php

示例10: explode

$user = $argv[5];
$autodetect = $argv[6] == '0' || $argv[3] == 'vulnscan' ? FALSE : TRUE;
$rdns = $argv[7] == '0' ? FALSE : TRUE;
$ports = $argv[8];
// When type is custom, specific ports
// Check targets
$target_array = explode(" ", $targets);
foreach ($target_array as $target) {
    ossim_valid($target, OSS_IP_ADDRCIDR, 'illegal:' . _('Target'));
    if (ossim_error()) {
        $error_message[] = "Incorrect asset format in {$target}";
        ossim_set_error(FALSE);
    }
}
// Check remote sensor
if (!valid_hex32($remote_sensor) && $remote_sensor != 'null' && !empty($remote_sensor)) {
    ossim_valid($remote_sensor, OSS_IP_ADDR, 'illegal:' . _('Remote sensor'));
}
if (ossim_error()) {
    $error_message[] = 'Illegal remote sensor';
    ossim_set_error(FALSE);
}
// check timing template
ossim_valid($timing_template, OSS_NULLABLE, OSS_TIMING_TEMPLATE, 'illegal:' . _('Timing Template'));
if (ossim_error()) {
    $error_message[] = 'Illegal timing template';
    ossim_set_error(FALSE);
}
// check scan type
ossim_valid($scan_type, OSS_NULLABLE, OSS_ALPHA, 'illegal:' . _('Scan type'));
if (ossim_error()) {
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:remote_nmap.php

示例11: ossim_db

             $db = new ossim_db();
             $conn = $db->connect();
             $num_assets = Filter_list::get_total_selection($conn, 'asset');
             $asset_group = new Asset_group($group_id);
             $asset_group->save_assets_from_search($conn);
             $db->close();
             $data['status'] = 'success';
             $data['data'] = sprintf(_("%s assets have been added to group"), $num_assets);
         } catch (Exception $e) {
             Util::response_bad_request(_('Error! Selected assets could not be added') . ': ' . $e->getMessage());
         }
     }
     break;
 case 'delete_assets':
     $group_id = POST('asset_id');
     if (!valid_hex32($group_id)) {
         Util::response_bad_request(_('Error! Asset group ID not allowed. Selected assets could not be removed'));
     } else {
         try {
             $db = new ossim_db();
             $conn = $db->connect();
             $num_assets = Filter_list::get_total_selection($conn, 'asset');
             $asset_group = new Asset_group($group_id);
             $asset_group->delete_selected_assets($conn);
             $db->close();
             $data['status'] = 'success';
             $data['data'] = sprintf(_("%s assets have been deleted from group"), $num_assets);
         } catch (Exception $e) {
             Util::response_bad_request(_('Error! Selected assets could not be deleted') . ': ' . $e->getMessage());
         }
     }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:group_actions.php

示例12: unset

         unset($_ctx);
     }
 }
 if (!empty($id) && Asset_host::is_in_db($conn, $id)) {
     ossim_valid($id, OSS_HEX, 'illegal:' . _('Asset ID'));
     if (ossim_error()) {
         echo ossim_error(_('Error! Asset not found'));
         exit;
     }
     $asset = new Asset_host($conn, $id);
     $asset->load_from_db($conn);
     $is_in_db = 1;
     $is_editable = Asset_host::can_i_modify_ips($conn, $id) ? 'yes' : 'no_ip';
 } else {
     //New asset or asset has been deleted but there are some instances in the system (SIEM, alarms, ...)
     $id = valid_hex32($id) ? $id : Util::uuid();
     $asset = new Asset_host($conn, $id);
     if (isset($_ip) && isset($_ctx)) {
         $asset->set_ctx($_ctx);
         $ext_ips[$_ip] = array('ip' => $_ip, 'mac' => NULL);
         $asset->set_ips($ext_ips);
     }
 }
 //Getting asset data
 $id = $asset->get_id();
 $ctx = $asset->get_ctx();
 $_ips = $asset->get_ips();
 $ips = $_ips->get_ips();
 if (is_array($ips) && !empty($ips)) {
     $ips = array_keys($ips);
 }
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:asset_form.php

示例13: tab_discovery


//.........这里部分代码省略.........
        $discovery .= ">{$i}</option>";
    }
    $discovery .= "</select></td><td align='right'>" . gettext("Minutes") . "</td>\n            <td class='noborder' align='left'><select name='time_min'>";
    for ($i = 0; $i < 60; $i = $i + 15) {
        $discovery .= "<option value=\"{$i}\"";
        if ($time_min == $i && $time_min_selected == "" || $time_min_selected == $i) {
            $discovery .= " selected";
        }
        $discovery .= ">{$i}</option>";
    }
    $discovery .= <<<EOT
            </select></td>
          </tr>
        </table>
      </div>
    </tr>
    
EOT;
    $discovery .= "<tr>";
    $discovery .= "\t\t<td class='madvanced'><a class='section'><img id='advanced_arrow' border='0' align='absmiddle' src='../pixmaps/arrow_green.gif'>" . _("ADVANCED") . "</a></td>";
    $discovery .= "\t\t<td>&nbsp;</td>";
    $discovery .= "</tr>";
    if ($_SESSION["scanner"] == "omp") {
        $credentials = Vulnerabilities::get_credentials($dbconn, 'ssh');
        preg_match("/(.*)\\|(.*)/", $editdata["credentials"], $found);
        $discovery .= "<tr class='advanced'>";
        $discovery .= "<td class='job_option'>" . Util::strong(_("SSH Credential:")) . "</td>";
        $discovery .= "<td style='text-align:left'><select id='ssh_credential' name='ssh_credential'>";
        $discovery .= "<option value=''>--</option>";
        foreach ($credentials as $cred) {
            $login_text = $cred["login"];
            if ($cred["login"] == '0') {
                $login_text = _("All");
            } elseif (valid_hex32($cred["login"])) {
                $login_text = Session::get_entity_name($dbconn, $cred["login"]);
            }
            $selected = $found[1] == $cred["name"] . "#" . $cred["login"] || $cred["name"] . "#" . $cred["login"] == $ssh_credential ? " selected='selected'" : "";
            $discovery .= "<option value='" . $cred["name"] . "#" . $cred["login"] . "' {$selected}>" . $cred["name"] . " (" . $login_text . ")</option>";
        }
        $discovery .= "</select></td>";
        $discovery .= "</tr>";
        $credentials = Vulnerabilities::get_credentials($dbconn, 'smb');
        $discovery .= "<tr class='advanced'>";
        $discovery .= "<td class='job_option'>" . Util::strong(_("SMB Credential:")) . "</td>";
        $discovery .= "<td style='text-align:left'><select id='smb_credential' name='smb_credential'>";
        $discovery .= "<option value=''>--</option>";
        foreach ($credentials as $cred) {
            $login_text = $cred["login"];
            if ($cred["login"] == '0') {
                $login_text = _("All");
            } elseif (valid_hex32($cred["login"])) {
                $login_text = Session::get_entity_name($dbconn, $cred["login"]);
            }
            $selected = $found[2] == $cred["name"] . "#" . $cred["login"] || $cred["name"] . "#" . $cred["login"] == $smb_credential ? " selected='selected'" : "";
            $discovery .= "<option value='" . $cred["name"] . "#" . $cred["login"] . "' {$selected}>" . $cred["name"] . " (" . $login_text . ")</option>";
        }
        $discovery .= "</select></td>";
        $discovery .= "</tr>";
    }
    $discovery .= "<tr class='job_option advanced'>";
    $discovery .= "<td class='job_option'>" . Util::strong(_("Timeout:")) . "</td>";
    $discovery .= "<td style=\"text-align:left;\" nowrap><input type='text' style='width:80px' name='timeout' value='" . ($timeout_selected == "" ? "{$timeout}" : "{$timeout_selected}") . "'>";
    $discovery .= "<font color='black'>&nbsp;&nbsp;&nbsp;" . _("Max scan run time in seconds") . "&nbsp;&nbsp;&nbsp;</font></td>";
    $discovery .= "</tr>";
    $discovery .= "<tr class='advanced'><td class='job_option'>" . Util::strong(_("Send an email notification:"));
    $discovery .= "</td>";
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:67,代码来源:sched.php

示例14: POST

$num_assets = POST('num_assets');
$error_msg = '';
ossim_valid($group_id, OSS_HEX, 'illegal: Group ID');
ossim_valid($num_assets, OSS_DIGIT, OSS_NULLABLE, 'illegal: Num of assets');
if (ossim_error()) {
    die(ossim_error());
}
// Database Object
$db = new ossim_db();
$conn = $db->connect();
$group = Asset_group::get_object($conn, $group_id);
$group->can_i_edit($conn);
// Form is submited: Add to group
if ($num_assets > 0) {
    for ($i = 0; $i < $num_assets; $i++) {
        if (valid_hex32(POST('host' . $i))) {
            $assets[] = POST('host' . $i);
        }
    }
    try {
        $group->add_host($conn, $assets);
    } catch (Exception $e) {
        $error_msg = $e->getMessage();
    }
    if ($error_msg == '') {
        $msg = 'saved';
        ?>
        <script>
        if(typeof(top.frames['main'].force_reload) != 'undefined')
	    {
	        top.frames['main'].force_reload = 'snapshot,alarms,events';
开发者ID:AntBean,项目名称:alienvault-ossim,代码行数:31,代码来源:add_to_group.php

示例15: explode

        $priority = $incident->get_priority();
        ?>
                        <td><?php 
        echo Incident::get_priority_in_html($priority);
        ?>
</td>
                        <td nowrap='nowrap'><?php 
        echo $incident->get_date();
        ?>
</td>
                        <td nowrap='nowrap'><?php 
        echo $incident->get_life_time();
        ?>
</td>
                            <?php 
        if (preg_match("/pro|demo/i", $version) && valid_hex32($incident->get_in_charge())) {
            $in_charge_name = Acl::get_entity_name($conn, $incident->get_in_charge());
        } else {
            $in_charge_name = $incident->get_in_charge_name($conn);
        }
        ?>
                        <td><?php 
        echo $in_charge_name;
        ?>
</td>
                        <?php 
        $submitter = $incident->get_submitter();
        $submitter_data = explode("/", $submitter);
        ?>
                        <td><?php 
        echo $submitter_data[0];
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:index.php


注:本文中的valid_hex32函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。