From c7823c0917675fd1ab482937ee1bd01d837b081c Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Thu, 5 Sep 1996 08:55:43 +0000 Subject: nc is *hobbit*'s netcat; let the sysadm have the same tools the crackers have, so that he may learn what the network is about and protect it better. --- src/usr.bin/nc/scripts/bsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/usr.bin/nc/scripts/bsh (limited to 'src/usr.bin/nc/scripts/bsh') diff --git a/src/usr.bin/nc/scripts/bsh b/src/usr.bin/nc/scripts/bsh new file mode 100644 index 0000000000..796e480354 --- /dev/null +++ b/src/usr.bin/nc/scripts/bsh @@ -0,0 +1,29 @@ +#! /bin/sh +## a little wrapper to "password" and re-launch a shell-listener. +## Arg is taken as the port to listen on. Define "NC" to point wherever. + +NC=nc + +case "$1" in + ?* ) + LPN="$1" + export LPN + sleep 1 + echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 & + echo "launched on port $LPN" + exit 0 + ;; +esac + +# here we play inetd +echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 & + +while read qq ; do +case "$qq" in +# here's yer password + gimme ) + cd / + exec csh -i + ;; +esac +done -- cgit v1.2.3-55-g6feb