Cross Site Request Forgery
資安專題:跨站請求偽造
攻擊手法簡介
What is CSRF?
WHAT IS CSRF?
• 也被稱為 XSRF, on click attack / session riding
• Cross Site Reference Forgery
• 藉由使用者登入合法網站,誘導使用者點擊帶有攻擊碼的頁面。
• 藏有惡意 HTML / JavaScript 語法的頁面。
• 亦可能直接或間接的利用 XSS 的漏洞。
• CSRF是利用使用者所相信的合法網站
• XSS則是利用被 client 端信任的 application or website.
• 也曾利用輕量級標記語言做隱碼攻擊
• Lightweight markup language, like markdown, BBCode, JsonML, MakeDoc…etc.
CSRF Attack
攻防說明
攻擊流程
情境––GET REQUEST
• 線上點數交易網站A,以 GET Request 完成消費扣款的操作…
• 消費扣款網址:
•
• 危險網站X 的 CSRF攻擊:
http://www.tosCard.com/Buy.php?UID=5566&money=1000
情境––POST REQUEST
• 線上點數交易網站A,為防 CSRF 攻擊,改以 POST Request 操作。
• 消費扣款網站:
•
危險網站X 的 CSRF攻擊(again)
CSRF Attack
Hint: PHP的 $_REQUEST ….
• Quote: 「The variables in $_REQUEST are provided to the script
via the GET, POST, and COOKIE input mechanisms and therefore
could be modified by the remote user and cannot be trusted.」 ––
http://www.php.net/
• $_REQUEST 預設可以通吃 GET, POST, COOKIE (甚至是$_SERVER)
5.2版之前
情境––POST REQUEST ONLY
• 線上點數交易網站A,為防 CSRF 攻擊,改以 $_POST (post request only) 操作。
• 消費扣款網站:
•
隱碼跟著進化….
小結––
• CSRF的攻擊源於 WEB 的隱式身份驗證機制
• Web 身份驗證機制可以保證 request 來自使用者的瀏覽器,但卻無法保證
request 是被使用者核可的。
• 當使用者進行以下行為,就有可能受到 CSRF攻擊:
• 登入正常的網站A,在 local 端產生 cookie
• 未登出網站A的情況下,瀏覽有問題的網站X。
CSRF的防禦––
• Server side
1. Cookie Hashing
2. 驗證碼
3. One-Time Tokens
• Client side
Let’s try it.
實例
Question?
References––
• http://www.cnblogs.com/hyddd/archive/2009/04/09/1432744.html
• http://www.dotblogs.com.tw/joysdw12/archive/2013/09/16/asp-net-cross-site-request-
forgery.aspx
• http://www.cgisecurity.com/csrf-faq.html
• http://www.php.net/
• http://www.gpx.idv.tw/line_stic/details.php?s=539
• And other pics in google search engine.

More Related Content

PPTX
移动网站的兼容性探索
PDF
Politwoops.tw
PDF
twPolitwoops final
PDF
Csw2016 macaulay eh_trace-rop_hooks
PDF
Csw2016 evron sysman_apt_reports_and_opsec_evolution
PDF
Csw2016 julien moinard-hardsploit
PDF
Csw2016 gawlik bypassing_differentdefenseschemes
PDF
Csw2016 wang docker_escapetechnology
移动网站的兼容性探索
Politwoops.tw
twPolitwoops final
Csw2016 macaulay eh_trace-rop_hooks
Csw2016 evron sysman_apt_reports_and_opsec_evolution
Csw2016 julien moinard-hardsploit
Csw2016 gawlik bypassing_differentdefenseschemes
Csw2016 wang docker_escapetechnology

Viewers also liked (20)

PDF
Csw2016 economou nissim-getting_physical
PDF
Csw2016 d antoine_automatic_exploitgeneration
PDF
Csw2016 song li-smart_wars
PDF
SQL injection duplicate error principle
PPTX
Sys Security
PDF
Csw2016 chen grassi-he-apple_graphics_is_compromised
PDF
CSW2017 Harri hursti csw17 final
PDF
Rootkit 101
PDF
Web2.0 attack and defence
PDF
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
PDF
Algo/Crypto about CTF
PDF
Dvwa low level
PDF
ROP 輕鬆談
PDF
Android Security Development
PDF
新手無痛入門Apk逆向
PDF
Python 網頁爬蟲由淺入淺
PDF
Android IPC Mechanism
PDF
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
PDF
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
PPT
Acm入门教程
Csw2016 economou nissim-getting_physical
Csw2016 d antoine_automatic_exploitgeneration
Csw2016 song li-smart_wars
SQL injection duplicate error principle
Sys Security
Csw2016 chen grassi-he-apple_graphics_is_compromised
CSW2017 Harri hursti csw17 final
Rootkit 101
Web2.0 attack and defence
CSW2017 Kyle ehmke lots of squats- ap-ts never miss leg day
Algo/Crypto about CTF
Dvwa low level
ROP 輕鬆談
Android Security Development
新手無痛入門Apk逆向
Python 網頁爬蟲由淺入淺
Android IPC Mechanism
CSW2017 Qiang li zhibinhu_meiwang_dig into qemu security
CSW2017 Yuhao song+Huimingliu cyber_wmd_vulnerable_IoT
Acm入门教程
Ad

Similar to CSRF Attack (9)

PDF
Web前端 安全须知 拔赤
PDF
用戶端攻擊與防禦
PDF
Csrf攻击原理及防御措施
PDF
Hiiir 資安講座 III 用戶端攻擊與防禦
PPT
第四节课:web安全2.0
PPT
Telligem 1_xss
PDF
浅谈前端安全与规范(渔隐)
PDF
Clientside attack using HoneyClient Technology
PPTX
Web安全分享 -公开版
Web前端 安全须知 拔赤
用戶端攻擊與防禦
Csrf攻击原理及防御措施
Hiiir 資安講座 III 用戶端攻擊與防禦
第四节课:web安全2.0
Telligem 1_xss
浅谈前端安全与规范(渔隐)
Clientside attack using HoneyClient Technology
Web安全分享 -公开版
Ad

CSRF Attack