消息详情
暗夜之界 | Hacker技术 SQL · @AZQVQ · 2026年11月9日 15:54
代码分析 漏洞文件:/dede/makehtml_homepage.php 代码 else if($dopost=="make") { $remotepos = empty($remotepos)? '/index.html' : $remotepos; $isremote = empty($isremote)? 0 : $isremote; $serviterm = empty($serviterm)? "" : $serviterm; $homeFile = _DEDEADMIN_."/".$position; $homeFile = str_replace("\\","/",$homeFile); $homeFile = str_replace("//","/",$homeFile); $fp = fopen($homeFile,"w") or die("你指定的文件名有问题,无法创建文件"); fclose($fp); if($saveset==1) { $iquery = "UPDATE `#@__homepageset` SET templet='$templet',position='$position' "; $dsql->ExecuteNoneQuery($iquery); } _//_ _判断首页生成模式_ if ($showmod == 1) { _//_ _需要生成静态_ $templet = str_replace("{style}", $cfg_df_style, $templet); $pv = new PartView(); $GLOBALS['_arclistEnv'] = 'index'; $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); $pv->SaveToHtml($homeFile); echo "成功更新主页HTML:".$homeFile."<br /><a href='{$position}' target='_blank'>浏览...</a><br />"; } else { _//_ _动态浏览_ if (file_exists(_DEDEADMIN_."/../index.html")) @unlink(_DEDEADMIN_."/../index.html"); echo "采用动态浏览模式:<a href='../index.php' target='_blank'>浏览...</a><br />"; } 其中 代码 $pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$templet); 跟进去 代码 function SetTemplet($temp,$stype="file") { if($stype=="string") { $this->dtp->LoadSource($temp); } else { $this->dtp->LoadTemplet($temp); //进入到这里 } if($this->TypeID > 0) { $this->Fields['position'] = $this->TypeLink->GetPositionLink(TRUE); $this->Fields['title'] = $this->TypeLink->GetPositionLink(false); } $this->ParseTemplet(); } 代码 function LoadTemplet($filename) { $this->LoadTemplate($filename);//继续跟进 } 代码 function LoadTemplate($filename) { $this->SetDefault(); if(!file_exists($filename)) { $this->SourceString = " $filename Not Found! "; $this->ParseTemplet(); } else { while($line = fgets($fp,1024)) //将文件内容赋值给$line { $this->SourceString .= $line; //最后赋予$this->SourceString } fclose($fp); if($this->LoadCache($filename)) { return ''; } else { $this->ParseTemplet(); } } } 将文件内容赋值给$this->SourceString 代码 $pv->SaveToHtml($homeFile); 这行代码跟进 代码 function SaveToHtml($filename,$isremote=0) { global $cfg_remote_site; _//__如果启用远程发布则需要进行判断_ if($cfg_remote_site=='Y' && $isremote == 1) { _//__分析远程文件路径_ $remotefile = str_replace(_DEDEROOT_, '', $filename); $localfile = '..'.$remotefile; _//__创建远程文件夹_ $remotedir = preg_replace('/[^\/]*\.js/', '', $remotefile); $this->ftp->rmkdir($remotedir); $this->ftp->upload($localfile, $remotefile, 'ascii'); } $this->dtp->SaveTo($filename); //跟进到这里 } 代码
相關消訊
- $templet = preg_replace("/[.]+[\/\\\\]+/", "/", $templet); if(empty($dopos…
- 影响版本: DeDeCMS <=5.7.115 代码分析 漏洞文件: dede/task_do.php 代码 if($dopost=='makeinde…
- function SaveTo($filename) { $fp = @fopen($filename,"w") or die("DedeT…
- #!/usr/bin/env python3 import struct # PostgreSQL 页面大小 8KB PG_PAGE_SIZE = 8192…
- def main(): # 解析命令行参数 parser = argparse.ArgumentParser(description='P…
- #!/usr/bin/env python3 import argparse import struct import csv import base64 f…
- 4 仅用SELECT语句实现远程代码执行 4.0 读取原始postgresql.conf配置文件 完成 RCE 第一步是下载原始配置文件。目前已是超管可直接通…
- 区块结构 区块是一种记录交易的数据结构,每个区块由区块头和区块主体组成,区块主体负责记录前一段时间内的所有交易信息,区块链的大部分功能都由区块头实现,区块头数…
- Telegram必备的搜索引擎,极搜JISOU帮你精准找到,想要的群组、频道、视频、音乐 👉 t.me/jisou2?start=a_8315722010
- Telegram必备的搜索引擎,极搜JISOU帮你精准找到,想要的群组、频道、视频、音乐 👉 t.me/jisou2?start=a_8315722010