if ($line) { $md5_hash = $line["md5"]; $path = $bin_path . $md5_hash . ".bin"; if (file_exists($path)) { header("Content-disposition: attachment; filename=" . $md5_hash . ".bin"); header("Content-type: application/bin"); readfile($path); exit(0); } } $error .= "Cannot find sample<br />"; } // pull report from remote server if (isset($_GET["pull_report"])) { $tid = $_GET["download_sample"]; $req = get_task_md5($tid); $line = $req->fetchArray(); if ($line) { $name = "usermode"; if (isset($_GET["k"])) { $name = "kernelmode"; } // close DB so the script can write it close_db(); $error .= system($download_cmd . " " . $line["task_id"], $retval); if ($retval == 0) { $error .= "Download error: System command error<br />"; } // reopen it! open_db(); $md5_hash = $line["md5"];
function display_task($task_id) { global $task_header_1, $task_header_2, $task_footer; $task_id_s = secure_display($task_id); $req = get_task_md5($task_id); if (!$req) { return; } $res = $req->fetchArray(); echo '<h1>TASK #' . $task_id_s . ' : ' . secure_display($res['md5']) . '</h1>'; echo '<h2>TASK INFO</h2> <div class="container100"> <table class="std"> <tr><th class="std">MD5</th><td class="std">' . secure_display($res['md5']) . '</td></tr> <tr><th class="std">DOWNLOAD</th><td class="std"><a href="' . $_SERVER['PHP_SELF'] . '?download_sample=' . $task_id_s . '">download sample</a></td></tr> </table> </div> <h2>METADATA</h2>'; display_metadata($task_id, False); echo '<h2>ANALYSES</h2>'; display_task_analyses($task_id, False); }