honeyd/svcs.sh

Fri, 07 Sep 2012 19:08:07 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 07 Sep 2012 19:08:07 +0200
changeset 667
9dacbd1d1aa2
permissions
-rw-r--r--

Correct build configuration in Solaris subdir, correct english grammar,
remove irrelevant strip notice, introduce custom CFLAG logic, facilitate
use of Solaris Studio compiler with needed build configuration
adjustments, conditionally build 64 bit position independent code,
and accommodate tun(7) in newer Solaris releases by renaming driver
and module from conflicting 'tun' to 'vtun'. These changes include
some nonstandard 'I give up' logic causing out of tree builds by
manipulating the PATH, for example.

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