每日一博 | 渗透攻防 Web 篇 - 深入浅出 SQL 注入
1 背景 京东SRC(Security Response Center)收录大量外部白帽子提交的sql注入漏洞,漏洞发生的原因多为sql语句拼接和Mybatis使用不当导致。 2 手工检测 2.1 前置知识 mysql5.0以上版本中存在一个重要的系统数据库information_schema,通过此数据库可访问mysql中存在的数据库名、表名、字段名等元数据。information_schema中有三个表成为了sql注入构造的关键。 1)infromation_schema.columns: table_schema 数据库名 table_name 表名 column_name 列名 2)information_schema.tables table_schema 数据库名 table_name 表名 3)information_schema.schemata schema_name 数据库名 SQL注入常用SQL函数 length(str) :返回字符串str的长度 substr(str, pos, len) :将str从pos位置开始截取len长度的字符进行返回。注意这里的pos...
