xss

存储型XSS结合XSS平台获取cookie信息进后台

自古美人都是妖i 提交于 2019-12-29 19:30:22
实验目的:利用存储型XSS获取管理员Cookie信息,修改本地Cookie信息为管理员Cookie,以管理员身份不输入用户名、密码直接登陆后台 受害者浏览器:谷歌浏览器(也就是网站管理员使用的浏览器) 攻击者浏览器:火狐渗透便捷版浏览器 一、攻击者利用XSS漏洞攻击过程 第一步:使用火狐渗透测试便捷版浏览器打开目标网站 第二步:找到可以发表评论的地方,输入进行XSS测试,看是否弹窗,若弹窗则说明目标网站存在存储型XSS漏洞 此处,选择第一篇文章 下滑找到发表评论的位置,按照图中写入测试代码之后,点击提交发表 点击提交发表,立马弹窗提示/XSS/,说明存在XSS漏洞 第三步:用XSS平台对XSS漏洞进行利用 百度搜索XSS平台,选择第一个(这个平台需要注册账号,注册一下即可) 注册完成之后,输入用户名密码登录 首次登陆界面如下图所示,点击创建项目 项目名称与描述随便填写,自己认识就行 第四步:选择默认模块和keepsession (默认模块是获取cookie信息的) Keepsession:维持会话有效期 反之,不维持 keepsession功能说明 首先简单说明一下【XSS利用之延长Session生命周期】,说白了就是携带你X到的cookie访问对应的URL地址,一般情况下,如果你X到了对方的cookie,时间长不访问(默认21分钟)后,这个cookie就会失效

What is the correct way to detect whether string inputs contain HTML or not?

£可爱£侵袭症+ 提交于 2019-12-29 11:35:30
问题 When receiving user input on forms I want to detect whether fields like "username" or "address" does not contain markup that has a special meaning in XML (RSS feeds) or (X)HTML (when displayed). So which of these is the correct way to detect whether the input entered doesn't contain any special characters in HTML and XML context? if (mb_strpos($data, '<') === FALSE AND mb_strpos($data, '>') === FALSE) or if (htmlspecialchars($data, ENT_NOQUOTES, 'UTF-8') === $data) or if (preg_match("/[^\p{L}

深入解析跨站请求伪造漏洞:原理剖析

纵然是瞬间 提交于 2019-12-29 11:34:36
相关文章: 1. http://www.cnblogs.com/xiaoqian1993/p/5816085.html 深入解析跨站请求伪造漏洞:原理剖析 2 .http://blog.csdn.net/kkdelta/article/details/17503947 web安全之跨站请求伪造 原理: CSRF攻击经常利用目标站点的身份验证机制,CSRF攻击这一弱点的根源在于Web的身份验证机制虽然可以向目标站点保证一个请求来自于某个用户的浏览器,但是却无法保证该请求的确是那个用户发出的或者是经过那个用户批准的。 CSRF和XSS攻击的区别 XSS攻击需要JavaScript,而CSRF攻击不需要;XSS攻击要求站点接受恶意代码,而对于CSRF攻击来说,恶意代码位于第三方站点上。过滤用户的输入可以防止恶意代码注入到某个站点,但是它无阻止法恶意代码在第三方站点上运行。由于恶意代码可以在第三方站点上运行,所以防御XSS攻击的措施无法保护站点不受CSRF攻击的危害。如果站点具有XSS攻击漏洞,那么它也有CSRF攻击漏洞。但是,即使站点针对XSS攻击采取了全面保护,却仍然面临CSRF攻击的威胁。 解决: (1)拒绝恶意请求。过滤器中添加如下。验证Referer请求来源: 1 //HTTP 头设置 Referer过滤 2 String referer = request2.getHeader

External image vulnerabilities

