我试图创建一个PHP脚本,当有人点击一个按钮时,它将被调用,并将被带到vt.php
现在我想下载基于VT散列的示例,这是从以前的PHP页面收到的,现在我尝试使用这个逻辑,但它不起作用。在
<?php
$fileHash = $_POST['hash'];
echo $fileHash;
#$command = escapeshellcmd("python vt_download.py $fileHash");
$command = escapeshellcmd("curl -v --location https://www.virustotal.com/vtapi/v2/file/download?apikey=APIKEY\&hash=$fileHash -o $fileHash");
$output = shell_exec($command);
echo $output;
?>
输出 C75B5E2CA63ADB462F4B941E0C9F509
预期输出 C75B5E2CA63ADB462F4B941E0C9F509 文件下移过程-----curl输出
当调用此页时,它只打印哈希而不下载文件。任何解决这个问题的建议?在
注意:Error in downloading file from VirusTotal only on server?——前面在这里问过这个问题,使用python这个或那个都会有帮助。在
您可以直接使用PHP cURL library,而不是使用
shell_exec
函数,这会在使用用户输入的数据时迅速导致安全问题。在相关问题 更多 >
编程相关推荐