-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD-old
55 lines (50 loc) · 1.42 KB
/
PKGBUILD-old
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Contributor: Thomas Mudrunka <harvie@@email..cz>
# You can also contact me on http://blog.harvie.cz/
pkgname=milw0rm-exploit-database
pkgver=1.0
pkgrel=1
pkgdesc="Milw0rm (Milworm) exploit database commandline frontend for updating and queriing as easy as (ex.): sudo milw0rm update; milw0rm search apache; milw0rm search port.80; sudo milw0rm usearch another.regexp; etc..."
arch=('any')
license=('GPL')
url="http://milw0rm.com/"
depends=()
build() {
mkdir -p ${pkgdir}/usr/bin
mkdir -p ${pkgdir}/opt/milw0rm
echo '
#!/bin/bash
#download, update and query local exploit database from milw0rm.com
#CopyLefted by Harvie 2oo9 (http://blog.harvie.cz/)
target_dir="/opt/milw0rm"
case "$1" in
update)
if [ $UID != 0 ]; then
echo 'You must run Milw0rm update as root!';
exit;
fi;
echo "Downloading exploit archive from Milw0rm..."
mkdir -p "$target_dir"
cd "$target_dir";
wget "http://www.milw0rm.com/sploits/milw0rm.tar.bz2"
echo "Extracting archive..."
tar jxpf milw0rm.tar.bz2
rm milw0rm.tar.bz2
cd milw0rm
;;
search)
cat "$target_dir/milw0rm/sploitlist.txt" | grep -i "$2" | while read line; do
echo "$target_dir/milw0rm/$line";
done;
;;
usearch)
$0 update
$0 search "$2"
;;
*)
echo "Local Milw0rm.com exploit database updater"
echo "Target directory: $target_dir"
echo "usage: $0 {update|search regexp|usearch regexp}"
esac
' > ${pkgdir}/usr/bin/milw0rm
chmod -R 655 ${pkgdir}/
}