19 lines
356 B
Bash
19 lines
356 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
fichiers=$(find / -perm -4000 2> /dev/null)
|
||
|
|
||
|
for f in $fichiers
|
||
|
do
|
||
|
if [ -z "$(sqlite3 suidchecker.db "SELECT chemin FROM fichier WHERE
|
||
|
chemin='$f';")" ]
|
||
|
then
|
||
|
checksum=$(cksum $f | cut -d' ' -f 1)
|
||
|
taille=$(cksum $f | cut -d' ' -f 2)
|
||
|
|
||
|
sqlite3 suidchecker.db "INSERT INTO fichier VALUES('$f',
|
||
|
$checksum, $taille);"
|
||
|
|
||
|
echo $f
|
||
|
fi
|
||
|
done
|