分享

一个容易被忽视的技巧

 神人自有天助 2016-12-04

By Ay 暗影
 


这个方法应该我想应该也有很多人知道了,只是没有人写出来,偷偷的告诉你们,这个
方法可以绕过很多 web 防火墙,话说从现在之后能不能绕过我就不知道了,哈哈。但是该方 法的局限就是只适合在 MYSQL 上,其他数据库貌似不支持。转入正题:
首先来看 MySQL 的官方文档
http://dev./doc/refman/5.1/en/comments.html


上面的详细信息大家自己去看了,下面我来讲一些关键的部分:
/*! MySQL-specific code */
一、

In this case, MySQL Server parses and executes the code within the comment as it would any other SQL statement, but other SQL servers will ignore the extensions. For example, MySQL Server recognizes theSTRAIGHT_JOIN keyword in the following statement, but
other servers will not:
SELECT /*! STRAIGHT_JOIN */ col1 FROM table1,table2 WHERE ...
二、

If you add  a version  number  after the “!” character, the syntax within the comment is executed only if the MySQL version is greater than or equal to the specified version number. The TEMPORARY keyword in the following comment is executed only by servers
from MySQL 3.23.02 or higher:
CREATE /*!32302 TEMPORARY */ TABLE t (a INT);

The comment syntax just described applies to how the  mysqld server parses SQL statements. The mysql client program also performs some parsing of statements before sending them to the server. (It does this to determine statement boundaries within a multiple-statement input line.)
Comments in this format, /*!12345 ... */, are not stored on the server. If this format is used to comment stored routines, the comments will not be retained on the server.
The use of short-form  mysql commands such as C within multi-line /* ...

*/ comments is not supported.

 

第一部分主要讲的意思是,MYSQL 在遇到/*!  SQL 语句*/这种格式的时候,里面的 SQL
语句会当正常的语句一样被解析,如图:
 
 

以上我们可以看到 where id=1 部分被 mysql 解析了。

第二部分: /*!12345 SQL 语句*/
翻译:如果在!之后是一串数字(这串数字就是 mysql 数据库的版本号),如果当前数据库的 版本号大于等于该数字,SQL 语句则执行,否则就不执行,如图:

 


我用的 MYSQL 是 5.1.57,当我刚好用 50157 这个版本号的时候,where 语句执行了,当版本
 
号大于我使用的版本号时,where 语句就不执行了。。。哟西,再截一个图:

 

然后接下来如何操作来填充其他字符来绕过防火墙就看大家的想象力了,抛砖引玉就到这里 了。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多