短连接
简述
短连接是相对于长连接而言的概念,指的是在数据传送过程中,只在需要发送数据时,才去建立一个连接,数据发送完成后,则断开此连接,即每次连接只完成一项业务的发送。 在系统维护中,一般很难去察觉,需要借助网络安全设备或者抓包分析,才能够去发现。
脚本
#!/bin/bash
ip=118.184.15.40
i=1
while:
do
tmp=netstat -anplt|grep $ip|awk -F'[/]''{print $1}'|awk '{print $7}'
#echo $tmp
iftest -z"$tmp"
then
((i=i+1))
else
forpid in$tmp; do
echo"PID: "${pid}
result=`ls -lh /proc/$pid|grep exe`
echo"Process: "${result}
kill-9$pid
done
break
fi
done
echo "Total number of times: "${i}
Last updated
Was this helpful?