반응형
https://github.com/linuxias/MyBox/blob/master/script/portscan.sh
12345678910111213141516171819 #!/bin/bashIP=127.0.0.1first_port=$1last_port=$2function usage() {echo "Script for scanning port"echo "Usage : ./portscan start_port end_port"echo "Example : ./portscan 1 100"exit}if [ $# -ne 2 ]thenusagefifor port in `seq $first_port $last_port`do(echo >/dev/tcp/$IP/$port)> /dev/null 2>&1 && echo $port open || echo "$port closed"donecs
반응형
'Linux > Shell Script' 카테고리의 다른 글
expect - programmed dialogue with interactive programs (3) | 2018.04.27 |
---|---|
[참고용] test 명령어 표현식 (0) | 2015.04.25 |