设为主页 销售咨询 客服电话  
   
 
 
 
 
常见恶意域名指向防护方法
2023-09-11

 主机被别人恶意解析原因在于: 1、主机有独立ip 2、网站在根目录 

解决方法: 1、不使用独立ip,别人就无法恶意解析。2、把网站放在子目录

一、恶意指向

目前存在一些用户将自己的域名解析指向他人的服务器,而那台服务器上事实并没有相应的站点,这种情况称之为恶意指向。但可能在服务器上设置了空主机头,访问这个域名时会直接访问指向了这个空主机头的站点内容,严重影响客户的备案工作。

为防止有效的恶意指向,对常见两种WEB服务器进行简单设置。

二、常见WEB服务器的解决方法

主要是绑定所有站点,禁用空主机头或默认站点,只能基于域名的访问方式,不使用基于IP,下面介绍IISAPACHE的设置方法。

1IIS的设置方法

IIS默认中,将任何站点都绑定到固定的域名,不可以留空主机头,这样没有绑定主机头的域名恶意指到此IP,默认会提示400错误,参考下图。

 

 
 

2Apache 的设置方法

Apache可以通过禁用第一个虚拟站点。

打开apache的配置文件,通常是httpd.conf文件,使用基于域名的访问方式。必须有下面的指令,Apache的第一个虚拟站点即为默认站点,必须对此站点进行限制。

设置第一个虚拟站点,设置一个禁止访问的站点,apache则会提示403的禁止访问的错误。

 
下面可以设置其它有效站点了
 
三、检查方法介绍

Linux系统下可通过命令wgetcurl,查看主机头信息,正常网站多为20030X等错误,停止或禁止访问的多为40X错误。

1、正常网站(200)

[root@hostname ~]#wget -S http://www.sina.com.cn curl -I http://www.sina.com.cn

--14:34:32--  http://www.sina.com.cn/

           => `index.html.1'

Resolving www.sina.com.cn... 61.172.201.194

Connecting to www.sina.com.cn|61.172.201.194|:80... connected.

HTTP request sent, awaiting response...

  HTTP/1.0 200 OK

  Date: Wed, 09 Dec 2009 06:30:15 GMT

  Server: Apache/2.0.54 (Unix)

  Last-Modified: Wed, 09 Dec 2009 06:29:44 GMT

……

2、跳转的网站(301)

[root@hostname ~]# wget -S http://www.abc.com curl -I http:// http://www.abc.com

--14:36:36--  http://www.abc.com/

           => `index.html.2'

Resolving www.abc.com... 199.181.132.250

Connecting to www.abc.com|199.181.132.250|:80... connected.

HTTP request sent, awaiting response...

  HTTP/1.1 301 Moved Permanently

  Date: Wed, 09 Dec 2009 06:54:25 GMT

  Server: Apache

  Location: http://abc.go.com/

  Content-Length: 226

  Connection: Keep-Alive

3、停止的网站(404)

[root@hostname ~]# wget -S http://sample.srt.cn

--14:38:14--  http://sample.srt.cn/

           => `index.html'

Resolving sample.srt.cn... 192.168.0.1

Connecting to sample.srt.cn|192.168.0.1|:80... connected.

HTTP request sent, awaiting response...

  HTTP/1.1 400 Bad Request

  Content-Type: text/html

  Date: Wed, 09 Dec 2009 06:36:34 GMT

  Connection: close

  Content-Length: 39

14:38:14 ERROR 400: Bad Request

4apache下禁止访问的站点(403)

[root@hostname ~]# wget -S http://sample1.srt.com.cn

--14:44:29--  http://sample1.srt.com.cn/

           => `index.html'

Resolving sample1.srt.com.cn... 1.2.3.234

Connecting to sample1.srt.com.cn|1.2.3.234|:80... connected.

HTTP request sent, awaiting response...

  HTTP/1.1 403 Forbidden

  Date: Wed, 09 Dec 2009 06:43:42 GMT

  Server: Apache/2.2.3 (Red Hat)

  Content-Length: 405

  Connection: close

  Content-Type: text/html; charset=iso-8859-1

14:44:29 ERROR 403: Forbidden.

   
 
   
 
安徽鸿奥软件有限公司
版权所有,翻版必究 ◎2007-2008copyright
皖ICP备17008567号-1
皖公网安备 34030002020793号