-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWaspScannerUtil.sh
23 lines (23 loc) · 992 Bytes
/
WaspScannerUtil.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
#Consider running sudo updatedb beforehand
echo "Cleaning up from last scan..."
echo "---"
rm -f ~/WaspScanPre.txt ~/WaspScanSort.txt ~/WaspScan.sh
echo "Finished cleaning. Now scanning..."
locate -i -e "*ld-*.so" | sed "/.gz$/d" > ~/WaspScanPre.txt
locate -i -e "*ld-*.so.*" | sed "/.gz$/d" >> ~/WaspScanPre.txt
sort -u ~/WaspScanPre.txt > ~/WaspScanSort.txt
perl -ne 'for$i(0..1){print}' ~/WaspScanSort.txt > ~/WaspScan.sh
sed -i "1~2s/^/echo 'scanning /" ~/WaspScan.sh
sed -i "1~2s/$/...'/" ~/WaspScan.sh
sed -i "2~2s/^/readelf -p .rodata /" ~/WaspScan.sh
sed -i '2~2s/$/ \| grep -q "\/etc\/ld\\.so\\.preload" \&\& \/bin\/echo -e "\\\e[32mnot vulnerable\\\e[0m" \|\| \/bin\/echo -e "\\\e[31mpotentially vulnerable\\\e[0m"/' ~/WaspScan.sh
if [[ $(id -u) -ne 0 ]]
then
sudo sh ~/WaspScan.sh
else
sh ~/WaspScan.sh
fi
echo "Done. Please inspect your terminal for potential vulnerabilities, though do disregard ones related to a missing file. This is normal."
echo "---"
exit