首页 > 其他 > 详细

批量Tcping ip 加 端口

时间:2018-10-10 13:54:07      阅读:430      评论:0      收藏:0      [点我收藏+]
1、整理好待测试的目标IP 及对应端口号,存为本地文本文件
183.61.160.67 10024
183.61.160.74 10009
119.147.128.173 10006
183.61.160.84 10011
119.147.107.203 10013
183.61.160.67 10015
183.61.160.58 10016
183.61.160.56 10010
183.61.160.74 10018
183.61.160.121 10015
youxi1

2、安装好tcping工具
Tcping 相关参数
tcping, (C) 2003 folkert@vanheusden.com

-h hostname hostname (e.g. localhost)
-p portnr portnumber (e.g. 80)
-c count how many times to connect
-i interval delay between each connect
-f flood connect (no delays)
-q quiet, only returncode

3、Shell 编写

#!/bin/bash
i=/home/admin/test/youxi1
cat $i |
while read line
do
host=echo $line | awk -F ‘ ‘ ‘{print $1}‘
port=echo $line | awk -F ‘ ‘ ‘{print $2}‘
tcping -h $host -p $port -c 10 -i 0.5
done

保存为 tcping.sh

4、执行 bash tcping.sh

批量Tcping ip 加 端口

原文:http://blog.51cto.com/lihongweibj/2298153

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!