当前位置:网站首页>ctfshow 105-127
ctfshow 105-127
2022-06-21 21:29:00 【To throw the pot】
Web(105)【foreach function 】

Foreach function PHP: foreach - Manual
?suces=flag post error=suces
Web(106)【shal】

?v2[ ]=3
v1[ ]= Before 104 However, because a condition is added here, different assignments should be used .
Web(107)【Parse_str function 】

Parse_str The function adds a string to an array , Will be v1 Add to array ,
?v3【】=
Post
V1=
because md5 The array cannot be parsed so it is empty , We don't give v1 To the end ,v2 The value of is empty , So air to air is true .
Web(108)【ereg function 】

ereg() The function searches for the specified string in a string with the specified pattern , If the match is successful, return true, otherwise , Then return to false. Searching for alphabetic characters is case sensitive .
strrev() Function to reverse the string .
intval() Function to get the integer value of a variable
The first thing you need to know is %00 Can cut off ereg() Function search , Regular expressions will only match %00 Previous content ;0x36d The decimal content of is 877, We need letters in front of us to meet if Regular matching of conditions to skip if sentence , Then the string is inverted to get 877a, next intval() Function takes the integer part to get 877 therefore payload by
?c=a%00778
Web109【 Reflection class and exception handling class 】

V1 and v2 All letters are required . The final form is generally not good, so we need to use a class to contain functions , The final output .
Exception Processing is used to change the normal flow of a script when a specified error occurs , yes php Built in exception handling class
ReflectionClass perhaps ReflectionMethod Are commonly used reflection classes , It can be understood as the mapping of a class
?v1=Exception&v2=system('tac fl36dg.txt')
perhaps
?v1=ReflectionClass&v2=system('tac fl36dg.txt')
perhaps
?v1=ReflectionMethod&v2=system('tac fl36dg.txt')
Build the exception class and add system The function is followed by the output , The first thing to look at is flag The location of the car can be system(ls) Then it was discovered in fl36dg.txt in . Building a successful .
Web 110【FilesystemIterator iterator 】

utilize FilesystemIterator Get all the files in the specified directory
getcwd() function Get the current working directory
echo new FilesystemIterator(getcwd()); // By default, only the first file is displayed , Need to traverse
?v1=FilesystemIterator&v2=getcwd
After the url From a visit to falg File name .
Web111【$GLOBALS】

This time, the test is still focused on variable coverage ( If you forget something, go over it web105), Preferred needs v1 contain ctfshow In order to be regular , perform getflag function , therefore v1=ctfshow, And then getflag In the function , Will be able to v2 Send the address of to v1, Then output v1, Here we can use php Global variable in GLOBALS
$GLOBALS — References all variables available in the global scope A global composite array containing all variables . The name of the variable is the key of the array .
therefore payload by
Code
?v1=ctfshow&v2=GLOBALS
Process is $ctfshow=&$GLOBALS( Global variables contain flag The variable of ), And then through var_dump Output $ctfshow
Web112【is_file() function ,filter() function 】

is_file() Function to check whether the specified file name is a normal file
filter() The function is used to access data from non secure sources ( For example, user input ) Verify and filter
Here, first of all, if The statement can only be executed if the file type we need to pass in is not a file type highlight_file Statement to read flag file , That is, a bypass test site , We use php Pseudo protocol is enough , therefore payload by
?file=php://filter/resource=flag.php

Web113【.zlib:】

More filtering filter The last question cannot be used any more , have access to hint The solution in is the same as that in the previous question compress.zlib://flag.php
This prompt is used to solve . Why didn't you find the reason .
Web114【】

take filter Restrictions lifted , Try it and you will get .?file=php://filter/resource=flag.php
Web123【 Variable name 】

I saw a behind eval() The function will execute $c, So we focus on $c and if Judge the two post that will do
stay php Variable names in are only underlined with numbers and letters , By get perhaps post Passed in variable name , If it contains Space 、+、[ It will be transformed into _, So we can't construct CTF_SHOW.COM This variable ( Because it contains .), but php There is a feature in if you pass in [, It is transformed into _ after , The following characters will be preserved and will not be replaced , therefore payload by
post:
CTF_SHOW=1&CTF[SHOW.COM=1&fun=echo $flag
web125


CTF_SHOW=1&CTF[SHOW.COM=1&fun=echo $flag Make changes on the basis of the above question, and then it will flag and echo Filtered , Now we need to combine a read file operation with a flag Pass in ,flag After being filtered, you can create a new file with its turning function
CTF_SHOW=1&CTF[SHOW.COM=1&fun=highlight_file($_GET[1]);
?1=flag.php
web126【$_SERVER['argv'][0]=$_SERVER['QUERY_STRING']】

$_SERVER['argv'][0]=$_SERVER['QUERY_STRING']
query string yes Uniform Resource Locator (URL) Part of , It contains information that needs to be passed on to web application The data of
GET:?$fl0g=flag_give_me
POST:CTF_SHOW=&CTF[SHOW.COM=&fun=assert($a[0])
Web127【extract】

extract() Function to import variables from an array into the current symbol table , Use the array key name as the variable name , Use array key value as variable value
For example ?a=2, Will become $a=2, here ctf_show There is one _ It needs to be constructed , As I said before php Variable names in are only underlined with numbers and letters , By get perhaps post Passed in variable name , If there are spaces 、+、[ It will be transformed into _, The space here is not ban, So we use spaces ,payload by
?ctf show=ilove36d
边栏推荐
- 数据库管理:Navicat Premium 15
- js中的for.....in函数
- 可以在网上炒股开户吗?是安全的吗
- How to solve the problem of automatically updating the click times of weaving dream article list
- JS中的构造函数(重点)
- Vscode有什么好用的插件?
- Principle and application of user mode hot patch
- 11、 Beautify the interface
- Class loading process of JVM
- [applet] realize applet and background ASP through request Net data JSON transmission (post protocol text + code)
猜你喜欢

js中的for.....in函数

Database management: Navicat premium 15

Scientific research cartoon | you can learn EEG by looking at the picture. Would you like to try it?

Definition of unused processing methods when compiling C51 with keil 5

Intersection du vecteur et du plan

What plug-ins are available for vscade?
![[server data recovery] a case of RAID5 data recovery of an EMC server](/img/cc/23adaa1f8bc57d350e4a5647ff9296.jpg)
[server data recovery] a case of RAID5 data recovery of an EMC server

科研漫画 | 看图可以学脑电,来试试?

浅谈代码语言的魅力

全新混合架构iFormer!将卷积和最大池化灵活移植到Transformer
随机推荐
About n before variables in SQL server and other usage analysis
Cylinder function block (FB) of PLC function block series
ACM. HJ35 蛇形矩阵 ●
集群二---LVS负载均衡群集DR模式
2022年焊工(高级)考试题模拟考试题库模拟考试平台操作
Data processing and visualization of machine learning [iris data classification | feature attribute comparison]
Is it true and safe for qiniu to open a securities account? Do you charge for opening an account
微信小程序js把数字转化成字母
How to orderly coordinate and manage multiple R & D projects?
【小程序】通过request实现小程序与后台asp.net的数据json传输(Post协议 图文+代码)
如何解决织梦文章列表自动更新点击次数
Delaying patient self-help guide | "I have 100 excuses for not delaying, but I am not willing to take a step"
合并两个有序数组
在AD中安装元件和封装库
一行代碼可以做什麼?
Mendeley 安装、配置、使用
What kind of person are you in life?
如何解决idea文件被锁Make File Read-Only?
自己动手写编译器:while,for,do等循环语句的中间代码生成
MySQL learning (from getting started to mastering 1.2)