SlideShare a Scribd company logo
CSRF	
  (Cross	
  Site	
  Request	
  Forgery)	
  
ClickJacking	
  &	
  Open	
  Redirects	
  
Cross	
  Site	
  Request	
  Forgery	
  (CSRF)	
  
•  Generic	
  CSRF	
  is	
  with	
  GET	
  /	
  POST	
  
•  Forcefully	
  sending	
  request	
  to	
  the	
  target	
  applicaEon	
  
with	
  cookie	
  replay	
  
•  Leveraging	
  tags	
  like	
  
–  IMG
–  SCRIPT
–  IFRAME
•  Not	
  abide	
  by	
  SOP	
  or	
  Cross	
  Domain	
  is	
  possible	
  
Request	
  generaEon	
  
	
  	
  	
  	
  	
  IMG	
  SRC	
  
	
  	
  <img	
  src="hOp://host/?command">	
  
	
  
	
  	
  SCRIPT	
  SRC	
  
	
  	
  <script	
  src="hOp://host/?command">	
  
	
  
	
  	
  IFRAME	
  SRC	
  
	
  	
  <iframe	
  src="hOp://host/?command">	
  	
  
Request	
  generaEon	
  
	
  	
  	
  	
  'Image'	
  Object	
  
	
  	
  <script>	
  
	
  	
  var	
  foo	
  =	
  new	
  Image();	
  
	
  	
  foo.src	
  =	
  "hOp://host/?command";	
  
	
  	
  </script>	
  	
  
	
  
XHR	
  –	
  Cross	
  domain	
  difficult	
  
Request	
  generaEon	
  
•  It	
  is	
  possible	
  to	
  generate	
  POST	
  as	
  well	
  
•  Form	
  can	
  be	
  build	
  dynamically	
  and	
  buOon	
  
click	
  from	
  JavaScript	
  is	
  possible	
  
<script	
  type="text/javascript"	
  
language="JavaScript">	
  
	
  	
  	
  	
  	
  	
  document.foo.submit();	
  
</script>	
  	
  
Cross	
  Site	
  Request	
  Forgery	
  (CSRF)	
  
•  What	
  is	
  different	
  with	
  Web	
  2.0	
  
– Is it possible to do CSRF to XML stream
– How?
– It will be POST hitting the XML processing
resources like Web Services
– JSON CSRF is also possible
– Interesting check to make against application
and Web 2.0 resources
One	
  Way	
  CSRF	
  Scenario	
  
One	
  Way	
  CSRF	
  Scenario	
  
One	
  Way	
  CSRF	
  Scenario	
  
One	
  Way	
  CSRF	
  Scenario	
  
One-­‐Way	
  CSRF	
  
One-­‐Way	
  CSRF	
  
•  <html>	
  
•  <body>	
  
•  <FORM	
  NAME="buy"	
  ENCTYPE="text/plain"	
  acEon="hOp://
trade.example.com/xmlrpc/trade.rem"	
  METHOD="POST">	
  
•  	
  	
  	
  	
  	
  	
  	
  <input	
  type="hidden"	
  name='<?xml	
  version'	
  value='"1.0"?
><methodCall><methodName>stocks.buy</
methodName><params><param><value><string>MSFT</string></
value></param><param><value><double>26</double></value></
param></params></methodCall>'>	
  
•  </FORM>	
  
•  <script>document.buy.submit();</script>	
  
•  </body>	
  
•  </html>	
  
Forcing	
  XML	
  
•  Spligng	
  XML	
  stream	
  in	
  the	
  form.	
  
•  Possible	
  through	
  XForms	
  as	
  well.	
  
•  Similar	
  techniques	
  is	
  applicable	
  to	
  JSON	
  as	
  
well.	
  	
  
Two-­‐Way	
  CSRF	
  
•  One-­‐Way	
  –	
  Just	
  making	
  forceful	
  request.	
  
•  Two-­‐Way	
  
– Reading the data coming from the target
– May be getting hold onto important
information – profile, statements, numbers
etc.
– Is it possible with JSON/XML
Two-­‐Way	
  CSRF	
  
Two-­‐Way	
  CSRF	
  
•  ApplicaEon	
  is	
  serving	
  various	
  streams	
  like	
  –	
  
JSON,	
  JS-­‐Object,	
  Array	
  etc.	
  
	
  
Two-­‐Way	
  CSRF	
  
Two-­‐Way	
  CSRF	
  
•  AOacker	
  page	
  can	
  make	
  cross	
  domain	
  request	
  
using	
  SCRIPT	
  (firefox)	
  
•  Following	
  code	
  can	
  overload	
  the	
  array	
  stream.	
  
	
  	
  	
  funcEon	
  Array()	
  	
  
	
  {	
  var	
  obj	
  =	
  this;	
  var	
  index	
  =	
  0;	
  for(j=0;j<4;j++){	
  obj[index++]	
  
seOer	
  =	
  spoof;	
  }	
  }	
  funcEon	
  spoof(x){	
  send(x.toString());	
  }	
  	
  
Two-­‐Way	
  CSRF	
  
Two-­‐Way	
  CSRF	
  
•  It	
  is	
  possible	
  to	
  overload	
  these	
  objects.	
  
•  Reading	
  and	
  sending	
  to	
  cross	
  domain	
  possible.	
  
•  Opens	
  up	
  two	
  way	
  channel	
  for	
  an	
  aOacker.	
  
•  Web	
  2.0	
  streams	
  are	
  vulnerable	
  to	
  these	
  
aOacks.	
  
Countermeasure	
  
•  Server	
  Side	
  Checks	
  
–  Check for client’s content-type.
–  XHR calls – xml/application.
–  Native calls – text/html.
–  Filtering is possible on it.
•  Client	
  Side	
  Checks	
  
