php decode

以下是我在南邮上做得一道题的笔记:  题目如下:

 是php的代码审计问题,

以下是对代码关键部分的学习:

php的方法:gzinflate()

说明

string gzinflate ( string $data [, int $length = 0 ] )

This function inflates a deflated string

参数

data

The data compressed by gzdeflate().

length

The maximum length of data to decode

返回值

The original uncompressed data or FALSE on error.

The function will return an error if the uncompressed data is more than 32768 times the length of the compressed input data or more than the optional parameter length.

php的eval函数:

定义和用法

eval() 函数把字符串按照 PHP 代码来计算。

该字符串必须是合法的 PHP 代码,且必须以分号结尾。

如果没有在代码字符串中调用 return 语句,则返回 NULL。如果代码中存在解析错误,则 eval() 函数返回 false。

语法

eval(phpcode)

由此可见该问题eval的用法不正确,所以将eval改为echo,在运行一下代码即可得到答案

 

猜你喜欢

转载自blog.csdn.net/weixin_42419856/article/details/82870113