0x00 注入的产生

  1. 程序在开发的时候没对用户的数据过滤,把用户的数据都当做可信数据。
  2. 过滤不严格。
  3. 数据库配置不当。
  4. 转义不当。

    0x01 注入的类型

    常见的注入我们可以归纳为数字型,字符型,搜索型,盲注等。select * from admin where id = $id; //数字型 注入

select * from admin where id = ‘$id’; //字符型

select * from admin where id = “$id”;

select * from admin where id = ($id);

select * from admin where id = (‘$id’);

select * from admin where id = (“$id”);

select * from admin where username like ‘%adm%’;

select * from admin where username like (‘%adm%’);

select * from admin where id = $id limit 0,1;

select * from admin order by $id;

select * from admin order by limit 0,1 $id;

select * from admin order by id limit 1,1 $id;

insert注入

update注入

delete注入

二次注入

等等实际环境中我们可能还会遇到更为复杂的sql注入语句,我们就要想办法闭合它。# 0x03 寻找注入的一些注意 如何寻找注入是一门艺术,黑盒测试它建立在对每个参数的fuzz上,当然如果你有开发经验,拿到一套程序就能敏锐的发现注入, 但凡涉及到用户交换地方都将是注入的重灾区,所以你可以适当的学习一下开发。

  1. 当网站为成熟的cms框架时不建议直接黑盒注入,可以直接审计源码,或者搜索漏洞。
  2. 判断为自己开发的系统,目标不是很重要可以尝试使用AWVS 等工具。
  3. 信息收集的重要性,可能它的源码就在GitHub上,或者一个备份文件。

    0x03 文末

    本文如有错误,请及时提醒,避免误导他人

  • 1-4-注入的产生 - 图1author:404