思步网

查看: 69677|回复: 59
打印 上一主题 下一主题

[其他] 修改HTTP Post/get数据利器TamperIE(升级版)

  [复制链接]
@author Bzcyer

@ http://www.bzcyer.com/

安全测试中,中间者攻击是一个很常用的手段。采用TamperIE 可以模拟这个过程,主要是工作原理是截获HTTP Post/get数据,然后篡改Post/get数据,提交各类异常信息。
就最近几天工作中使用Tramper做的一些实际测试例子介绍下。
1.XSS(cross-site scripting)
曾经,测试出登录的地方有XSS的问题,主要是通过httpwartch看数据,然后手工拼地址,再往拼的地址中扔脚本。如:
http://192.168.1.129/member.do?method=customerLogon&mail=bzcyer@gmail.com&pws=222222

http://192.168.1.129/member.do?method=customerLogon&mail=>"'><img src="javascript:alert('XSS')">&pws=222222
使用TramperIE,可以非常简单的实现这点,如图:
在登录的时候,Post上来的数据:


讲用户名改成脚本:


然后send altered data。
用TramperIE能非常高效的验证XSS。另外再举个例子,就是用TramperIE来实现的。
见图:


结果是:

对于这里采用的时间的插件,手工去修改的话是不可能写入脚本,这个时候通过Post上来的数据,直接改了,就会出现XSS。




