summaryrefslogtreecommitdiff
path: root/src/usr.bin/nc/scripts/bsh
diff options
context:
space:
mode:
authorderaadt <>1996-09-05 08:55:43 +0000
committerderaadt <>1996-09-05 08:55:43 +0000
commitc7823c0917675fd1ab482937ee1bd01d837b081c (patch)
treede25439975bbe0baac0f70799dad301539b7be3b /src/usr.bin/nc/scripts/bsh
parentc215a9e8412ead0190b788622f09bcdbb08794fa (diff)
downloadopenbsd-c7823c0917675fd1ab482937ee1bd01d837b081c.tar.gz
openbsd-c7823c0917675fd1ab482937ee1bd01d837b081c.tar.bz2
openbsd-c7823c0917675fd1ab482937ee1bd01d837b081c.zip
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 'src/usr.bin/nc/scripts/bsh')
-rw-r--r--src/usr.bin/nc/scripts/bsh29
1 files changed, 29 insertions, 0 deletions
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 @@
1#! /bin/sh
2## a little wrapper to "password" and re-launch a shell-listener.
3## Arg is taken as the port to listen on. Define "NC" to point wherever.
4
5NC=nc
6
7case "$1" in
8 ?* )
9 LPN="$1"
10 export LPN
11 sleep 1
12 echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 &
13 echo "launched on port $LPN"
14 exit 0
15 ;;
16esac
17
18# here we play inetd
19echo "-l -p $LPN -e $0" | $NC > /dev/null 2>&1 &
20
21while read qq ; do
22case "$qq" in
23# here's yer password
24 gimme )
25 cd /
26 exec csh -i
27 ;;
28esac
29done