diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-05 08:55:44 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-05 08:55:44 +0000 |
commit | 74ce25b78fd53d753084ef14b2234bc105a4a983 (patch) | |
tree | 2cffc06e2eb76342240043e73120bb5451145124 /usr.bin/nc/scripts/bsh | |
parent | e70074aa65073a222e5a14ec65e7c499c313ba3d (diff) |
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.
Diffstat (limited to 'usr.bin/nc/scripts/bsh')
-rw-r--r-- | usr.bin/nc/scripts/bsh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/usr.bin/nc/scripts/bsh b/usr.bin/nc/scripts/bsh new file mode 100644 index 00000000000..796e480354a --- /dev/null +++ b/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 |