Commit | Line | Data |
---|---|---|
209feeb0 H |
1 | # Contributor: Thomas Mudrunka <harvie@@email..cz> |
2 | # You can also contact me on http://blog.harvie.cz/ | |
3 | ||
4 | pkgname=milw0rm-exploit-database | |
5 | pkgver=1.0 | |
6 | pkgrel=1 | |
7 | 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..." | |
8 | arch=('any') | |
9 | license=('GPL') | |
10 | url="http://milw0rm.com/" | |
11 | depends=() | |
12 | ||
13 | build() { | |
14 | mkdir -p ${pkgdir}/usr/bin | |
15 | mkdir -p ${pkgdir}/opt/milw0rm | |
16 | ||
17 | echo ' | |
18 | #!/bin/bash | |
19 | #download, update and query local exploit database from milw0rm.com | |
20 | #CopyLefted by Harvie 2oo9 (http://blog.harvie.cz/) | |
21 | target_dir="/opt/milw0rm" | |
22 | ||
23 | case "$1" in | |
24 | update) | |
25 | if [ $UID != 0 ]; then | |
26 | echo 'You must run Milw0rm update as root!'; | |
27 | exit; | |
28 | fi; | |
29 | echo "Downloading exploit archive from Milw0rm..." | |
30 | mkdir -p "$target_dir" | |
31 | cd "$target_dir"; | |
32 | wget "http://www.milw0rm.com/sploits/milw0rm.tar.bz2" | |
33 | echo "Extracting archive..." | |
34 | tar jxpf milw0rm.tar.bz2 | |
35 | rm milw0rm.tar.bz2 | |
36 | cd milw0rm | |
37 | ;; | |
38 | search) | |
39 | cat "$target_dir/milw0rm/sploitlist.txt" | grep -i "$2" | while read line; do | |
40 | echo "$target_dir/milw0rm/$line"; | |
41 | done; | |
42 | ;; | |
43 | usearch) | |
44 | $0 update | |
45 | $0 search "$2" | |
46 | ;; | |
47 | *) | |
48 | echo "Local Milw0rm.com exploit database updater" | |
49 | echo "Target directory: $target_dir" | |
50 | echo "usage: $0 {update|search regexp|usearch regexp}" | |
51 | esac | |
52 | ' > ${pkgdir}/usr/bin/milw0rm | |
53 | ||
54 | chmod -R 655 ${pkgdir}/ | |
55 | } |