统计黑ip的脚本】的更多相关文章

#!/bin/bash > ] do cd /var/openresty/nginx/logs#统计nginx日志,将结果重定向到文件blackip.txt中 cat access.log|grep '"POST /sys/submit_phone_validate_code.do HTTP/1.1" 403'|awk '{print $1}' | sort | uniq -c > blackip.txt echo "write in blackip.txt su…
比如现在需要对172.16.50.0/24网段的ip进行检查,检查哪些ip现在被占用,哪些ip没有被占用,可以通过ping命令来检查,脚本如下: [root@uatdns01 opt]# vim /opt/ping.sh #!/bin/bash . /etc/init.d/functions for var in {1..254}; do ip=172.16.50.$var ping -c2 $ip >/dev/null 2>&1 if [ $? = 0 ];then action &…
MySql 简单统计查询消耗时间脚本 by:授客 QQ:1033553122 drop procedure if exists selectTime; delimiter; create procedure selectTime() begin #变量定义 declare startTime datetime; declare endTime datetime; declare usedTime float; #时间赋值与查询 select now() into startTime; selec…
写了个爬虫代理ip的脚本给大家使用 一.代码 import requests from lxml.html import etree url = 'http://www.kuaidaili.com/free/' rp =requests.get(url) rp_html = etree.HTML(rp.text) #找xpath ip_xpath = '//*[@id="list"]/table/tbody/tr/td[1]/text()' port_xpath = '//*[@id=…
修改host指定域名指向ip,Windows脚本与Linux脚本 一,Windows系统修改hosts文件 Windows系统下hosts文件位置:C:\Windows\System32\drivers\etc\hosts 找到后右键编辑(如果提示无法编辑.权限不够.只读模式等,需要将hosts文件复制粘贴到桌面或者其他盘修改完再挪回来) 在hosts文件末尾追加编辑即可. 修改格式是 ip    域名 示例: 10.13.83.43 yun.xiong.cn10.13.83.43 web.xi…
1. 新建bat文件: 2. 将下面内容拷贝进bat文件: 3. 运行bat文件: @echo off color 00title IP切换脚本:start @echo --------------------------------- @echo IP模式:@echo 1.自动获取IP @echo 2.固定IP @echo --------------------------------- set /p sLocal=请选择: if %sLocal%==1 goto dhcp if %sLoc…
查看KVM宿主机上虚拟机的IP的脚本 #!/bin/bash #Auth:liucx #ping当前网段内在线的主机,以便产生arp记录. .{..};do { >& }& done #依次查找arp记录. running_vms=`virsh list |grep running` echo -ne "共有`echo "$running_vms"|wc -l`个虚拟机在运行.\n" for i in `echo "$running_…
前天没事写了一个防CC攻击的Shell脚本,没想到这么快就要用上了,原因是因为360网站卫士的缓存黑名单突然无法过滤后台,导致WordPress无法登录!虽然,可以通过修改本地hosts文件来解决这个问题,但是还是想暂时取消CDN加速和防护来测试下服务器的性能优化及安全防护. 前天写的Shell脚本是加入到crontab计划任务执行的,每5分钟执行一次,今天实际测试了下,可还是可以用的,但是感觉5分钟时间有点过长,无法做到严密防护.于是稍微改进了下代码,现在简单的分享下! 一.Shell代码  …
awk运算 awk以脚本方式运行 #!/bin/awk BEGIN{ arr[1]="maotai"; arr[2]="maotai" for(k in arr) print k,arr[k] } [root@n1 ~]# awk -f a.sh 1 maotai 2 maomao awk以命令行方法 [root@n1 ~]# awk 'BEGIN{arr[1]="maotai"; arr[2]="maotai";} END{…
lua脚本 local redis = require "resty.redis" local red = redis.new() red.connect(red, '127.0.0.1', '6379') local myIP = ngx.req.get_headers()["$remote_addr"] if myIP == nil then myIP = ngx.req.get_headers()["x_forwarded_for"] en…