让IE8上网无限制

  

  

『河马』IE8上网无限制工具.rar

 

我们会经常遇到一个问题,在使用IE8,IE7,IE6上网时,有时出现你的浏览器版本低,需要更新的提示信息,造成我们无法正常上网,要不就更新IE到10,要不就使用chrome,firefox等浏览器,这样问题是解决了,也能够上网了,但是我还是希望能使用IE8来上网,因为用着习惯或网银只支持IE8,下面来带大家突破下。
 首先要了解web服务器是怎么知道我们使用的是IE8呢?经过分析HTTP协议,发现所有的数据请求没什么变化,IE8和chrome比较,它们的不同就在于User-Agent不同,下面是截图,比较直观。
GET /browserwarning.php HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/x-silverlight, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MyIE2; CNCDialer; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Cookie: zbx_sessionid=140947690dd2245c5fd5489b323c3fb8

 

1
GET / HTTP/1.1
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.0 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: zh-CN,zh;q=0.8
Cookie: zbx_sessionid=5c2966af200df29841b4e42b8de260af

 

2
 到了这里我们就弄明白了,只要把IE8的User-Agent替换成Chrome的就行了,这样web服务器会把IE8当做chrome浏览器来识别。所以IE8上网无限制了。怎样修改IE8的User-Agent呢?Firefox,chrome这些浏览器会有插件或者本身就提供修改User-Agent的功能,IE8在设置里找了半天,没找到,最后发现在注册表里有相关信息,改注册表就行了。
   下面是一个正常IE8请求

 

 

GET / HTTP/1.1
Accept: */*
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MyIE2; CNCDialer; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive
Cookie: BAIDUID=0386E6F41A6C7AB6642829D0B3A36EC2:FG=1; BIDUPSID=03A5BE7FE8CB1FDDCCBE5C0D7DFB095C; PSTM=1453293454

 

 

User-Agent部分为
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MyIE2; CNCDialer; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
这些信息在注册表里分多部分对应,我们先看上面括号里面的compatible; MSIE 6.0; Windows NT 5.1; SV1 字符串,在注册表中的路径为HKEY_USERS\S-1-5-21-1993962763-606747145-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform。如图3
 
3
User-Agent字符串中
 .NET CLR 2.0.50727;
 .NET CLR 3.0.04506.30;
 .NET CLR 3.0.4506.2152;
 .NET CLR 3.5.30729;
 .NET4.0C;
 .NET4.0E
对应的注册表路径为HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform,如图4
4
User-Agent字符串中 compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MyIE2; CNCDialer对应的注册表项为HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent,默认在注册表中没有数据,如图5
 
5
 到了这里我已经把IE8的User-Agent相关信息分析完了,我们要伪装成chrome浏览器就很容易了,下面是注册表文件的内容,
Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent]
@="Mozilla/5.0"
"Compatible"=""
"Version"="5.1"
"Platform"="Windows NT 5.1"
 
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform]
".NET CLR 2.0.50727"=""
".NET CLR 3.0.04506.30"=""
".NET CLR 3.0.4506.2152"=""
".NET CLR 3.5.30729"=""
".NET4.0C"=""
".NET4.0E"=""
 
[HKEY_USERS\S-1-5-21-1993962763-606747145-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform]
"AppleWebKit/537.36 (KHTML, like Gecko)"=""
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform]
"Chrome/37.0.2062.0 Safari/537.36"=""
把上面的信息保存为modify_ua.reg文件,双击导入注册表中就可以了。为了方便我使用delphi开发了一个工具,界面如下图
6
使用默认的IE设置和点击工具中的[IE伪装为Chrome]按钮,打开http://www.isafe.cc,前后比较效果图,如图7,图8
7
8
工具的核心源代码也分享一下:

 

 

procedure TForm1.btnMyIsChromeClick(Sender: TObject);
var
 reg:TRegistry;
begin
 reg:=TRegistry.Create();
 try
    reg.RootKey:=HKEY_LOCAL_MACHINE;
    if reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent',False) then
    begin
      reg.WriteString('Compatible','5.0');
      reg.WriteString('Version','5.1');
      reg.WriteString('Platform','Windows NT 5.1');
    end;
    reg.CloseKey;
    reg.DeleteKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform');
    if reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform',True) then
    begin
       reg.WriteString('Chrome/37.0.2062.0 Safari/537.36','');
    end;
    reg.CloseKey;
    reg.RootKey:=HKEY_USERS;
    reg.DeleteKey('S-1-5-21-1993962763-606747145-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform');
    if reg.OpenKey('S-1-5-21-1993962763-606747145-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform',True) then
    begin
      reg.WriteString('AppleWebKit/537.36 (KHTML, like Gecko)','');
    end;
    reg.CloseKey;
 finally
    reg.Free;
 end;
end;
 
procedure TForm1.btnMyIsIEClick(Sender: TObject);
var
 reg:TRegistry;
begin
 reg:=TRegistry.Create();
 try
    reg.RootKey:=HKEY_LOCAL_MACHINE;
    reg.DeleteKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent');
    if reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\5.0\User Agent\Post Platform',True) then
    begin
       reg.WriteString('.NET CLR 2.0.50727','');
       reg.WriteString('.NET CLR 3.0.04506.30','');
       reg.WriteString('.NET CLR 3.0.4506.2152','');
       reg.WriteString('.NET CLR 3.5.30729','');
       reg.WriteString('.NET CLR 2.0.50727','');
       reg.WriteString('.NET4.0C','');
       reg.WriteString('.NET4.0E','');
    end;
    reg.CloseKey;
    reg.RootKey:=HKEY_USERS;
    reg.DeleteKey('S-1-5-21-1993962763-606747145-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform');
    if reg.OpenKey('S-1-5-21-1993962763-606747145-725345543-500\Software\Microsoft\Windows\CurrentVersion\Internet Settings\User Agent\Post Platform',True) then
    begin
      reg.WriteString('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)','');
    end;
    reg.CloseKey;
 finally
    reg.Free;
 end;
 
end;

 

 

 


[本日志由 admin 于 2016-12-10 06:44 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: 小工具
评论: 0 | 引用: 0 | 查看次数: 507
发表评论
昵 称:
密 码: 游客发言不需要密码.
验证码: 验证码
内 容:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 1000 字 | UBB代码 开启 | [img]标签 关闭