Rainie999 发表于 2018-8-19 14:48:41

shell 网络扫描

  #!/bin/sh
  [ -f tmp.txt ] && rm -fr tmp.txt
  while true
  do
  cat /var/log/httpd/access_log | awk '{print $1}'| sort | uniq -c >tmp.txt
  cat tmp.txt| while read line
  do
  pv=echo $line | awk '{print $1}'
  ipaddress=echo $line | awk '{print $2}'
  if [ "$pv" -gt 100 ]
  then
  iptables -I INPUT -s ${ipaddress}-j DROP
  

echo ${ipaddress}  

  fi
  done
  sleep 20
  done


页: [1]
查看完整版本: shell 网络扫描