honeyd/svcs.sh

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

michael@574 1 #! /bin/sh
michael@574 2 ##
michael@574 3 ## honeyd.service -- small honeyd(8) service faking script
michael@574 4 ## Copyright (c) 2003 The OpenPKG Project <http://www.openpkg.org/>
michael@574 5 ##
michael@574 6
michael@574 7 # honeyd(8) provides:
michael@574 8 # $HONEYD_PERSONALITY
michael@574 9 # $HONEYD_IP_SRC, $HONEYD_SRC_PORT
michael@574 10 # $HONEYD_IP_DST, $HONEYD_DST_PORT
michael@574 11
michael@574 12 service="$1"
michael@574 13 shift
michael@574 14
michael@574 15 case $service in
michael@574 16 http )
michael@574 17 line="true"
michael@574 18 while $line; do
michael@574 19 read line
michael@574 20 done
michael@574 21 echo "HTTP/1.1 404 Not Found"
michael@574 22 echo "Date: `date`"
michael@574 23 echo "Server: Apache"
michael@574 24 echo "Connection: close"
michael@574 25 echo "Content-Type: text/plain; charset=iso-8859-1"
michael@574 26 echo ""
michael@574 27 echo "Error: 404 Not Found"
michael@574 28 exit 0
michael@574 29 ;;
michael@574 30 ssh )
michael@574 31 echo "SSH-1.5-2.40"
michael@574 32 read line
michael@574 33 echo "Protocol mismatch."
michael@574 34 exit 0
michael@574 35 ;;
michael@574 36 esac
michael@574 37

mercurial