设为首页收藏本站

追梦Linux

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 313|回复: 0

利用$host 封指定的域名

[复制链接]

30

主题

39

帖子

2万

积分

CEO

Rank: 9Rank: 9Rank: 9

积分
25284

最佳新人活跃会员热心会员推广达人宣传达人灌水之王突出贡献优秀版主荣誉管理论坛元老

QQ
发表于 2017-10-28 15:03:02 | 显示全部楼层 |阅读模式
域名被攻击,借此使用nignx 自带的rewrite 功能封掉该域名,在虚拟机的server 配置段下做如下配置:
```
    if ($host !~ ".*yunbofun.com") {
        return 444;
    }
```
重载下nginx ,观察日志:
[root@soa-prod-admin-glb-010177210101 /home/liujiangbo]  130
tail -f /data/nginx/logs/spider_2017-10-28.log
14.161.3.181 - - [28/Oct/2017:19:42:52 +0800] "GET http://www.yunbofun.com/ HTTP/1.1" "-" "-"444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" "-"0.000 -
14.161.3.181 - - [28/Oct/2017:19:42:52 +0800] "GET http://www.yunbofun.com/ HTTP/1.1" "-" "-"444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" "-"0.000 -
14.161.3.181 - - [28/Oct/2017:19:42:52 +0800] "GET http://www.yunbofun.com/ HTTP/1.1" "-" "-"444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" "-"0.000 -
14.161.3.181 - - [28/Oct/2017:19:42:52 +0800] "GET http://www.yunbofun.com/ HTTP/1.1" "-" "-"444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" "-"0.000 -
14.161.3.181 - - [28/Oct/2017:19:42:52 +0800] "GET http://www.yunbofun.com/ HTTP/1.1" "-" "-"444 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0" "-"0.000 -

QQ|小黑屋|手机版|Archiver|追梦Linux ( 粤ICP备14096197号  点击这里给我发消息

GMT+8, 2019-7-17 16:17 , Processed in 0.340822 second(s), 32 queries .

Powered by 追梦Linux! X3.3 Licensed

© 2015-2017 追梦Linux!.

快速回复 返回顶部 返回列表