我们两清 提交于 2019-12-29 07:42:27
问题 What security holes can appear on my site by including external images via img tag and how to avoid them? I'm currently only checking the extension and mime-type of image on submission (that can be changed after URL is submitted) and URL is sanitized before putting it in src attribute. 回答1: There's probably a differentiation to be made here between who is at risk. If all you're doing is storing URLs, and not uploading images to your server, then your site is probably safe, and any potential

Is Markdown (with strip_tags) sufficient to stop XSS attacks?

混江龙づ霸主 提交于 2019-12-29 06:12:50
问题 I'm working on a web application that allows users to type short descriptions of items in a catalog. I'm allowing Markdown in my textareas so users can do some HTML formatting. My text sanitization function strips all tags from any inputted text before inserting it in the database: public function sanitizeText($string, $allowedTags = "") { $string = strip_tags($string, $allowedTags); if(get_magic_quotes_gpc()) { return mysql_real_escape_string(stripslashes($string)); } else { return mysql

Is there a definitive anti-XSS library for PHP?

牧云@^-^@ 提交于 2019-12-29 04:16:09
问题 I already know how XSS works, but finding out all the many different ways to inject malicious input is not an option. I saw a couple libraries out there, but most of them are very incomplete, ineficient, or GPL licensed (when will you guys learn that GPL is not good to share little libraries! Use MIT) 回答1: OWASP offers an encoding library, on which time has been spent to handle the various cases. Obsolete: http://www.owasp.org/index.php/Category:OWASP_Encoding_Project Now at http://code

Allow All Content Security Policy?

蓝咒 提交于 2019-12-29 03:54:27
问题 Is it possible to configure the Content-Security-Policy to not block anything at all? I'm running a computer security class, and our web hacking project is running into issues on newer versions of Chrome because without any CSP headers, it's automatically blocking certain XSS attacks. 回答1: For people who still want an even more permissive posts, because the other answers were just not permissive enough, and they must work with google chrome for which * is just not enough: default-src * data:

深入了解web前端原理,扩展学习

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

Edge浏览器(Chromium)——从XSS到接管网页

断了今生、忘了曾经 提交于 2019-12-28 06:29:04
微软早前宣布他们将发布基于Chromium的Edge浏览器。继谷歌Chrome之后,微软的Edge将成为第二款基于Chromium的浏览器。 在2019年8月20日,微软宣布了一项新的漏洞奖励 计划 ,主要针对基于Chromium的Edge浏览器。该项目规定,只有针对微软的代码所开发的攻击才能得到赏金,这意味着攻击面非常小。但为了弥补这一点,微软愿意提供了两倍的奖励。这意味着这款新浏览器中一个过审的漏洞可能价值3万美元。 在这篇文章中,我将解释是如何在这个新浏览器中发现3个不同的漏洞,从而赚到4万美元。我还惊喜地发现,我报告了这个项目中第一个有效漏洞。 New Tab Page (NTP) XSS 新标签页(NTP)是打开浏览器或打开新标签时看到的第一个页面。当然也有其他例外,我说的是默认设置下。NTP在新Edge浏览器中的一个独特之处在于它实际上是一个在线网站,地址为: https://ntp.msn.com/edge/ntp?locale=en&dsp=1&sp=Bing 火狐的内置页是 about:home/about:newtab ,Chrome浏览器的是 chrome-search://local-ntp/local-ntp.html 。我们现在必须寻找微软对Chromium所做的新改动,这样才能拿到赏金。 这个漏洞的发现其实是一个意外。当我第一次打开新Edge浏览器时

Android App using Webview/javascript. what can be security concern?

自闭症网瘾萝莉.ら 提交于 2019-12-28 05:38:25
问题 I am creating an android web app using Webview and Javascript making addJavascriptInterface(true) . My App will content data(html) that will be loaded from an external site. I worried about the cross-site-scripting XSS/security of my app as I am enabling addJavascriptInterface(true). What are the things I should be taking care so that any malicious code should not run on my app ? 回答1: I found a good study from Syracuse University called Attacks on WebView in the Android System, which