$md5_hash = $line["md5"]; $path = $results_path . $md5_hash . "." . $name . ".json"; if (!file_exists($path)) { $error .= "Download error: file not found<br />"; } } else { $error .= "Error: Cannot find report file for task <" . $tid . ">"; } } /////////////////////////////////////////// // HTML HEADER /////////////////////////////////////////// display_header(); if (isset($_GET["display_task"])) { $tid = $_GET["display_task"]; display_task($tid); } elseif (isset($_GET["display_alerts"])) { display_alerts(); } elseif (isset($_GET["display_json"])) { $tid = $_GET["display_json"]; display_analysis($tid, True); } elseif (isset($_GET["display_analysis"])) { $tid = $_GET["display_analysis"]; display_analysis($tid); } elseif (isset($_GET["config"])) { display_config(); } elseif (isset($_GET["search"])) { display_search(); } elseif (isset($_GET["meta_sign"])) { display_meta_sign(); } elseif (isset($_GET["sql_query"])) {
function display_analysis($analysis_id, $display_json = False) { global $states, $results_path; $analysis_id_s = secure_display($analysis_id); $get_analysis_info_result = get_analysis_info($analysis_id); if (!$get_analysis_info_result) { return; } $analysis_info = $get_analysis_info_result->fetchArray(); display_task($analysis_info["task_id"]); echo '<h2>#' . $analysis_id_s . ' ANALYSIS INFO</h2>'; $cuckoo_server_id = $analysis_info["cuckoo_server_id"]; $get_cuckoo_server_info_result = get_cuckoo_server_info($cuckoo_server_id); $cuckoo_server = "NOT FOUND"; if ($get_cuckoo_server_info_result) { $cuckoo_server_info = $get_cuckoo_server_info_result->fetchArray(); $cuckoo_server = '#' . secure_display($cuckoo_server_info["cuckoo_server_id"]) . ' ' . $cuckoo_server_info["name"] . ' ' . $cuckoo_server_info["server_addr"]; } $kernl = intval($analysis_info["kernel_analysis"]); $mode = "usermode"; if ($kernl == 1) { $mode = "kernelmode"; } $score = intval($analysis_info["total_score"]); $state = intval($analysis_info["state"]); echo ' <div class="container100"><table class="std"> <tr><th class="std">STATE</th><td class="std">' . $states[$state] . '</td></tr> <tr><th class="std">MODE</th><td class="std">' . $mode . '</td></tr> <tr><th class="std">CUCKOO SERVER</th><td class="std">' . $cuckoo_server . '</td></tr> <tr><th class="std">TOTAL SCORE</th><td class="std"><span class="' . get_score_class($score, $kernl) . '">' . $score . '</span></td></tr> <tr><th class="std">SIGNATURES (score)</th><td class="std">'; $get_matched_signatures_result = get_matched_signatures($analysis_id); if ($get_matched_signatures_result) { while ($signature_info = $get_matched_signatures_result->fetchArray()) { echo secure_display($signature_info['title']) . ' (' . secure_display($signature_info['score']) . ')<br />'; } } echo '</td></tr> <tr><td colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?download_json=' . $analysis_id_s . '">Download JSON report</a></td></tr> <tr><td colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?display_json=' . $analysis_id_s . '">Display JSON data</a></td></tr> </table></div>'; if ($display_json) { echo ' <div class="container100">'; $json_path = $results_path . $analysis_info["md5"] . "." . $analysis_info["analysis_id"] . ".json"; display_json_info($json_path); echo ' </div>'; } }