updating call_srv
This commit is contained in:
@@ -29,7 +29,7 @@ function sort_hashes($inputFile) {
|
||||
// Close the file handle
|
||||
fclose($fileHandle);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Close the input file handle
|
||||
fclose($handle);
|
||||
|
||||
35
src/server/cyberhex-code/api/php/virus/notify_virus.php
Normal file
35
src/server/cyberhex-code/api/php/virus/notify_virus.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
//we need to auth the user => apikey
|
||||
//put auth code here afterwards
|
||||
include "../accessctrl/check_apikey.php";
|
||||
if(check_apikey()!==true){
|
||||
die("no_auth");
|
||||
}
|
||||
|
||||
//add the entry to the log db
|
||||
//this page has no gui, it may return ok or error
|
||||
if(!isset($_GET["machine_id"]) or !isset($_GET["hash"]) or !isset($_GET["path"]) or !isset($_GET["action"]))
|
||||
echo("syn_err");
|
||||
else{
|
||||
$hash=htmlspecialchars($_GET["hash"]);
|
||||
$path=htmlspecialchars($_GET["path"]);
|
||||
$machine_id=htmlspecialchars($_GET["machine_id"]);
|
||||
$action=htmlspecialchars($_GET["action"]);
|
||||
//include db pw
|
||||
include "../../../config.php";
|
||||
$conn = new mysqli($DB_SERVERNAME, $DB_USERNAME, $DB_PASSWORD, $DB_DATABASE);
|
||||
if ($conn->connect_error) {
|
||||
die("conn_err");
|
||||
}
|
||||
$sql = "INSERT INTO vir_notify (hash,machine_id,path,action) VALUES (?,?,?,?);";
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->bind_param("ssss", $hash,$machine_id,$path,$action);
|
||||
// Execute the statement
|
||||
if(!$stmt->execute())
|
||||
echo("wrt_err");
|
||||
else
|
||||
echo("wrt_ok");
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user