[英]How can I break out of double quotes for XSS?
以下是我用於測試的一段代碼。 我試圖逃脫並向其添加基於 DOM 的 XSS 攻擊,但無法獲得有效負載警報 (1) 來激活。 我嘗試了 escaping 的多種變體,帶有雙引號,請參見下文。 有沒有辦法打破給定 function 中的雙引號?
"<img src='x' onerror='alert(1)'>"(
\</p><img src='x' onerror='alert(1)'>"\(\
<script>
var h = document.location.hash.substring(1);
if (h && h != "") {
var re = new RegExp(".+@.+");
if (h.match(re)) {
document.getElementById("email").innerHTML += " ("+h+")";
}
}
</script>
謝謝!
@gabor-lengyel 在評論中解釋說代碼基本上按預期工作:如果 XSS 行被編碼,那么它不會暴露應用程序中的漏洞,因此首先沒有雙引號。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.