rapid7-lshd-test 375 Bytes
Newer Older
Niels Möller's avatar
Niels Möller committed
1
2
#! /bin/sh

3
4
if [ -z "$srcdir" ] ; then
  srcdir=`pwd`
Niels Möller's avatar
Niels Möller committed
5
6
fi

7
. $srcdir/functions.sh
Niels Möller's avatar
Niels Möller committed
8

9
10
need_tcputils

11
PORT=5555
Niels Möller's avatar
Niels Möller committed
12

13
werror "Testing lshd"
Niels Möller's avatar
Niels Möller committed
14

15
spawn_lshd
Niels Möller's avatar
Niels Möller committed
16

17
for f in $srcdir/rapid7-ssh-pdu/*.pdu ; do
Niels Möller's avatar
Niels Möller committed
18
    werror "Testing $f"
19
    tcpconnect localhost $PORT < "$f" > /dev/null \
Niels Möller's avatar
Niels Möller committed
20
21
	|| die "Connect failed"

22
    kill -0 `cat $PIDFILE` || die "Server died"
Niels Möller's avatar
Niels Möller committed
23
24
done

Niels Möller's avatar
Niels Möller committed
25
werror "Test done"
Niels Möller's avatar
Niels Möller committed
26

27
test_success