前言
![图片[1],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125064115403.png?imageView2/0/format/webp/q/75)
Web89
![图片[2],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124122939283.png?imageView2/0/format/webp/q/75)
intval取整数 就跟python中的int一样
这里是只要有0-9就输出nonono 但是还需要是传出去是整数
所以我们用数组绕过
![图片[3],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124123052705.png?imageView2/0/format/webp/q/75)
Web90
![图片[4],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124123306671.png?imageView2/0/format/webp/q/75)
intval($var,$base),其中var必填,base可选,这里base=0,则表示根据var开始的数字决定使用的进制: 0x或0X开头使用十六进制,0开头使用八进制,否则使用十进制。
这里是0开头 说明是根据开始的数字决定使用的进制
这里用的是八进制十六进制绕过 加0是告诉服务器这是八进制 如果转换成十六进制需要加0x
![图片[5],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124124423944.png?imageView2/0/format/webp/q/75)
Web91
![图片[6],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124125907994.png?imageView2/0/format/webp/q/75)
不想打字了,感觉WP里给的说的好全面
i忽略大小写 m多行模式 我们只要让我们的参数里含有php即可
payload:cmd?=111%0aphp 或者cmd?=php%0aggg
![图片[7],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124130105767.png?imageView2/0/format/webp/q/75)
Web92
![图片[8],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124130711881.png?imageView2/0/format/webp/q/75)
这里与web90的不同之处就在于等号了
===表示类型和数值必须相等 ==是值相等就可以类型不一定相等
我们知道强制转换如果是小数部分的话会舍弃小数部分直接构造小数
![图片[9],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124131528140.png?imageView2/0/format/webp/q/75)
Web93
![图片[10],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124131729675.png?imageView2/0/format/webp/q/75)
不解释直接秒
Web94
![图片[11],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124132210617.png?imageView2/0/format/webp/q/75)
查一下strpos用法
![图片[12],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124132230912.png?imageView2/0/format/webp/q/75)
这里说明我们得含有0 但不能在开头,因为开头告诉服务器使用几进制
![图片[13],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124132753172.png?imageView2/0/format/webp/q/75)
Web95
![图片[14],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124133230780.png?imageView2/0/format/webp/q/75)
过滤了.八进制起手 +或者空格绕过最后一个限制
![图片[15],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124134119362.png?imageView2/0/format/webp/q/75)
Web96
直接远程读取高亮显示
![图片[16],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124134710144.png?imageView2/0/format/webp/q/75)
Web97
![图片[17],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124140110657.png?imageView2/0/format/webp/q/75)
这个意思需要我们post传入a和b的内容不同但md5的值一样
![图片[18],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124140031280.png?imageView2/0/format/webp/q/75)
![图片[19],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124140143328.png?imageView2/0/format/webp/q/75)
Web98
![图片[20],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124165133519.png?imageView2/0/format/webp/q/75)
三元操作符号 以冒号为分隔 如果?之前成立则执行一,否则执行二
第二个和第三行意思一样 没用 直接看最后一行 如果get的值http_flag==flag则输出flag
因为之前传的get会给咱们变成post 所以咱们直接传get
post里传值
![图片[21],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124170140688.png?imageView2/0/format/webp/q/75)
Web99
![图片[22],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124170718574.png?imageView2/0/format/webp/q/75)
头稍微有点小大,我们的目的应该是把content里传入一句话木马,写入n里即可
写入n 那么n肯定是php中吧所以后缀肯定让n=几php 0x36d 一眼十六进制 转化过来是877
![图片[23],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124171302354.png?imageView2/0/format/webp/q/75)
接下来就是上蚁剑连接
![图片[24],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124171436415.png?imageView2/0/format/webp/q/75)
![图片[25],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240124171453761.png?imageView2/0/format/webp/q/75)
WEB100
![图片[26],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125014216720.png?imageView2/0/format/webp/q/75)
=的优先级比and高 所以只需满足V1是数字=true让if那里成立 让后尝试绕过第一个if
第一个if不含; 第二个if含;
![图片[27],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125015516998.png?imageView2/0/format/webp/q/75)
![图片[28],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125015552941.png?imageView2/0/format/webp/q/75)
Web101
![图片[29],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125035423597.png?imageView2/0/format/webp/q/75)
过滤的更多了,
这里是新建了一个类,通过反射类拿到flag,在java一些语言也有(都是看wp说的..
v3并没有给;所以可以让v3=;
?v1=1&v2=echo new ReflectionClass&v3=;
![图片[30],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125053121137.png?imageView2/0/format/webp/q/75)
![图片[31],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125053231163.png?imageView2/0/format/webp/q/75)
最后转换少一位爆破就可以了
Web102
![图片[32],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125053928622.png?imageView2/0/format/webp/q/75)
需要好好考虑一下构造payload
我们的内容是什么 我们的内容是把str的内容写进v3 也就说str里要写eval函数或者能拿flag的函数
根据优先级的问题还是让v1=1这样才能v4等于true
$str = call_user_func($v1,$s); 意思我们通过调用v1这个函数(hex2bin这个函数将十六进制转换为二进制字符串) 执行s并把执行结果给str 让后把str的结果写给进v3
v3得的后缀是个php把 这样才能写进去 通过伪协议进行创建
substr截取两个字符 也就是从第三个字符开始读取 所以要用十六进制 让后通过hex2bin将十六进制转换为二进制字符串 关键这个十六进制改怎么构建 我们需要把<?php `cta *`?> 转换一下 我们可以先把他转换成base64 再把base64转换为十六进制
5044383959474e6864434171594473=PD89YGNhdCAqYDs=<?php `cta *`?>
但是为了截取两个数字那么要从要在前面十六进制加两个数字随便加个99吧995044383959474e6864434171594473
加什么都无所谓都会被截取
?v2=995044383959474e6864434171594473&v3=php://filter/write=convert.base64-
decode/resource=godyu.php
POST里传
v1=hex2bin
![图片[33],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125062602376.png?imageView2/0/format/webp/q/75)
访问godyu.php 右键查看源代码
![图片[34],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125062633122.png?imageView2/0/format/webp/q/75)
Web103
![图片[35],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125062856310.png?imageView2/0/format/webp/q/75)
上把的直接梭哈
![图片[36],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125063200596.png?imageView2/0/format/webp/q/75)
WEB104
![图片[37],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125063744696.png?imageView2/0/format/webp/q/75)
sha1转换一下直接秒
![图片[38],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125063834178.png?imageView2/0/format/webp/q/75)
![图片[39],[CTFshow]WebPHP特性章节之[89-104]笔记,网络安全爱好者中心-神域博客网](https://img.godyu.com/2024/01/20240125063849615.png?imageView2/0/format/webp/q/75)
暂无评论内容