我有一个包含多个md5散列的散列文件。我想创建一个bash脚本来curl virustotal,以检查散列是否已知。
#!/bin/bash
for line in "hash.txt";
do
echo $line; curl -s -X GET --url 'https://www.virustotal.com/vtapi/v2/file/report?apikey=a54237df7c5c38d58d2240xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc0a0d7&resource='$line'';
done但不起作用。
你能帮我个忙吗?
发布于 2020-10-15 22:31:26
最好使用while循环。您的for循环将只运行一次,因为bash将其解释为一个值,而不是一个文件。试试这个:
while read -r line; do
echo "$line"
curl -s -X GET --url "https://www.virustotal.com/vtapi/v2/file/report?apikey=a54237df7c5c38d58d2240xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxcc0a0d7&resource=$line"
done <"/path/to/hash.txt"https://stackoverflow.com/questions/64372397
复制相似问题