分类

学习笔记 [17]
渗透测试 [4]
一些杂文 [14]
coding [16]
漏洞信息 [17]
技术文章 [15]
开发文档 [8]
个人作品 [5]
PS:个人作品在各种下载栏目均有下载

站内搜索

日历

«  August 2010  »
Su Mo Tu We Th Fr Sa
1234567
891011121314
15161718192021
22232425262728
293031

访问统计(起于2010/10/2)

访问统计
PortWatcher's Blog
Monday, 2025-06-30, 5:07 AM
Welcome Guest
Main | Registration | Login | RSS

Blog

Main » 2010 » August » 18 » 一本老外的书上看到的问题,有关过滤绕过
5:45 PM
一本老外的书上看到的问题,有关过滤绕过
旨在阻止跨站点脚本攻击的输入确认机制按以下顺序处理一个输入:
(1)删除任何出现的表达式;
(2)将输入截短为50个字符;

(3)删除输入中的引号;

(4)对输入进行URL解码;

(5)如果任何输入项被删除,返回步骤(1)。

能避开上述确认机制,让以下数据通过确认吗?

Code

"><script>alert("foo")</script>

在书中给出的网站上找到了答案:

Yes. If it were not for Step 4, this mechanism would be robust in terms of filtering the specific items it is designed to block. However, because your input is decoded after the filtering steps have been performed, you can simply URL-encode selected characters in your payload to evade the filter:

Code

%22>%3cscript>alert(%22foo%22)</script>  

If Step 4 were performed first (or even not at all) then this bypass would not be possible.

开始我理解错了题意,以为那些条件是要同时满足的,结果想半天也想不出来。如果把 STEP 4放在 STEP 1 的位置,你就会跟我一样纠结了。实际上这题不是很难,关键是理解题意。不认真看题也是在日常学习中老犯的毛病,呵呵。

Category: 学习笔记 | Views: 784 | Added by: Jury | Rating: 4.0/1
Total comments: 1
1 Santiago  
0
At last, seoonme who knows where to find the beef

Name *:
Email *:
Code *: