Created
April 29, 2020 14:28
-
-
Save c4mx/194e15c31355cda6de7e917c910c7015 to your computer and use it in GitHub Desktop.
Check a list of IP via VirusTotal API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#echo 'sleep 60s to begin...' | |
#sleep 60 | |
apikey='...virustotal_apikey...' | |
result_file='ip_vt_result.txt' | |
ip_file='ip_ext.txt' | |
ctr=0 | |
total=0 | |
for i in `cat $ip_file`;do | |
echo "###################################" \ | |
"\n""=> IP to query: $i" \ | |
"\n""###################################\n" >> $result_file | |
curl --request GET \ | |
--url "https://www.virustotal.com/vtapi/v2/ip-address/report?apikey=$apikey&ip=$i" 2>/dev/null | jq . | tee -a $result_file | |
let "ctr += 1" | |
let "total += 1" | |
echo "=> [$total] Queried ip: $i, counter: $ctr" | |
if ! (( $ctr % 4 ));then | |
ctr=0 | |
echo '=> sleeping 60s...' | |
sleep 60 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment