1 # Contributor: fnord0 <fnord0 AT riseup DOT net>
6 pkgdesc="icmpsh is a simple reverse ICMP shell with a win32 slave and a POSIX compatible master in C, Perl or Python"
8 url=("http://github.com/inquisb/icmpsh")
11 makedepends=('git' 'gcc')
12 optdepends=('perl: required to use the perl master server'
13 'perl-netpacket: required to use the perl master server'
14 'perl-net-rawip: required to use the perl master server'
15 'python2: required to use the python2 master server'
16 'impacket: required to use the python2 master server'
17 'mingw32-gcc: required to build icmpsh win32 C slave on linux'
18 'mingw32-w32api: required to build icmpsh win32 C slave on linux')
19 _gitroot=("http://github.com/inquisb/icmpsh.git")
26 if [ -d ${srcdir}/${_gitname} ] ; then
27 msg "Git checkout: Updating existing tree"
28 cd ${_gitname} && git pull origin || return 1
29 msg "Git checkout: Tree has been updated"
31 msg "Git checkout: Retrieving sources"
32 git clone ${_gitroot} || return 1
34 msg "Checkout completed"
37 rm -rf ${srcdir}/${_gitname}-build
38 cp -r ${srcdir}/${_gitname} ${srcdir}/${_gitname}-build
39 cd ${srcdir}/${_gitname}-build
41 gcc -o icmpsh-m icmpsh-m.c || return 1
42 #check if i486-mingw32-gcc and winsock2.h exist, if so compile the C-based slave on linux
43 if [ -f /usr/bin/i486-mingw32-gcc ] && [ -f /usr/i486-mingw32/include/winsock2.h ]; then
44 i486-mingw32-gcc -o icmpsh-s icmpsh-s.c -lwsock32 || return 1
46 #archlinux python2 fix
47 sed -i 's|python$|python2|g' icmpsh_m.py || return 1
50 cd ${srcdir}/${_gitname}-build
51 install -d ${pkgdir}/usr/src/${_gitname} || return 1
52 install -d ${pkgdir}/usr/bin || return 1
53 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh-m.c \
54 ${pkgdir}/usr/src/${_gitname} || return 1
55 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh-m \
56 ${pkgdir}/usr/src/${_gitname} || return 1
57 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh-s.c \
58 ${pkgdir}/usr/src/${_gitname} || return 1
59 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh-s \
60 ${pkgdir}/usr/src/${_gitname} || return 1
61 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh-m.pl \
62 ${pkgdir}/usr/src/${_gitname} || return 1
63 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh_m.py \
64 ${pkgdir}/usr/src/${_gitname} || return 1
65 install -Dm755 ${srcdir}/${_gitname}-build/icmpsh.exe \
66 ${pkgdir}/usr/src/${_gitname} || return 1
67 ln -s /usr/src/${_gitname}/icmpsh-m.pl \
68 ${pkgdir}/usr/bin/icmpsh-m.pl || return 1
69 ln -s /usr/src/${_gitname}/icmpsh_m.py \
70 ${pkgdir}/usr/bin/icmpsh_m.py || return 1
71 ln -s /usr/src/${_gitname}/icmpsh-m \
72 ${pkgdir}/usr/bin/icmpsh-m || return 1
73 install -Dm644 README \
74 ${pkgdir}/usr/src/${_gitname}/README || return 1
75 cp -R screenshots ${pkgdir}/usr/src/${_gitname} || return 1