惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
罗磊的独立博客
SecWiki News
SecWiki News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
IT之家
IT之家
博客园 - 聂微东
T
The Exploit Database - CXSecurity.com
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Vercel News
Vercel News
G
GRAHAM CLULEY
D
DataBreaches.Net
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
SegmentFault 最新的问题
博客园_首页
雷峰网
雷峰网
T
Tenable Blog
Spread Privacy
Spread Privacy
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Cisco Talos Blog
Cisco Talos Blog
V
Visual Studio Blog
J
Java Code Geeks
博客园 - Franky
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
C
CERT Recently Published Vulnerability Notes
T
Threatpost
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
Recent Announcements
Recent Announcements
Blog — PlanetScale
Blog — PlanetScale
Security Latest
Security Latest
U
Unit 42
M
MIT News - Artificial intelligence
Y
Y Combinator Blog
K
Kaspersky official blog
有赞技术团队
有赞技术团队
B
Blog
腾讯CDC

博客园 - 程序员海风

cef加载flash的办法 一个高性能的对象属性复制类,支持不同类型对象间复制,支持Nullable<T>类型属性 php检测php.ini是否配制正确 openwrt的路由器重置root密码 windows 7 + vs2010 sp1编译 x64位版qt4 解决SourceGrid在某些系统上无法用鼠标滚轮滚动的问题 判断一个点是否在多边形内部,射线法思路,C#实现 [转载]使用HttpWebRequest进行请求时发生错误:基础连接已关闭,发送时发生错误处理 让Dapper+SqlCE支持ntext数据类型和超过4000字符的存储 通过WMI - Win32_Processor - ProcessorId获取到的并不是CPU的序列号,也并不唯一 DataGridView中设置固定行高 csExWB Webbrowser禁止flash内容的显示 禁用IIS FTP默认的连接提示信息:“220-Microsoft FTP Service” C#使用RSA私钥加密公钥解密的改进,解决特定情况下解密后出现乱码的问题 在ASP.NET的单次请求中使用Singleton模式 Windows7的KB2488113补丁很重要,解决Windows7下软件无响应的问题 OpenFileDialog和SaveFileDialog使用不当会有文件夹共享冲突的问题 Cache-Control:nocache 会导致ie浏览器无法保存正确的图片类型 安装阿里旺旺2008会导致IE Webcontrols在客户端显示不正常
使用csExWB Webbrowser 控件获取HttpOnly的cookie
程序员海风 · 2011-10-31 · via 博客园 - 程序员海风

由于微软Webbrowser控件的限制,使用Webbrowser.Document.Cookie是不能获取到HttpOnly的cookie的。

解决办法:采用扩展的csExWB Webbrowser控件,csExWB Webbrowser控件支持对HTTP头的监控,这就给了我们读取HttpOnly Cookie数据的方法,

csExWB Webbrowser控件官方功能介绍:

csExWB介绍csEXWB is a C# .NET 2.0 control that creates, hosts and sinks the events of the original Webbrowser control (Not .NET or any other wrapper). Advanced customization and total control over the Webbrowser control are achieved via implementation of a number of interfaces, along with the addition of many methods, properties, events and a COM library. 主要功能之一,监控HTTP请求和响应

Monitor HTTP and HTTPS request and response headers for all resources, images, sounds, scripts, etc, with the opportunity to add your own headers

 通过这个特性,我们就可以获取到每一次请求的原始HTTP数据,然后想干什么干什么。

代码片段摘抄如下:

注册事件

this.cEXWB1.ProtocolHandlerOnResponse += new csExWB.ProtocolHandlerOnResponseEventHandler(this.cEXWB1_ProtocolHandlerOnResponse);
this.cEXWB1.ProtocolHandlerOnBeginTransaction += new csExWB.ProtocolHandlerOnBeginTransactionEventHandler(this.cEXWB1_ProtocolHandlerOnBeginTransaction);

 在事件里处理HTTP头

private void cEXWB1_ProtocolHandlerOnBeginTransaction(object sender, csExWB.ProtocolHandlerOnBeginTransactionEventArgs e)
        {

        }

        private void cEXWB1_ProtocolHandlerOnResponse(object sender, csExWB.ProtocolHandlerOnResponseEventArgs e)
        {
            //记录分析cookie
            string headers = e.m_ResponseHeaders;
            //.......自定义代码,对http头数据进行处理可以获得HttpOnly的Cookie
        }

 调用StartHTTPAPP()和StartHTTPSAPP()开始监控,调用StopHTTPAPP()和StopHTTPSAPP()方法停止监控。

cEXWB1.StartHTTPAPP();
cEXWB1.StartHTTPSAPP();

cEXWB1.StopHTTPAPP();
cEXWB1.StopHTTPSAPP();

 codeproject上的链接:http://www.codeproject.com/KB/miscctrl/csEXWB.aspx

googlecode上的项目主页:http://code.google.com/p/csexwb2/

这个控件比微软自带的Webbrowser控件好用很多,唯一不足是需要额外注册ActiveX组件。