jesobreira

Virustotal bash script

Feb 13th, 2015
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #/bin/bash
  2. # This script was created because I am not happy with any standalone anti-virus software for *nix. It uses virustotal to scan files with multiple antivirus softwares
  3. #
  4. #The following command uploads every file that is less than 128MB and greater than 0B in size to virustotal. The command is run with sudo in a detached screen, and everything is logged to /var/log/virustotal.log
  5. sudo screen -m -d find / -type f -size -128M -size +0c -exec sh -c 'curl --progress-bar -F file="@{}" https://www.virustotal.com/en/file/upload/ -L | grep -E '"'detection-ratio|href.*analysis' | sed -e '"'s/.*href="\([^"]*\)".*/https:\/\/www.virustotal.com\1/'"' | sed -e 's/.*> \([0-9]*\)\/.*/\1 detections/' | while read line; do echo "'"$line - {}"'"; done | tee -a /var/log/virustotal.log" \;
  6. #The following command lists all detections that are currently listed in /var/log/virustotal.log
  7. grep -A1 '^[1-9]' /var/log/virustotal.log
Add Comment
Please, Sign In to add comment