利用windows hosts文件实现URL重定向

windows在解析一个URL时,首先会检查 %systemroot%/system32/drivers/etc/hosts文件(2K,XP),查找与目标URL匹配的IP地址,如果没有,才会向DNS Server查询。能过修改hosts文件,可以将目标URL重定向到一个虚假或恶意位置。

 

host 文件内容如下:

 

# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

127.0.0.1       localhost

 

试验:

加入 192.168.0.1 www.test.com


在IE地址栏输入www.test.com,回车. 192.168.0.1上的Serv-U登录界面就出来了。。

 

阅读更多
个人分类: windows
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