Created
March 30, 2018 18:51
-
-
Save extremecoders-re/09b3ad5e5f8eee7163029ffb1414ad54 to your computer and use it in GitHub Desktop.
Comodo manual updater (Incomplete)
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
#!/usr/bin/sh | |
echo "[+] Checking for updates..." | |
path_bases_cav="/c/Program Files/COMODO/COMODO Internet Security/scanners/bases.cav" | |
update_url="http://cdn.download.comodo.com/av/updates58/sigs/bases/bases.cav" | |
hash_check () { | |
# Download first 256 bytes (after header) of remote stream | |
tmp_first_256_remote=`mktemp` | |
start=16 | |
stop=802400 | |
curl --silent -r $start-$stop -o $tmp_first_256_remote $update_url | |
md5_first_256_remote=$(md5sum $tmp_first_256_remote | \ | |
cut -d " " -f 1) | |
md5_first_256_system=$(dd if="$path_bases_cav" skip=$start bs=1 count=$((stop-start+1)) 2>/dev/null | \ | |
md5sum | \ | |
cut -d " " -f 1) | |
echo $md5_first_256_remote | |
echo $md5_first_256_system | |
} | |
system_cav_size=$(du -b "$path_bases_cav" | \ | |
cut -d $'\t' -f 1) | |
remote_cav_size=$(curl --silent --head $update_url | \ | |
grep "Content-Length:" | \ | |
cut -d " " -f 2) | |
printf "[+] System bases.cav filesize = %d bytes\n" $system_cav_size | |
printf "[+] Remote bases.cav filesize = %d bytes\n" $remote_cav_size | |
if [ $remote_cav_size -gt $system_cav_size ] | |
then | |
echo "[+] Updates detected" | |
hash_check | |
else | |
echo "[+] No updates found" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment