diff options
Diffstat (limited to 'src/usr.bin/nc/scripts/iscan')
-rw-r--r-- | src/usr.bin/nc/scripts/iscan | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/usr.bin/nc/scripts/iscan b/src/usr.bin/nc/scripts/iscan deleted file mode 100644 index 237d6b0625..0000000000 --- a/src/usr.bin/nc/scripts/iscan +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | #! /bin/sh | ||
2 | # $OpenBSD: iscan,v 1.2 2001/01/29 01:58:12 niklas Exp $ | ||
3 | |||
4 | ## duplicate DaveG's ident-scan thingie using netcat. Oooh, he'll be pissed. | ||
5 | ## args: target port [port port port ...] | ||
6 | ## hose stdout *and* stderr together. | ||
7 | ## | ||
8 | ## advantages: runs slower than ident-scan, giving remote inetd less cause | ||
9 | ## for alarm, and only hits the few known daemon ports you specify. | ||
10 | ## disadvantages: requires numeric-only port args, the output sleazitude, | ||
11 | ## and won't work for r-services when coming from high source ports. | ||
12 | |||
13 | case "${2}" in | ||
14 | "" ) echo needs HOST and at least one PORT ; exit 1 ;; | ||
15 | esac | ||
16 | |||
17 | # ping 'em once and see if they *are* running identd | ||
18 | nc -z -w 9 "$1" 113 || { echo "oops, $1 isn't running identd" ; exit 0 ; } | ||
19 | |||
20 | # generate a randomish base port | ||
21 | RP=`expr $$ % 999 + 31337` | ||
22 | |||
23 | TRG="$1" | ||
24 | shift | ||
25 | |||
26 | while test "$1" ; do | ||
27 | nc -v -w 8 -p ${RP} "$TRG" ${1} < /dev/null > /dev/null & | ||
28 | PROC=$! | ||
29 | sleep 3 | ||
30 | echo "${1},${RP}" | nc -w 4 -r "$TRG" 113 2>&1 | ||
31 | sleep 2 | ||
32 | # does this look like a lamer script or what... | ||
33 | kill -HUP $PROC | ||
34 | RP=`expr ${RP} + 1` | ||
35 | shift | ||
36 | done | ||
37 | |||