What is the difference between XSS and CSRF from their execution perspective?
What is the difference between XSS and CSRF from their execution perspective?
https://www.quora.com/What-is-the-difference-between-XSS-and-CSRF-from-their-execution-perspective/answer/Deepthi-210
Fundamental difference is that CSRF (Cross-site Request forgery) happens in authenticated sessions when the server trusts the user/browser,
while XSS (Cross-Site scripting) doesn't need an authenticated session and can be exploited when the vulnerable website doesn't do the basics of validating or escaping input.
In case of XSS, when the server doesn't validate or escapes input as a primary control, an attacker can send inputs via request parameters or any kind of client side input fields (which can be cookies, form fields or url params).These can be written back to screen , persisted in database or executed remotely.
For CSRF, consider an example when you are logged in into your banking site and at the same time logged into Facebook in another tab in same browser.
An attacker can place a malicious link embedded in another link or zero byte image which can be like your banksite.com/transfer.do?fromaccnt=youraccnt&toaccnt=attackersAccount&amt=2500.
Now, if you accidentally click on this link , in the background transfer can happen though you clicked from the Facebook tab.
This is because your session is still active in browser and browser has your session id.
This is the reason the most popular CSRF protection is having another server supplied unique token generated and appended in the request.
This unique token is not something which is known to browser like session id.
This additional validation at server (i.e whether the transfer request also contains the correct CSRF token) will make sure that the attacker manipulated link (I.e the CSRF attack) in above example will never work.
https://www.quora.com/What-is-the-difference-between-XSS-and-CSRF-from-their-execution-perspective/answer/Yash-Pandya-4
csrf is all about checking auth_tockens used in from , in csrf attck you can create spoof html form and force other victim to do things according to your need while xss is all about javascript execution . you can read more about both on owasp.org
https://www.quora.com/What-is-the-difference-between-XSS-and-CSRF-from-their-execution-perspective/answer/Gaurav-Sharma-2819
The fundamental difference between CSRF and XSS is that
cross-site scripting (XSS), is designed to exploit the trust the user has for a particular site
whilst
CSRF aims to exploit the trust that a website has in the visitor’s browser.
Difference between XSS and CSRF attacks
How does a CSRF attack work?
In a CSRF attack, a malicious web site tells the victim’s web browser to send a malicious request to an honest site, as if the request were part of the victim’s interaction with the honest web site, making use of the existing victim’s context, such as cookies.
So let’s say you are logged in into Facebook. That implies that your web browser obtained the session i.e. the cookie to access your Facebook account. Every time you interact with Facebook, their server checks the cookie you send with the request so they know it’s you.
Let’s assume that when clicking the logout button of Facebook, a GET request is made to the following URL: https://facebook.com/logout. Now you visit the website of the attacker which contains the following HTML-snippet:
<img src="https://facebook.com/logout">
This will cause your browser to load the image-URL of the img tag, which comes down to a GET request to https://facebook.com/logout. Your browser will automatically send your session together with the GET-request to Facebook.
That means that the attacker was able log you out. He made a valid request with your user context without you even knowing.
Depending on the vulnerable web site, using CSRF, attackers can change your credentials or user profile properties.
Even Gmail was vulnerable to CSRF as a story from 2007 shows. An attacker was able to get a victim on a malicious website that then send a request to Gmail and changed the victim’s Gmail filter properties.
Like this, the attacker was able to redirect the victim’s emails to his own email account.
Another common attack is to use CSRF to trigger a login initiated by the victim but with the attacker’s credentials.
Imagine you are on a malicious web site with a HTML-form. When clicking submit, the form makes a POST request to Google with the attackers credentials that are written into the HTML-form. Now the attacker is logged in on Google in the victim’s browser.
Google will document all visited web sites and browser history which the attacker can get access to later on.
So, both attacks have in common that they are client-side attacks and need some action of the end user, such as clicking on a link or visiting a web site.
XSS executes a malicious script in your browser, CSRF sends a malicious request on your behalf.
--
What is the difference between XSS and CSRF from their execution perspective?的更多相关文章
- 漏洞科普:对于XSS和CSRF你究竟了解多少
转自:http://www.freebuf.com/articles/web/39234.html 随着Web2.0.社交网络.微博等等一系列新型的互联网产品的诞生,基于Web环境的互联网应用越来越广 ...
- XSS 和 CSRF 攻击
web安全中有很多种攻击手段,除了SQL注入外,比较常见的还有 XSS 和 CSRF等 一.XSS(Cross Site Scripting)跨站脚本 XSS其实就是Html的注入问题,攻击者的输入没 ...
- XSS与CSRF两种跨站攻击比较
XSS:跨站脚本(Cross-site scripting) CSRF:跨站请求伪造(Cross-site request forgery) 在那个年代,大家一般用拼接字符串的方式来构造动态SQL 语 ...
- 【实习记】2014-08-23网络安全XSS与CSRF总结
XSS:脚本中的不速之客XSS:跨站脚本(Cross-site scripting)CSRF:冒充用户之手CSRF:跨站请求伪造(Cross-site request forgery) 谷歌搜 ...
- 总结 XSS 与 CSRF 两种跨站攻击
前言 在那个年代,大家一般用拼接字符串的方式来构造动态 SQL 语句创建应用,于是 SQL 注入成了很流行的攻击方式.在这个年代, 参数化查询 [1] 已经成了普遍用法,我们已经离 SQL 注入很远了 ...
- 浅谈CDN、SEO、XSS、CSRF
CDN 什么是CDN 初学Web开发的时候,多多少少都会听过这个名词->CDN. CDN在我没接触之前,它给我的印象是用来优化网络请求的,我第一次用到CDN的时候是在找JS文件时.当时找不到相对 ...
- XSS和CSRF的理解
声明:转自 http://www.cnblogs.com/hyddd/archive/2009/04/09/1432744.html XSS攻击:跨站脚本攻击(Cross Site Scripting ...
- 总结XSS与CSRF两种跨站攻击
XSS:跨站脚本(Cross-site scripting),实际应是"CSS",但由于和层叠样式表CSS名称冲突,故改为"XSS" CSRF:跨站请求伪造(C ...
- 014_浅说 XSS和CSRF
在 Web 安全领域中,XSS 和 CSRF 是最常见的攻击方式.本文将会简单介绍 XSS 和 CSRF 的攻防问题. 声明:本文的示例仅用于演示相关的攻击原理 XSS XSS,即 Cross Sit ...
随机推荐
- 宽字节 多字节 mbstowcs wcstombs
函数 size_t wcstombs(char *dest, const wchar_t *src, size_t n); //wide-character to a multibyte n:被写入到 ...
- LCD驱动的学习
简介: LCD是基于液晶的. LCD(liquid crystal display)按驱动方式分类可以分为静态驱动,简单矩阵驱动,主动矩阵驱动.其中,简单矩阵又可以分为扭转向列型(TN)和超转向列型( ...
- java判定数据(对象)类型
1.说明一 int 是关键字,Integer是包装类,Number是所有数字了的基类(父类).所以,Number是Integer的基础,Integer是int的基础,也称Integer是int的原型类 ...
- 算法笔试过程中的几个输入输出python语句
title: python在线笔试学习笔记 localimage: image1 urlname: writenexam categories: summary tags: [writen, exam ...
- CentOS7 安装记录
起因是想自建一个本地笔记云存储,按照网上的教程搭建,卡在了其中的一个步骤上(文章见https://www.laobuluo.com/1542.html),卡在了如下图的位置,google了一番解决的办 ...
- Linux系统Zip压缩和解压缩
Linux系统可以使用Zip来压缩占用空间较大的文件以便进行文件传输,传输完成后再进行解压缩来获取原文件.Linux安装Zip的命令为 apt-get install zip 安装完成后,使用 zip ...
- 三维视觉、SLAM方向全球顶尖实验室汇总
本文作者 任旭倩,公众号:计算机视觉life,编辑成员 欧洲 英国伦敦大学帝国理工学院 Dyson 机器人实验室 http://www.imperial.ac.uk/dyson-robotics-la ...
- redis在本地进行启动的方式
第一种 使用cmd命令行进行过操作 在本地配置好redis之后,启动的话是比较简单的 1-首先打开cmd运行界面 2-定位到本地redis目录 3-运行命令redis-server.exe redis ...
- ReLU激活函数
参考:https://blog.csdn.net/cherrylvlei/article/details/53149381 首先,我们来看一下ReLU激活函数的形式,如下图: 单侧抑制,当模型增加N层 ...
- redis五中数据类型
MySql+Memcached架构的问题 实际MySQL是适合进行海量数据存储的,通过Memcached将热点数据加载到cache,加速访问,很多公司都曾经使用过这样的架构,但随着业务数据量的不断增加 ...