--------------------------我是超级无敌帅气的分割线----------------------------
下载:TamperIE (http://www.bayden.com/dl/TamperIESetup.exe)

TamperIETamperIE is an Internet Explorer Browser Helper Object which allows tampering with HTTP requests from Internet Explorer 5 and above.  If you haven't installed it yet, you can get it here.
WARNING: This tool makes it simple to do very bad things to poorly written code.  Malicious use of this tool against third-parties is a violation of federal, state, and local laws.  Be smart.
TamperIE is a useful tool for security testing your web applications, in order to ensure you don't make foolish assumptions about the data sent by client browsers.  Since the tool exposes and allows tampering with otherwise inconvenient input, many user-input security flaws immediately become apparent.
SSL? TamperIE works inside IE itself, before data is placed on the wire; this means that it works fine even against SSL secured sites.
Need more power? You might find the Fiddler HTTP Debugging Proxy more powerful, as it supports an automated scripting engine.
Using TamperIEFor this example, you can follow along here:  http://www.bayden.com/sandbox/shop/
Visiting the sample URL above presents a simple web-based shopping cart.

Wow, what a great tablet!  But $1995 seems kinda pricey, doesn't it?  Hrm... What to do?
Click the TamperIE icon on the toolbar.
   

Ensure the topmost checkbox is checked, like so:
   
Close the dialog.
Now, in the page, click Order! and the TamperIE editing dialog is shown.
           
Control
Function
URL Editbox
This box contains the URL which is being requested from the server.  This field is editable.  So, for instance, you can change the
Send Altered Data
This button will send the edited HTTP request to the specified URL.
Send Original Data
This button will send the unedited HTTP request to the original URL.
Cookies
This tab presents a read-only view of the cookies which are being sent to the server.You can edit your cookies by editing the cookie file on disk or using a great browser plugin like CookieSpy.
Raw Headers
This tab presents a read/write view of the custom HTTP headers which are being sent to the server.  These are rarely used by web pages, but can be useful in some circumstances.  For instance, sometimes web sites will not check authorization if "secret" HTTP headers are present in the request.
Raw Post
This tab presents a read/write view of the HTTP POST body which is being sent to the server.  This is where TamperIE shines.Many web applications are coded very poorly, and implicitly trust data sent by the POST body.  Some corporations mistakenly think that if the HTTP Header "Referer" is correct, the POST data must have been generated securely.  Wrong.
PrettyPost
This tab presents a "pretty" read/write view of the HTTP POST body.  POSTs are generally URL encoded, and this editing grid allows easy tampering.  More on this in a moment.
Notice anything interesting about the POST data?
        

Hrm... A coincidence?  Let's see...  Click on the PrettyPost tab.
        
The POST form data is neatly broken down into name/value pairs in the grid.  See the Price field?  Click it to set focus to it.
The Value dropdown box to the right of the Edit Field label contains a number of pre-built attack strings which are known to cause problems for many web-based applications.  These vulnerabilities include SQL injection, buffer overflow, cross-site scripting, etc.
            

Note: If you'd like to customize this list, simply create a file named hackstrings.txt in the folder which contains ietamper.dll.  This file should contain one attack string per line.
In this case, however, we're not trying to crash the server, we're trying to get a discount on a computer.  Change the 1995.00 value to 10.00
Click the Raw Post tab to see the change reflected in the raw post data:
        
Click the Send Altered Data button at the top-right of the dialog box.  The TamperIE dialog will close and the tampered request will be sent to the server.
        
Note: SSL-encryption would have done nothing to foil this attack, since the data is being altered by the original submitter.  The vulnerability here is that the web site is blindly trusting a POST instead of performing a database lookup.  Amazingly, a huge number of shopping carts work this way, either for the actual product, or for the shipping cost.
TamperIE Control PanelThe TamperIE Control Panel allows you to control when you are prompted to tamper with requests.
Start the TamperIE Control Panel referenced in the IE toolbar.  (If the icon isn't visible, right-click the IE toolbar, and choose Customize).
        
The following dialog will appear:
        

Option
Function
Tamper with HTTP POSTs
Show the TamperIE dialog when a form is submitted with METHOD=POST
Tamper with HTTP GETs
Show the TamperIE dialog whenever a HTTP GET is performed.
Tamper with GET requests for the following files
Show the TamperIE dialog whenever a HTTP GET is performed and the resource address ends with the specified text.For instance, given the filter in the above screenshot, the following URL requests will match:
     www.washingtonpost.com/article.html?q=12311
     www.banker.com/payee.html?id=321312&amt=1231
     www.bayden.com/register.asp?product=TamperIE
     www.microsoft.com/passport/register.asp#FAQ

etc...

If this box contains a *, all GET requests will match the filter.
Only tamper with GETs with Query string parameters
Show the TamperIE dialog only when a HTTP GET is performed and there is query string data in the URL.  Query string data is found in the URL after the ? character.  For instance, in this Google hit, query data is shown in Red.http://www.google.com/search?hl=en&q=hacker




















上一篇:XSS SHELL的安装和使用
下一篇:LR测试Mysql第一步:VC.Net连接Mysql的
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 转播转播 分享分享 分享淘帖 支持支持 反对反对
回复 论坛版权

使用道具 举报

顶一下
看帖看完了至少要顶一下哦~
顶起顶起顶起
众里寻他千百度,蓦然回首在这里!
非常好,顶一下占位编辑
还不错哦,如果再能多分享一些就perfect了!
向楼主学习
我也来顶一下..
非常好,顶一下占位编辑
不错 支持一个了
打酱油的人拉,顺便赚点金币
很有借鉴意义,先收藏了,谢谢楼主。
前排支持下了哦~
very good.
您需要登录后才可以回帖 登录 | 注册

本版积分规则



思步组织思步科技|思步网|火花学堂|思步文库|思步问答|思步英才|天下心
© 2007 思步网 浙ICP备10212573号-4(首次备案号:浙ICP备07035264号)|邮箱:service#step365.com(将#换成@)|服务热线:0571-28827450
在线培训课程|求职招聘|思步文库|官方微信|手机APP|思步问答|微博平台|官方QQ群|交流论坛|软件工程透析|关于我们|申请友链|
点击这里给我发消息     点击这里给我发消息
思步 step365 过程改进 CMMI中文 质量保证 质量管理 流程体系 需求跟踪矩阵 敏捷开发 Scrum 软件度量 项目评审 全员改进 流程管理 人力资源 6sigma 信息安全 ISO27001认证 IT服务管理 ISO20000认证 ISO9000认证 软件测试 SQA 配置管理 IPD 软件工程 PMP认证 PMP试题 PMBOK中文 精益研发 agile 顾问式管理培训
返回顶部