diff options
author | Upstream <upstream-import@none> | 1970-01-12 13:46:40 +0000 |
---|---|---|
committer | Upstream <upstream-import@none> | 1970-01-12 13:46:40 +0000 |
commit | d102598c3989239d749b86b0f49fa54554f54402 (patch) | |
tree | a567c6b8ee7da3d0bb6f677a9bd50bf5c06e469e /scripts/bsh | |
download | netcat-d102598c3989239d749b86b0f49fa54554f54402.tar.gz |
external/netcat 110upstream/110
Diffstat (limited to 'scripts/bsh')
-rwxr-xr-x | scripts/bsh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/bsh b/scripts/bsh new file mode 100755 index 0000000..796e480 --- /dev/null +++ b/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 |