blob: ce74ba761228832a8b3bb9630d228f584c285a46 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/bin/bash
# Download, update and query local exploit database from exploit-db.com
target_dir="/usr/share/exploit-db"
case "$1" in
update)
if [ $UID != 0 ]; then
echo You must run exploit-db update as root!;
exit;
fi;
echo "Downloading exploit archive from exploit-db.com..."
mkdir -p "$target_dir"
cd "$target_dir";
wget "http://www.exploit-db.com/archive.tar.bz2"
echo "Extracting archive..."
tar jxpf archive.tar.bz2
rm archive.tar.bz2
chmod -R a+r *
;;
search)
cat "$target_dir/files.csv" | grep -i "$2" | while read line; do
echo $target_dir$(echo $line | sed -r 's/^[0-9]+,([^,]+),"([^"]*)",([0-9-]+),.*/\/opt\/exploit-db\/\1 \2 (\3)/')
done;
;;
usearch)
$0 update
$0 search "$2"
;;
*)
echo 'Local exploit-db.com exploit database tool by Deeno9 2010'
echo 'based on:'
echo ' Local Milw0rm.com exploit database tool by Harvie 2009 ( http://blog.harvie.cz/ )'
echo
echo "Target directory: $target_dir"
echo "usage: $0 {update|search regexp|usearch regexp}"
esac
|