–  Stream can be started and terminated by /* or any
predefined characters.
–  Client can remove them before injecting to DOM.
Clickjacking	
  
DescripEon	
  
• Clickjacking	
  is	
  a	
  popular	
  name	
  for	
  an	
  old	
  aOack	
  
method	
  called	
  “UI	
  redressing”	
  
• Though	
  a	
  case	
  of	
  “old	
  wine	
  in	
  a	
  new	
  boOle”,	
  
given	
  the	
  current	
  development	
  in	
  Web	
  
standards	
  (Web	
  2.0,	
  AJAX,	
  etc),	
  one	
  cannot	
  
ignore	
  the	
  risks	
  posed	
  by	
  this	
  vulnerability	
  
• The	
  basic	
  philosophy	
  of	
  this	
  aOack	
  is	
  to	
  fool	
  
the	
  user	
  into	
  clicking	
  a	
  malicious	
  link	
  
DescripEon	
  
•  Clickjacking	
  involves	
  “hijacking”	
  the	
  user's	
  
mouse	
  clicks	
  
•  This	
  means,	
  the	
  user	
  thinks	
  (s)he's	
  clicking	
  
on	
  something,	
  but	
  is	
  actually	
  not	
  
•  The	
  user,	
  invariably	
  and	
  unknowingly	
  
authorizes	
  certain	
  acEons	
  which	
  could	
  have	
  
disasterous	
  consequences	
  or	
  could	
  be	
  as	
  
harmless	
  as	
  being	
  redirected	
  to	
  a	
  games	
  site	
  
AOack	
  Anatomy	
  
•  There	
  are	
  3	
  popular	
  ways	
  in	
  which	
  aOackers	
  
perpetrate	
  this	
  vulnerability	
  
–  Using invisible elements such as iframes
–  Injecting malicious javascript (or any
other client side scripting language)
–  Leveraging a bug in Adobe Flash Player
(this method is now obsolete)
AOack	
  Anatomy	
  
•  An	
  aOacker	
  uses	
  the	
  concept	
  of	
  layering	
  to	
  
crat	
  an	
  aOack	
  
•  Basically,	
  the	
  page	
  that	
  the	
  user	
  views,	
  will	
  
have	
  layers	
  
•  Some	
  of	
  these	
  layers	
  will	
  be	
  transparent	
  (or	
  
invisible)	
  	
  
•  The	
  user	
  will	
  never	
  know	
  of	
  the	
  invisible	
  
layers	
  and	
  will	
  end	
  up	
  making	
  a	
  wrong	
  
choice	
  
AOack	
  Anatomy	
  
•  Lets	
  first	
  understand	
  this	
  basic	
  mechanism	
  
with	
  an	
  example	
  and	
  then	
  move	
  on	
  to	
  the	
  
different	
  ways	
  of	
  perpetraEng	
  this	
  aOack	
  ....	
  
AOack	
  Anatomy	
  
Send email to all users ?
Yes No
Actual intented content ....
AOack	
  Anatomy	
  
Send email to all users ?
Yes No
Do you want a free iPad?
No
Intended content .... Malicious content for clickjacking
AOack	
  Anatomy	
  
Send email to all users ?
Yes No
Do you want a free iPad?
No
When the two are super imposed …
(“Send email to all users?” Will not be visible, it is
shown here for clarity)
Unvalidated	
  Redirects	
  &	
  
Forwards	
  
DescripEon	
  
•  Web	
  applicaEons	
  are	
  having	
  its	
  own	
  “flow”	
  
•  Business	
  flow	
  needs	
  movement	
  between	
  
pages	
  and	
  sites	
  
•  ApplicaEon	
  uses	
  same	
  domain	
  or	
  cross	
  
domain	
  redirects	
  and	
  forwards	
  
•  It	
  allows	
  applicaEons	
  to	
  work	
  easily	
  and	
  access	
  
same	
  domain	
  or	
  cross	
  domain	
  resources	
  
(Single	
  Sign	
  On	
  –	
  leveraging)	
  
DescripEon	
  
•  HTTP	
  requests	
  can	
  be	
  GET	
  or	
  POST	
  
•  Parameters	
  are	
  not	
  validated	
  and	
  can	
  lead	
  to	
  
arbitrary	
  redirects	
  
•  This	
  can	
  be	
  leveraged	
  at	
  ease	
  and	
  get	
  
exploited	
  by	
  an	
  aOacker	
  
•  AOacker	
  exploits	
  the	
  trust	
  and	
  leverage	
  the	
  
vulnerability	
  
AOack	
  Anatomy	
  
•  As	
  a	
  part	
  of	
  root	
  cause,	
  there	
  must	
  be	
  a	
  
redirect	
  hole	
  
•  Example,	
  
– http://foo.bank.com/login.aspx?
user=xxx&page=trade.aspx
•  Here	
  “page”	
  is	
  a	
  vulnerable	
  parameter	
  
•  What	
  if?	
  Some	
  one	
  put	
  page=hOp://
yahoo.com	
  …	
  
AOack	
  Anatomy	
  
Attacker
foo.bank.com
http://foo.bank.com/login.aspx?user=xxx&
page=http://yahoo.com
Get redirect or JavaScript call
for loading yahoo.com
Vulnerability detected!!!
AOack	
  Anatomy	
  
•  What	
  is	
  redirect…	
  
– If server sends 302 in its HTTP response
– If server sends JavaScript with certain
document object calls like “location”
•  What	
  will	
  happen…	
  
– It will send browser to new location
– User will stay in impression that he/she is at
trusted site but that is not the case
AOack	
  Anatomy	
  
Bank’s user
foo.bank.com
Login the page
Login successful
This is what in user’s mind…
a.) URL – trusted, foo.bank.com
b.) Login form - trusted
AOack	
  Anatomy	
  
•  User	
  is	
  doing	
  all	
  his	
  acEviEes	
  
•  Full	
  trust	
  is	
  established	
  and	
  day	
  to	
  day	
  work	
  is	
  
going	
  on	
  
•  Now	
  aOacker’s	
  acEon	
  comes	
  in	
  …	
  
•  AOacker	
  sends	
  a	
  mail	
  and	
  request	
  to	
  login	
  and	
  
change	
  password	
  immediately	
  as	
  part	
  of	
  
banking	
  policies	
  
•  	
  AOacker	
  acts	
  as	
  administrator	
  from	
  bank	
  
AOack	
  Anatomy	
  
•  Magic	
  is	
  in	
  the	
  link	
  and	
  trust	
  is	
  in	
  the	
  mind.	
  
•  User	
  trust	
  the	
  URL	
  and	
  Link	
  both	
  consciously	
  
and	
  subconsciously…	
  
•  Following	
  link	
  will	
  be	
  sent.	
  
http://foo.bank.com/login.aspx?user=xxx&date=12-12-2009&trust=good&
page=http://203.88.xx.xx/security.html
Link is injected
User is going to trust this
AOack	
  Anatomy	
  
Click the link
Get a redirect response
to 203.88.XX.XX
1Link in mail
AOack	
  Anatomy	
  
Bank’s user
foo.bank.com
Click the link
Get a redirect response
to 203.88.XX.XX
203.88.XX.XX
(Attacker’s area)
Bank’s user
Send dummy form
Trusted evil redirect
2
AOack	
  Anatomy	
  
Bank’s user
foo.bank.com
Click the link
Get a redirect response
to 203.88.XX.XX
203.88.XX.XX
(Attacker’s area)
Bank’s user
Send dummy form
Bank’s user
Send username and password
Send dummy response (Thanks!)
Trusted evil redirect
203.88.XX.XX
(Attacker’s area)
3
AOack	
  Anatomy	
  
Bank’s user
foo.bank.com
Click the link
Get a redirect response
to 203.88.XX.XX
203.88.XX.XX
(Attacker’s area)
Bank’s user
Send dummy form
Bank’s user
Send username and password
Send dummy response (Thanks!)
Trusted evil redirect
203.88.XX.XX
(Attacker’s area)
Logs in and
do money
transfer
4
Conclusion	
  

More Related Content

What's hot

XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricks
GarethHeyes
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
Avinash Thapa
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
Raghav Bisht
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
Amit Tyagi
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site ScriptingAli Mattash
 
Introduction to path traversal attack
Introduction to path traversal attackIntroduction to path traversal attack
Introduction to path traversal attack
Prashant Hegde
 
Xss attack
Xss attackXss attack
Xss attack
Manjushree Mashal
 
Ssrf
SsrfSsrf
Http request smuggling
Http request smugglingHttp request smuggling
Http request smuggling
n|u - The Open Security Community
 
Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)
Abhinav Mishra
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programsAEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
Mikhail Egorov
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
n|u - The Open Security Community
 
HTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsHTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versions
neexemil
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
Daniel Tumser
 
Local File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code ExecutionLocal File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code Execution
n|u - The Open Security Community
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
Tony Bibbs
 
Broken access controls
Broken access controlsBroken access controls
Broken access controls
Akansha Kesharwani
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & Inconsistency
GreenD0g
 
Cross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting ExplainedCross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting Explained
Valency Networks
 

What's hot (20)

XSS Magic tricks
XSS Magic tricksXSS Magic tricks
XSS Magic tricks
 
Waf bypassing Techniques
Waf bypassing TechniquesWaf bypassing Techniques
Waf bypassing Techniques
 
Directory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion AttacksDirectory Traversal & File Inclusion Attacks
Directory Traversal & File Inclusion Attacks
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site Scripting
 
Introduction to path traversal attack
Introduction to path traversal attackIntroduction to path traversal attack
Introduction to path traversal attack
 
Xss attack
Xss attackXss attack
Xss attack
 
Ssrf
SsrfSsrf
Ssrf
 
Http request smuggling
Http request smugglingHttp request smuggling
Http request smuggling
 
Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)Insecure direct object reference (null delhi meet)
Insecure direct object reference (null delhi meet)
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programsAEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
AEM hacker - approaching Adobe Experience Manager webapps in bug bounty programs
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
HTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsHTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versions
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
 
Local File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code ExecutionLocal File Inclusion to Remote Code Execution
Local File Inclusion to Remote Code Execution
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 
Broken access controls
Broken access controlsBroken access controls
Broken access controls
 
Reverse proxies & Inconsistency
Reverse proxies & InconsistencyReverse proxies & Inconsistency
Reverse proxies & Inconsistency
 
Cross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting ExplainedCross Site Request Forgery (CSRF) Scripting Explained
Cross Site Request Forgery (CSRF) Scripting Explained
 

Similar to CSRF, ClickJacking & Open Redirect

Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Ivo Andreev
 
Postcards from the post xss world- content exfiltration null
Postcards from the post xss world- content exfiltration nullPostcards from the post xss world- content exfiltration null
Postcards from the post xss world- content exfiltration null
Piyush Pattanayak
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009mirahman
 
Detailed Developer Report.pdf
Detailed Developer Report.pdfDetailed Developer Report.pdf
Detailed Developer Report.pdf
nalla14
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
AppUniverz Org
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
tmd800
 
4 andrii kudiurov - web application security 101
4   andrii kudiurov - web application security 1014   andrii kudiurov - web application security 101
4 andrii kudiurov - web application security 101
Ievgenii Katsan
 
www.webre24h.com - Ajax security
www.webre24h.com - Ajax securitywww.webre24h.com - Ajax security
www.webre24h.com - Ajax security
webre24h
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
davejohnson
 
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Divyanshu
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
Timothy Fisher
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer Conference
AllFacebook.de
 
Burpsuite yara
Burpsuite yaraBurpsuite yara
Burpsuite yara
Rinaldi Rampen
 
Web Hacking Series Part 4
Web Hacking Series Part 4Web Hacking Series Part 4
Web Hacking Series Part 4
Aditya Kamat
 
How to migrate from any CMS (thru the front-door)
How to migrate from any CMS (thru the front-door)How to migrate from any CMS (thru the front-door)
How to migrate from any CMS (thru the front-door)
ICF CIRCUIT
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
Samvel Gevorgyan
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
Devnology
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Stormpath
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
Michael Hendrickx
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP framework
SusannSgorzaly
 

Similar to CSRF, ClickJacking & Open Redirect (20)

Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
Going Beyond Cross Domain Boundaries (jQuery Bulgaria)
 
Postcards from the post xss world- content exfiltration null
Postcards from the post xss world- content exfiltration nullPostcards from the post xss world- content exfiltration null
Postcards from the post xss world- content exfiltration null
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009
 
Detailed Developer Report.pdf
Detailed Developer Report.pdfDetailed Developer Report.pdf
Detailed Developer Report.pdf
 
Week 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. WuWeek 05 Web, App and Javascript_Brandon, S.H. Wu
Week 05 Web, App and Javascript_Brandon, S.H. Wu
 
OWASP top 10-2013
OWASP top 10-2013OWASP top 10-2013
OWASP top 10-2013
 
4 andrii kudiurov - web application security 101
4   andrii kudiurov - web application security 1014   andrii kudiurov - web application security 101
4 andrii kudiurov - web application security 101
 
www.webre24h.com - Ajax security
www.webre24h.com - Ajax securitywww.webre24h.com - Ajax security
www.webre24h.com - Ajax security
 
Ajax to the Moon
Ajax to the MoonAjax to the Moon
Ajax to the Moon
 
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
Browser Hacking For Fun and Profit | Null Bangalore Meetup 2019 | Divyanshu S...
 
Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011Developing High Performance Web Apps - CodeMash 2011
Developing High Performance Web Apps - CodeMash 2011
 
WebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer ConferenceWebApp / SPA @ AllFacebook Developer Conference
WebApp / SPA @ AllFacebook Developer Conference
 
Burpsuite yara
Burpsuite yaraBurpsuite yara
Burpsuite yara
 
Web Hacking Series Part 4
Web Hacking Series Part 4Web Hacking Series Part 4
Web Hacking Series Part 4
 
How to migrate from any CMS (thru the front-door)
How to migrate from any CMS (thru the front-door)How to migrate from any CMS (thru the front-door)
How to migrate from any CMS (thru the front-door)
 
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
 
The top 10 security issues in web applications
The top 10 security issues in web applicationsThe top 10 security issues in web applications
The top 10 security issues in web applications
 
Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)Building Secure User Interfaces With JWTs (JSON Web Tokens)
Building Secure User Interfaces With JWTs (JSON Web Tokens)
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
Testing mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP frameworkTesting mit Codeception: Full-stack testing PHP framework
Testing mit Codeception: Full-stack testing PHP framework
 

More from Blueinfy Solutions

Mobile Application Scan and Testing
Mobile Application Scan and TestingMobile Application Scan and Testing
Mobile Application Scan and Testing
Blueinfy Solutions
 
Mobile security chess board - attacks & defense
Mobile security chess board - attacks & defenseMobile security chess board - attacks & defense
Mobile security chess board - attacks & defense
Blueinfy Solutions
 
Mobile code mining for discovery and exploits nullcongoa2013
Mobile code mining for discovery and exploits nullcongoa2013Mobile code mining for discovery and exploits nullcongoa2013
Mobile code mining for discovery and exploits nullcongoa2013
Blueinfy Solutions
 
iOS Application Security Testing
iOS Application Security TestingiOS Application Security Testing
iOS Application Security Testing
Blueinfy Solutions
 
Html5 on mobile
Html5 on mobileHtml5 on mobile
Html5 on mobile
Blueinfy Solutions
 
Android secure coding
Android secure codingAndroid secure coding
Android secure coding
Blueinfy Solutions
 
Android attacks
Android attacksAndroid attacks
Android attacks
Blueinfy Solutions
 
Automation In Android & iOS Application Review
Automation In Android & iOS 	Application Review�Automation In Android & iOS 	Application Review�
Automation In Android & iOS Application Review
Blueinfy Solutions
 
Web Services Hacking and Security
Web Services Hacking and SecurityWeb Services Hacking and Security
Web Services Hacking and Security
Blueinfy Solutions
 
Source Code Analysis with SAST
Source Code Analysis with SASTSource Code Analysis with SAST
Source Code Analysis with SAST
Blueinfy Solutions
 
HTML5 hacking
HTML5 hackingHTML5 hacking
HTML5 hacking
Blueinfy Solutions
 
XSS - Attacks & Defense
XSS - Attacks & DefenseXSS - Attacks & Defense
XSS - Attacks & Defense
Blueinfy Solutions
 
Defending against Injections
Defending against InjectionsDefending against Injections
Defending against Injections
Blueinfy Solutions
 
XPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal InjectionXPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal Injection
Blueinfy Solutions
 
Blind SQL Injection
Blind SQL InjectionBlind SQL Injection
Blind SQL Injection
Blueinfy Solutions
 
Application fuzzing
Application fuzzingApplication fuzzing
Application fuzzing
Blueinfy Solutions
 
SQL injection basics
SQL injection basicsSQL injection basics
SQL injection basics
Blueinfy Solutions
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
Blueinfy Solutions
 
Assessment methodology and approach
Assessment methodology and approachAssessment methodology and approach
Assessment methodology and approach
Blueinfy Solutions
 
HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams Security
Blueinfy Solutions
 

More from Blueinfy Solutions (20)

Mobile Application Scan and Testing
Mobile Application Scan and TestingMobile Application Scan and Testing
Mobile Application Scan and Testing
 
Mobile security chess board - attacks & defense
Mobile security chess board - attacks & defenseMobile security chess board - attacks & defense
Mobile security chess board - attacks & defense
 
Mobile code mining for discovery and exploits nullcongoa2013
Mobile code mining for discovery and exploits nullcongoa2013Mobile code mining for discovery and exploits nullcongoa2013
Mobile code mining for discovery and exploits nullcongoa2013
 
iOS Application Security Testing
iOS Application Security TestingiOS Application Security Testing
iOS Application Security Testing
 
Html5 on mobile
Html5 on mobileHtml5 on mobile
Html5 on mobile
 
Android secure coding
Android secure codingAndroid secure coding
Android secure coding
 
Android attacks
Android attacksAndroid attacks
Android attacks
 
Automation In Android & iOS Application Review
Automation In Android & iOS 	Application Review�Automation In Android & iOS 	Application Review�
Automation In Android & iOS Application Review
 
Web Services Hacking and Security
Web Services Hacking and SecurityWeb Services Hacking and Security
Web Services Hacking and Security
 
Source Code Analysis with SAST
Source Code Analysis with SASTSource Code Analysis with SAST
Source Code Analysis with SAST
 
HTML5 hacking
HTML5 hackingHTML5 hacking
HTML5 hacking
 
XSS - Attacks & Defense
XSS - Attacks & DefenseXSS - Attacks & Defense
XSS - Attacks & Defense
 
Defending against Injections
Defending against InjectionsDefending against Injections
Defending against Injections
 
XPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal InjectionXPATH, LDAP and Path Traversal Injection
XPATH, LDAP and Path Traversal Injection
 
Blind SQL Injection
Blind SQL InjectionBlind SQL Injection
Blind SQL Injection
 
Application fuzzing
Application fuzzingApplication fuzzing
Application fuzzing
 
SQL injection basics
SQL injection basicsSQL injection basics
SQL injection basics
 
Applciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumerationApplciation footprinting, discovery and enumeration
Applciation footprinting, discovery and enumeration
 
Assessment methodology and approach
Assessment methodology and approachAssessment methodology and approach
Assessment methodology and approach
 
HTTP protocol and Streams Security
HTTP protocol and Streams SecurityHTTP protocol and Streams Security
HTTP protocol and Streams Security
 

Recently uploaded

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 

Recently uploaded (20)

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 

CSRF, ClickJacking & Open Redirect

  • 1. CSRF  (Cross  Site  Request  Forgery)   ClickJacking  &  Open  Redirects  
  • 2. Cross  Site  Request  Forgery  (CSRF)   •  Generic  CSRF  is  with  GET  /  POST   •  Forcefully  sending  request  to  the  target  applicaEon   with  cookie  replay   •  Leveraging  tags  like   –  IMG –  SCRIPT –  IFRAME •  Not  abide  by  SOP  or  Cross  Domain  is  possible  
  • 3. Request  generaEon            IMG  SRC      <img  src="hOp://host/?command">        SCRIPT  SRC      <script  src="hOp://host/?command">        IFRAME  SRC      <iframe  src="hOp://host/?command">    
  • 4. Request  generaEon          'Image'  Object      <script>      var  foo  =  new  Image();      foo.src  =  "hOp://host/?command";      </script>       XHR  –  Cross  domain  difficult  
  • 5. Request  generaEon   •  It  is  possible  to  generate  POST  as  well   •  Form  can  be  build  dynamically  and  buOon   click  from  JavaScript  is  possible   <script  type="text/javascript"   language="JavaScript">              document.foo.submit();   </script>    
  • 6. Cross  Site  Request  Forgery  (CSRF)   •  What  is  different  with  Web  2.0   – Is it possible to do CSRF to XML stream – How? – It will be POST hitting the XML processing resources like Web Services – JSON CSRF is also possible – Interesting check to make against application and Web 2.0 resources
  • 7. One  Way  CSRF  Scenario  
  • 8. One  Way  CSRF  Scenario  
  • 9. One  Way  CSRF  Scenario  
  • 10. One  Way  CSRF  Scenario  
  • 12. One-­‐Way  CSRF   •  <html>   •  <body>   •  <FORM  NAME="buy"  ENCTYPE="text/plain"  acEon="hOp:// trade.example.com/xmlrpc/trade.rem"  METHOD="POST">   •               <input  type="hidden"  name='<?xml  version'  value='"1.0"? ><methodCall><methodName>stocks.buy</ methodName><params><param><value><string>MSFT</string></ value></param><param><value><double>26</double></value></ param></params></methodCall>'>   •  </FORM>   •  <script>document.buy.submit();</script>   •  </body>   •  </html>  
  • 13. Forcing  XML   •  Spligng  XML  stream  in  the  form.   •  Possible  through  XForms  as  well.   •  Similar  techniques  is  applicable  to  JSON  as   well.    
  • 14. Two-­‐Way  CSRF   •  One-­‐Way  –  Just  making  forceful  request.   •  Two-­‐Way   – Reading the data coming from the target – May be getting hold onto important information – profile, statements, numbers etc. – Is it possible with JSON/XML
  • 16. Two-­‐Way  CSRF   •  ApplicaEon  is  serving  various  streams  like  –   JSON,  JS-­‐Object,  Array  etc.    
  • 18. Two-­‐Way  CSRF   •  AOacker  page  can  make  cross  domain  request   using  SCRIPT  (firefox)   •  Following  code  can  overload  the  array  stream.        funcEon  Array()      {  var  obj  =  this;  var  index  =  0;  for(j=0;j<4;j++){  obj[index++]   seOer  =  spoof;  }  }  funcEon  spoof(x){  send(x.toString());  }    
  • 20. Two-­‐Way  CSRF   •  It  is  possible  to  overload  these  objects.   •  Reading  and  sending  to  cross  domain  possible.   •  Opens  up  two  way  channel  for  an  aOacker.   •  Web  2.0  streams  are  vulnerable  to  these   aOacks.  
  • 21. Countermeasure   •  Server  Side  Checks   –  Check for client’s content-type. –  XHR calls – xml/application. –  Native calls – text/html. –  Filtering is possible on it. •  Client  Side  Checks   –  Stream can be started and terminated by /* or any predefined characters. –  Client can remove them before injecting to DOM.
  • 23. DescripEon   • Clickjacking  is  a  popular  name  for  an  old  aOack   method  called  “UI  redressing”   • Though  a  case  of  “old  wine  in  a  new  boOle”,   given  the  current  development  in  Web   standards  (Web  2.0,  AJAX,  etc),  one  cannot   ignore  the  risks  posed  by  this  vulnerability   • The  basic  philosophy  of  this  aOack  is  to  fool   the  user  into  clicking  a  malicious  link  
  • 24. DescripEon   •  Clickjacking  involves  “hijacking”  the  user's   mouse  clicks   •  This  means,  the  user  thinks  (s)he's  clicking   on  something,  but  is  actually  not   •  The  user,  invariably  and  unknowingly   authorizes  certain  acEons  which  could  have   disasterous  consequences  or  could  be  as   harmless  as  being  redirected  to  a  games  site  
  • 25. AOack  Anatomy   •  There  are  3  popular  ways  in  which  aOackers   perpetrate  this  vulnerability   –  Using invisible elements such as iframes –  Injecting malicious javascript (or any other client side scripting language) –  Leveraging a bug in Adobe Flash Player (this method is now obsolete)
  • 26. AOack  Anatomy   •  An  aOacker  uses  the  concept  of  layering  to   crat  an  aOack   •  Basically,  the  page  that  the  user  views,  will   have  layers   •  Some  of  these  layers  will  be  transparent  (or   invisible)     •  The  user  will  never  know  of  the  invisible   layers  and  will  end  up  making  a  wrong   choice  
  • 27. AOack  Anatomy   •  Lets  first  understand  this  basic  mechanism   with  an  example  and  then  move  on  to  the   different  ways  of  perpetraEng  this  aOack  ....  
  • 28. AOack  Anatomy   Send email to all users ? Yes No Actual intented content ....
  • 29. AOack  Anatomy   Send email to all users ? Yes No Do you want a free iPad? No Intended content .... Malicious content for clickjacking
  • 30. AOack  Anatomy   Send email to all users ? Yes No Do you want a free iPad? No When the two are super imposed … (“Send email to all users?” Will not be visible, it is shown here for clarity)
  • 31. Unvalidated  Redirects  &   Forwards  
  • 32. DescripEon   •  Web  applicaEons  are  having  its  own  “flow”   •  Business  flow  needs  movement  between   pages  and  sites   •  ApplicaEon  uses  same  domain  or  cross   domain  redirects  and  forwards   •  It  allows  applicaEons  to  work  easily  and  access   same  domain  or  cross  domain  resources   (Single  Sign  On  –  leveraging)  
  • 33. DescripEon   •  HTTP  requests  can  be  GET  or  POST   •  Parameters  are  not  validated  and  can  lead  to   arbitrary  redirects   •  This  can  be  leveraged  at  ease  and  get   exploited  by  an  aOacker   •  AOacker  exploits  the  trust  and  leverage  the   vulnerability  
  • 34. AOack  Anatomy   •  As  a  part  of  root  cause,  there  must  be  a   redirect  hole   •  Example,   – http://foo.bank.com/login.aspx? user=xxx&page=trade.aspx •  Here  “page”  is  a  vulnerable  parameter   •  What  if?  Some  one  put  page=hOp:// yahoo.com  …  
  • 35. AOack  Anatomy   Attacker foo.bank.com http://foo.bank.com/login.aspx?user=xxx& page=http://yahoo.com Get redirect or JavaScript call for loading yahoo.com Vulnerability detected!!!
  • 36. AOack  Anatomy   •  What  is  redirect…   – If server sends 302 in its HTTP response – If server sends JavaScript with certain document object calls like “location” •  What  will  happen…   – It will send browser to new location – User will stay in impression that he/she is at trusted site but that is not the case
  • 37. AOack  Anatomy   Bank’s user foo.bank.com Login the page Login successful This is what in user’s mind… a.) URL – trusted, foo.bank.com b.) Login form - trusted
  • 38. AOack  Anatomy   •  User  is  doing  all  his  acEviEes   •  Full  trust  is  established  and  day  to  day  work  is   going  on   •  Now  aOacker’s  acEon  comes  in  …   •  AOacker  sends  a  mail  and  request  to  login  and   change  password  immediately  as  part  of   banking  policies   •   AOacker  acts  as  administrator  from  bank  
  • 39. AOack  Anatomy   •  Magic  is  in  the  link  and  trust  is  in  the  mind.   •  User  trust  the  URL  and  Link  both  consciously   and  subconsciously…   •  Following  link  will  be  sent.   http://foo.bank.com/login.aspx?user=xxx&date=12-12-2009&trust=good& page=http://203.88.xx.xx/security.html Link is injected User is going to trust this
  • 40. AOack  Anatomy   Click the link Get a redirect response to 203.88.XX.XX 1Link in mail
  • 41. AOack  Anatomy   Bank’s user foo.bank.com Click the link Get a redirect response to 203.88.XX.XX 203.88.XX.XX (Attacker’s area) Bank’s user Send dummy form Trusted evil redirect 2
  • 42. AOack  Anatomy   Bank’s user foo.bank.com Click the link Get a redirect response to 203.88.XX.XX 203.88.XX.XX (Attacker’s area) Bank’s user Send dummy form Bank’s user Send username and password Send dummy response (Thanks!) Trusted evil redirect 203.88.XX.XX (Attacker’s area) 3
  • 43. AOack  Anatomy   Bank’s user foo.bank.com Click the link Get a redirect response to 203.88.XX.XX 203.88.XX.XX (Attacker’s area) Bank’s user Send dummy form Bank’s user Send username and password Send dummy response (Thanks!) Trusted evil redirect 203.88.XX.XX (Attacker’s area) Logs in and do money transfer 4