Skip to content

Instantly share code, notes, and snippets.

@cbanowsky
Last active June 2, 2018 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cbanowsky/b92d379dbdca82082b543eb8f97b3180 to your computer and use it in GitHub Desktop.
Save cbanowsky/b92d379dbdca82082b543eb8f97b3180 to your computer and use it in GitHub Desktop.
Virus check a file using the command line and VirusTotal
tansfercheck() {
if [ $# -eq 0 ];
then echo -e "No arguments specified. Usage:\n transfercheck /tmp/test.md\ncat /tmp/test.md | transfercheck test.md";
return 1;
fi
# write to output to tmpfile for progress bar
tmpfile=$( mktemp -t transferXXX)
if tty -s;
then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g');
curl -X PUT --progress-bar --upload-file $1 https://transfer.sh/$basefile/virustotal >> $tmpfile;
else curl -X PUT --progress-bar --upload-file "-" "https://transfer.sh/$1/virustotal" >> $tmpfile ;
fi
cat $tmpfile;
rm -f $tmpfile;
}
alias transfercheck=transfercheck
# Example usage:
# $ transfercheck suspicious.pdf
@sserrano44
Copy link

there is a typo in the function name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment