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
XSS&CSRF
Search
ar7z1
November 17, 2015
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
XSS&CSRF
Внутренний курс по безопасности для разработчиков
ar7z1
November 17, 2015
More Decks by ar7z1
See All by ar7z1
Шпора.Безопасность
ar7z1
1
74
XSS & CSRF 2.0
ar7z1
0
110
HappyDev 2015
ar7z1
0
99
Featured
See All Featured
Utilizing Notion as your number one productivity tool
mfonobong
4
320
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
580
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
370
Odyssey Design
rkendrick25
PRO
2
690
The Pragmatic Product Professional
lauravandoore
37
7.3k
We Are The Robots
honzajavorek
0
240
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
Being A Developer After 40
akosma
91
590k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
560
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
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]