updating databnase to handle yara rules

This commit is contained in:
jakani24
2024-04-01 11:21:56 +02:00
parent 4b2954be0c
commit 29aebe5fda
3 changed files with 80 additions and 6 deletions

View File

@@ -42,7 +42,7 @@ function sort_hashes($inputFile, $excluded) {
}
function download_files($excluded){
//download from virusshare
/*$file_count=485;
$file_count=485;
for($i=0;$i<$file_count;$i++){
$fileNumber = sprintf('%05d', $i);
$url="https://virusshare.com/hashfiles/VirusShare_$fileNumber.md5";
@@ -58,7 +58,7 @@ function download_files($excluded){
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$fileContents = curl_exec($ch);
file_put_contents("/var/www/html/database_srv/buf.md5", $fileContents);
sort_hashes("/var/www/html/database_srv/buf.md5", $excluded);*/
sort_hashes("/var/www/html/database_srv/buf.md5", $excluded);
//download yara rules
$url="https://jakach.duckdns.org/cyberhex/yara/yara.zip";
$ch = curl_init($url);
@@ -154,7 +154,7 @@ $files = glob($directory . '/*');
foreach ($files as $file) {
// Check if the file is a regular file (not a directory)
if (is_file($file)) {
//unlink($file);
unlink($file);
}
}
set_time_limit(0);