$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
XSS&CSRF
Search
ar7z1
November 17, 2015
0
130
XSS&CSRF
Внутренний курс по безопасности для разработчиков
ar7z1
November 17, 2015
Tweet
Share
More Decks by ar7z1
See All by ar7z1
Шпора.Безопасность
ar7z1
1
73
XSS & CSRF 2.0
ar7z1
0
110
HappyDev 2015
ar7z1
0
95
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
560
Joys of Absence: A Defence of Solitary Play
codingconduct
1
250
Fireside Chat
paigeccino
41
3.7k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Thoughts on Productivity
jonyablonski
73
5k
Faster Mobile Websites
deanohume
310
31k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Transcript
XSS CSRF
[email protected]
TOOLS
http://bit.ly/ 1tMrggU
http://bit.ly/ 1jKA1UJ
XSS
Reflected
http://example.com/? q=<script>alert('1') </script>
Stored
<img src=lalala onerror="alert('1')" />
DOM-based
http://example.com/ #'><img src=qqq onerror=“alert(‘1’)”>
https://xss- game.appspot .com/
None
None
jsfuck.com
HtmlEncode
innerHTML document.write eval @Html.Raw
X-XSS-Protection
Content-Security- Policy X-Content-Security- Policy X-WebKit-CSP
Content-Security- Policy: default-src 'self'
<system.web> <httpRuntime requestValidationMode="4.0" /> </system.web> <system.web> <pages validateRequest="true" /> </system.web>
CSRF
site.com
site.com GET /emails gmail.com
site.com GET /emails gmail.com
Same Origin Policy
protocol://host:port
https://site.com http://site.com https://a.site.com https://site.com:9090
None
Cross-origin writes $.ajax({ type: "POST", url: url, data: {…}, contentType:'text/plain'
});
Cross-origin writes • application/x-www- form-urlencoded • multipart/form- data • text/plain
Cross-origin embedding $(‘…’).append( ‘<img src=“…”>’ );
Cross-origin reads $.get(url, function(data){ alert(data); });
GET evil.com
GET evil.com
<form method=“POST” action=“https://…/ SaveEmail”> <input type=“hidden” name=“email” value=“
[email protected]
” /> </form>
<form method=“POST” action=“https://…/SaveEmail”> <input type=“hidden” name=“email” value=“
[email protected]
” /> </form>
<script> window.onload = function(){ … form.submit(); } </script>
POST /SaveEmail
[email protected]
GET evil.com
candy- csrf.apphb.com
None
@troyhunt
webgoat. github.io
https://ctftime.org
@ar7z1
[email protected]