📄 iscan.sh
字号:
#! /bin/sh## Duplicate DaveG's ident-scan thingie using netcat. Oooh, he'll be p*ssed.## Args: target port [port port port ...]## Hose stdout _and_ stderr together.#### Advantages: runs slower than ident-scan, giving remote inetd less cause##+ for alarm, and only hits the few known daemon ports you specify.## Disadvantages: requires numeric-only port args, the output sleazitude,##+ and won't work for r-services when coming from high source ports.# Script author: Hobbit <hobbit@avian.org># Used in ABS Guide with permission.# ---------------------------------------------------E_BADARGS=65 # Need at least two args.TWO_WINKS=2 # How long to sleep.THREE_WINKS=3IDPORT=113 # Authentication "tap ident" port.RAND1=999RAND2=31337TIMEOUT0=9TIMEOUT1=8TIMEOUT2=4# ---------------------------------------------------case "${2}" in "" ) echo "Need HOST and at least one PORT." ; exit $E_BADARGS ;;esac# Ping 'em once and see if they *are* running identd.nc -z -w $TIMEOUT0 "$1" $IDPORT || \{ echo "Oops, $1 isn't running identd." ; exit 0 ; }# -z scans for listening daemons.# -w $TIMEOUT = How long to try to connect.# Generate a randomish base port.RP=`expr $$ % $RAND1 + $RAND2`TRG="$1"shiftwhile test "$1" ; do nc -v -w $TIMEOUT1 -p ${RP} "$TRG" ${1} < /dev/null > /dev/null & PROC=$! sleep $THREE_WINKS echo "${1},${RP}" | nc -w $TIMEOUT2 -r "$TRG" $IDPORT 2>&1 sleep $TWO_WINKS# Does this look like a lamer script or what . . . ?# ABS Guide author comments: "Ain't really all that bad . . .#+ kinda clever, actually." kill -HUP $PROC RP=`expr ${RP} + 1` shiftdoneexit $?# Notes:# -----# Try commenting out line 30 and running this script#+ with "localhost.localdomain 25" as arguments.# For more of Hobbit's 'nc' example scripts,#+ look in the documentation:#+ the /usr/share/doc/nc-X.XX/scripts directory.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -