Example #1
0
}
if ($critsPlugin == True) {
    echo "<div id='critsButton'>Submit info to CRITs</div>";
    echo "<div id='remButton2'>REMnux Details</div>";
}
#		echo '<br/>';
echo '<div id="emailformat"><a href="./ticketgen.php" target="_blank">View in Plain Text</a></div>';
echo '</div>';
#End topbuttons div
#Show status of file submission
if (isset($_GET['tasub']) && $threatAnalyzerPlugin == True) {
    echo '<div id="subStatus">';
    if ($submission[1] == '200') {
        $command = '/submissions/' . $submission[1]['id'];
        $threatArgs = '';
        $subResp = @callTA($command, $threatAPI, $threatPage, $threatArgs);
        $threatArgs = '';
        $subDetails = json_decode($subResp[0], true);
        /*
         * Example JSON Response (Not used right now, but could be useful later):
         * submission
         * 		id:31,
         * 		state: "hash_worker_started",
         * 		created_at:"time",
         * 		updated_at:"time",
         * 		samples:
         * 			id
         * 			md5
         * 			sha1
         * 			file_location
         * 			sha256
Example #2
0
                    foreach ($taSubSandbox as $key => $val) {
                        $val = trim($val);
                        $postkey = 'submission[sandbox][custom_sandbox][]';
                        $postArray[$postkey] = $val;
                        #NOTE: I never did figure out how to pass more than one MAC correctly...
                    }
                } else {
                    $sandboxString = 'submission[sandbox][' . $taSubGroupOpt . '_id]';
                    $postArray[$sandboxString] = $taSubGroup;
                }
                #Set custom params
                if (isset($taSubCustomName)) {
                    $custNamePost = 'custom_param[' . $taSubCustomName . ']';
                    $postArray[$custNamePost] = $taSubCustomVal;
                }
                $response = @callTA($command, $threatAPI, $threatPage, $threatArgs, 1, $postArray);
                #1 means POST
                $threatArgs = '';
                if ($response[1] == '200') {
                    $message = 'Congratulations!  Your file was accepted and successfully submitted to ThreatAnalyzer.<br/><br/><b>RESPONSE: </b>' . $response[0];
                } else {
                    $message = 'Your file was accepted, but we were unable to successfully submit it to ThreatAnalyzer.<br/><br/><b>ERROR: </b>' . $response[0];
                }
            }
        }
    } else {
        //set that to be the returned message
        $message = 'Ooops!  Your upload triggered the following error:  ' . $_FILES['malware']['error'];
    }
}
//you get the following information for each file: