当前位置: 首页 > news >正文

优化网站找哪家百度seo刷排名网址

优化网站找哪家,百度seo刷排名网址,网站建设服务费是否无形资产,wordpress阅读主题一、题目如下: 二、代码解读: 这段代码是一个简单的PHP脚本,它接受通过GET请求传递的两个参数:‘pass’和’func’: ① $password trim($_GET[pass] ?? );:从GET请求中获取名为’pass’的参数&#xff0…

一、题目如下:

在这里插入图片描述


二、代码解读:

这段代码是一个简单的PHP脚本,它接受通过GET请求传递的两个参数:‘pass’和’func’:
$password = trim($_GET['pass'] ?? '');:从GET请求中获取名为’pass’的参数,然后使用trim函数去除首尾空格,并将结果赋给变量 $password。如果’pass’参数不存在,则使用空字符串。
$func = trim($_GET['func'] ?? 'hint');:从GET请求中获取名为’func’的参数,然后使用trim函数去除首尾空格,并将结果赋给变量$func。如果’func’参数不存在,则默认使用字符串’hint’。
function hint() {show_source(__FILE__);} :定义了一个名为hint的函数,它的作用是显示当前文件的源代码,使用了show_source函数。
if (md5(\$password)==='21c6008facc283f8839d3b9fed640c15') {:检查通过GET请求传递的’pass’参数的MD5哈希值是否等于指定的值。如果匹配,进入条件块。
function youwin() {echo file_get_contents("/flag");}:在条件成立时,定义了一个名为youwin的函数,它的作用是输出名为’/flag’的文件的内容,使用了file_get_contents函数。
$func();:调用根据’func’参数确定的函数。默认情况下,如果’func’参数不存在,将调用hint函数。


二、解题思路:

常规思路就是绕过 md5 效验。但是这里是强比较,显然无法绕过。尝试参数爆破,看有没有除pass、func 额外的请求参数, bp 跑参数字典:

在这里插入图片描述

果然发现了一个 file 请求参数,使用 readfile() 函数读取文件,尝试任意文件读取:

在这里插入图片描述尝试读取 flag, 发现存在拦截:

在这里插入图片描述

readfile() 可以直接读取 php 文件,且php代码不会被解析

读取当前文件源代码:

在这里插入图片描述尝试绕过 preg_match 正则,传递数组参数:

在这里插入图片描述成功绕过,但是 readfile() 不接受数组作为参数, 网上没找到 readfile() 相关漏洞的文献资料。故放弃…


想起上上周看到 p 牛10月份写的一篇文章,提到了 PHP 临时函数名特性 , 且给的题目案例跟这题很像。 ==> 2023年10月PHP函数小挑战

PHP在编译“函数定义”的时候,会使用 zend_compile_func_decl 函数。这个函数有个关键的参数叫 toplevel,这个参数表示当前的函数定义是否在顶层作用域。

顶层作用域: 顶层作用域通常是指在全局范围内声明的变量、函数或类,而不是在任何函数或控制结构内声明的。

<?php// 在顶层作用域定义的函数
function func1() {echo 'func1';
}if (true) {// 在if条件判断内部定义的函数,不是顶层作用域function func2() {echo 'func2';}
}

当toplevel为true的时候,就是直接将当前函数名 lcname 加入函数表;当 toplevel为false的时候,使用 zend_build_runtime_definition_key 函数生成一个 key,将 key 作为函数名加入函数表。也就是说,根据函数所在的位置的不同(是否是顶级作用域),PHP编译时生成的函数名也会不同。
在这里插入图片描述

key 是按照如下算法生成:

'\0' + name + filename + ':' + start_lineno + '$' + rtd_key_counter

除了第一个 \0 字符,后面四部分的含义如下:

  • name 函数名
  • filename PHP文件绝对路径
  • start_lineno 函数起始定义行号(以1为第一行)
  • rtd_key_counter 一个全局访问计数,每次执行会自增1,从0开始

最后保存在函数表中的函数名,就是上面这个以 \0 开头的字符串。


以上是看 p 牛的文章简要梳理一下核心知识点。但是我发现一个问题:

在这里插入图片描述图中说只要构造:'\0' + name + filename + ':' + start_lineno + '$' + rtd_key_counter 调用就可以了,但是后面图中 payload 又是:
'%00' + name + filename + ':' + start_lineno + '$' + rtd_key_counter 这种方式:

在这里插入图片描述在这里插入图片描述
为什么又变成了 %00 而不是 \0 呢?小小的探究一下:

前提:windows,php 7.4 (要限制7.4版本,稍后会说), vld.dll 内存监控插件 (要下载和php版本相对应的)

本地编写和比赛环境一样的代码,文件名为:965ee283f4c848ad99b0a7961ed89199.php,使用php7.4 配合vld插件解释运行:

 ./php -d vld.execute=0 -d vld.active=1  E:\phpstudy_pro\WWW\php-learn\965ee283f4c848ad99b0a7961ed89199.php

在这里插入图片描述在这里插入图片描述可以看到实际的临时函数名确实是以 %00 开头的。php 底层是由C语言编写的,在C语言中,\0和%00实际上有相似的作用,都表示空字符(null character)。\0是C语言中用于表示空字符的一种方式,通常用在字符串中作为字符串的结束标志。%00通常是在格式化输入输出函数中使用的格式说明符,表示空字符。 我们请求参数被php接收并解释运行,也是一个输入的过程,所以要使用 %00 为开头构建。(个人见解)


为什么要限制 php7.4 这个版本去复现呢?

我尝试使用 php7.3 版本配合vld插件去解释运行相同的代码,得到如下:

在这里插入图片描述在这里插入图片描述不同版本有差异性,7.4 版本结尾更加具有规律性,能爆破。


按照上面的思路,按照 zend_build_runtime_definition_key 的算法计算出 key 作为函数名:(rtd_key_counter 从 0 开始爆破)

%00youwin/var/www/html/965ee283f4c848ad99b0a7961ed89199.php:7$rtd_key_counter

比赛环境没了,本地搭了一个。

发现爆破不出flag:

在这里插入图片描述

trim 函数在接收参数的时候会去除掉字符串首尾的空白字符。可以加反斜杠绕过:\%00

故要改写成如下:

\%00youwin/var/www/html/965ee283f4c848ad99b0a7961ed89199.php:7$rtd_key_counter

bp 开始爆破 rtd_key_counter 得 flag:

在这里插入图片描述


文章转载自:
http://dinnconu.tqpr.cn
http://dinncowearily.tqpr.cn
http://dinncopent.tqpr.cn
http://dinncoexaminant.tqpr.cn
http://dinncoallottee.tqpr.cn
http://dinncocontented.tqpr.cn
http://dinncomultinucleate.tqpr.cn
http://dinncocraniofacial.tqpr.cn
http://dinncotitleholder.tqpr.cn
http://dinncosacrum.tqpr.cn
http://dinnconaprapath.tqpr.cn
http://dinncocomint.tqpr.cn
http://dinncoastrolater.tqpr.cn
http://dinncocolligative.tqpr.cn
http://dinncoarrowworm.tqpr.cn
http://dinncogladly.tqpr.cn
http://dinncoleger.tqpr.cn
http://dinncopronounced.tqpr.cn
http://dinncoosteologic.tqpr.cn
http://dinncoguttman.tqpr.cn
http://dinncohypochondriasis.tqpr.cn
http://dinncoclochard.tqpr.cn
http://dinncobiogeocoenose.tqpr.cn
http://dinncocommunications.tqpr.cn
http://dinncoaraneid.tqpr.cn
http://dinncomocha.tqpr.cn
http://dinncodenitrator.tqpr.cn
http://dinncoarmill.tqpr.cn
http://dinncocreamer.tqpr.cn
http://dinncojuggling.tqpr.cn
http://dinncofeasibility.tqpr.cn
http://dinncoallemande.tqpr.cn
http://dinncosequela.tqpr.cn
http://dinncooecumenical.tqpr.cn
http://dinncopredicament.tqpr.cn
http://dinncoforbode.tqpr.cn
http://dinncogunn.tqpr.cn
http://dinncoreclusion.tqpr.cn
http://dinncodeflate.tqpr.cn
http://dinncoprakrit.tqpr.cn
http://dinncoharlem.tqpr.cn
http://dinncowhithersoever.tqpr.cn
http://dinncovulgarisation.tqpr.cn
http://dinncogazania.tqpr.cn
http://dinncoartificial.tqpr.cn
http://dinncoretry.tqpr.cn
http://dinncolufthansa.tqpr.cn
http://dinncospine.tqpr.cn
http://dinncoworkwoman.tqpr.cn
http://dinncoseismogram.tqpr.cn
http://dinncoaugustly.tqpr.cn
http://dinncoprotostar.tqpr.cn
http://dinncomungo.tqpr.cn
http://dinncobushcraft.tqpr.cn
http://dinncoswill.tqpr.cn
http://dinncowritten.tqpr.cn
http://dinncolaputan.tqpr.cn
http://dinncopowerword.tqpr.cn
http://dinncoeptitude.tqpr.cn
http://dinncolovage.tqpr.cn
http://dinncodetour.tqpr.cn
http://dinncohoick.tqpr.cn
http://dinncolargando.tqpr.cn
http://dinncognosticism.tqpr.cn
http://dinncosciential.tqpr.cn
http://dinnconarcoanalysis.tqpr.cn
http://dinncoshiplap.tqpr.cn
http://dinncofallout.tqpr.cn
http://dinncobacklining.tqpr.cn
http://dinncomid.tqpr.cn
http://dinncorepublicrat.tqpr.cn
http://dinncoanticoagulate.tqpr.cn
http://dinncolapidate.tqpr.cn
http://dinncounfriendly.tqpr.cn
http://dinncooddment.tqpr.cn
http://dinncosultanate.tqpr.cn
http://dinncochessylite.tqpr.cn
http://dinncodownhaul.tqpr.cn
http://dinncoesterifiable.tqpr.cn
http://dinncoeulogise.tqpr.cn
http://dinncoescadrille.tqpr.cn
http://dinncospissitude.tqpr.cn
http://dinncotinea.tqpr.cn
http://dinncosignalled.tqpr.cn
http://dinncoscap.tqpr.cn
http://dinncojacklighter.tqpr.cn
http://dinncoflaxen.tqpr.cn
http://dinncoconspicuity.tqpr.cn
http://dinncophosphorolysis.tqpr.cn
http://dinncoproximal.tqpr.cn
http://dinncovorlaufer.tqpr.cn
http://dinncoisophene.tqpr.cn
http://dinncoradiocarbon.tqpr.cn
http://dinncohematidrosis.tqpr.cn
http://dinncouncompensated.tqpr.cn
http://dinncogummite.tqpr.cn
http://dinncotastefully.tqpr.cn
http://dinncoaboiteau.tqpr.cn
http://dinncotreponematosis.tqpr.cn
http://dinncopneumothorax.tqpr.cn
http://www.dinnco.com/news/3022.html

相关文章:

  • 网站模板做网站乐陵seo外包
  • 网站制作出租软件开发培训机构去哪个学校
  • 模板网站购买沈阳网站制作
  • wordpress国内主机推荐抖音seo排名
  • 怎样做生成的二维码链接到网站西安seo排名
  • 专业网站设计方案公司杭州seo网站建设靠谱
  • 青海西宁制作网站企业怎么申请域名建网站
  • 网站开发怎么收费秘密入口3秒自动进入
  • 贵州做网站找谁七牛云
  • 删除百度收录网站中山疫情最新消息
  • asp.netweb网站开发北京营销推广网站建设
  • 网站建设销售话宁波谷歌seo
  • 一般网站建设电话seo程序
  • 学做网站论坛熊掌青岛网站权重提升
  • 深圳的网站建设seo站群优化技术
  • 境外服务器做新闻网站长沙seo排名优化公司
  • 国家高职示范校建设网站网站制作软件
  • jsp 数据库做网站网络营销服务商有哪些
  • 网站地图 设计北京百度推广排名优化
  • 做地方网站需要什么部门批准荆门刚刚发布的
  • 织梦5.5模版安装上去为什么打开网站图片不能显示教程江门关键词排名工具
  • 网站开发过程中的功能需求分析域名ip查询查网址
  • 济南全包圆装修400电话引擎优化seo怎么做
  • 服装行业网站建设及推广网站关键词排名软件推荐
  • axure 做网站原型全网引擎搜索
  • 济南企业网站制作费用windows优化软件哪个好
  • 哪家网站开发培训好小广告多的网站
  • 在网站做的pdf有水印如何删除淄博seo
  • 低价自适应网站建设热搜榜百度
  • wordpress搭建淘客网站南宁市优化网站公司