<?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>暖月 &#187; 安全设置</title>
	<atom:link href="http://www.nuanyue.com/tag/%e5%ae%89%e5%85%a8%e8%ae%be%e7%bd%ae/feed" rel="self" type="application/rss+xml" />
	<link>http://www.nuanyue.com</link>
	<description>专注WEB、Linux及数据库应用安全</description>
	<lastBuildDate>Sun, 01 Aug 2010 01:52:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IE7.0 异常CSS导致内存破坏漏洞</title>
		<link>http://www.nuanyue.com/ie7-0-%e5%bc%82%e5%b8%b8css%e5%af%bc%e8%87%b4%e5%86%85%e5%ad%98%e7%a0%b4%e5%9d%8f%e6%bc%8f%e6%b4%9e.html</link>
		<comments>http://www.nuanyue.com/ie7-0-%e5%bc%82%e5%b8%b8css%e5%af%bc%e8%87%b4%e5%86%85%e5%ad%98%e7%a0%b4%e5%9d%8f%e6%bc%8f%e6%b4%9e.html#comments</comments>
		<pubDate>Wed, 25 Nov 2009 16:23:22 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Vulnerability order | 漏洞整理]]></category>
		<category><![CDATA[安全审计]]></category>
		<category><![CDATA[安全设置]]></category>

		<guid isPermaLink="false">http://www.nuanyue.com/?p=1014</guid>
		<description><![CDATA[<p>文/<a href="http://www.yxlink.com" target="_blank">铱迅</a><br />
1．漏洞介绍<br />
在XHTML 1.0标准下，使用特殊构造的CSS样式，在Internet Explorer 7.0 打开特定的网页后，Internet Explorer 7.0将发生内存崩溃，EIP指针将访问0x70613e5b附近的内存区域。如果将0x70613e5b附近覆盖特殊的机器码，[......]</p><p class='read-more'><a href='http://www.nuanyue.com/ie7-0-%e5%bc%82%e5%b8%b8css%e5%af%bc%e8%87%b4%e5%86%85%e5%ad%98%e7%a0%b4%e5%9d%8f%e6%bc%8f%e6%b4%9e.html' target='_blank'>全文阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>文/<a href="http://www.yxlink.com" target="_blank">铱迅</a><br />
1．漏洞介绍<br />
在XHTML 1.0标准下，使用特殊构造的CSS样式，在Internet Explorer 7.0 打开特定的网页后，Internet Explorer 7.0将发生内存崩溃，EIP指针将访问0x70613e5b附近的内存区域。如果将0x70613e5b附近覆盖特殊的机器码，就可以执行任意命令。<br />
2．漏洞危害(危害等级高)<br />
黑客如果将含有“漏洞利用程序的网页”置于网站上，浏览过含有“漏洞利用程序的网页”的客户端将被运行特洛伊木马。<br />
3．漏洞利用<br />
1. 通过此漏洞执行Windows的calc命令示例（利用成功后将执行计算器程序）<br />
点击查看：<a href="http://www.nuanyue.com/wp-content/uploads/2009/11/poc.txt" target="_blank">IE7.0 异常CSS导致内存破坏漏洞POC</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuanyue.com/ie7-0-%e5%bc%82%e5%b8%b8css%e5%af%bc%e8%87%b4%e5%86%85%e5%ad%98%e7%a0%b4%e5%9d%8f%e6%bc%8f%e6%b4%9e.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ph4nt0m Webzine Plan 0×03</title>
		<link>http://www.nuanyue.com/ph4nt0m-webzine-plan-0%c3%9703.html</link>
		<comments>http://www.nuanyue.com/ph4nt0m-webzine-plan-0%c3%9703.html#comments</comments>
		<pubDate>Tue, 12 May 2009 12:36:29 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Vulnerability order | 漏洞整理]]></category>
		<category><![CDATA[安全设置]]></category>

		<guid isPermaLink="false">http://www.nuanyue.com/?p=470</guid>
		<description><![CDATA[<p>[0x01] Introduction [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x01introduction2.txt">txt</a>]<br />
[0x02] 专访wordexp [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x02e4b893e8aebfwordexp.txt">txt</a>]<br />
[0x03] 高级Linux Kernel Inline Hook技术分析与实现 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x03e9ab98e7baa7linux-kernel-inline-hooke68a80e69cafe58886e69e90e4b88ee5ae9ee78eb01.txt">txt</a>]<br />
[0x04] 突破XSS字符数量限制执行任意JS代码 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x04e7aa81e7a0b4xsse5ad97e7aca6e695b0e9878fe99990e588b6e689a7e8a18ce4bbbbe6848fjse4bba3e7a081.txt">txt</a>]<br />
[0x05] 利用窗口引用漏洞和XSS漏洞[......]</p><p class='read-more'><a href='http://www.nuanyue.com/ph4nt0m-webzine-plan-0%c3%9703.html' target='_blank'>全文阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>[0x01] Introduction [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x01introduction2.txt">txt</a>]<br />
[0x02] 专访wordexp [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x02e4b893e8aebfwordexp.txt">txt</a>]<br />
[0x03] 高级Linux Kernel Inline Hook技术分析与实现 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x03e9ab98e7baa7linux-kernel-inline-hooke68a80e69cafe58886e69e90e4b88ee5ae9ee78eb01.txt">txt</a>]<br />
[0x04] 突破XSS字符数量限制执行任意JS代码 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x04e7aa81e7a0b4xsse5ad97e7aca6e695b0e9878fe99990e588b6e689a7e8a18ce4bbbbe6848fjse4bba3e7a081.txt">txt</a>]<br />
[0x05] 利用窗口引用漏洞和XSS漏洞实现浏览器劫持 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x05e588a9e794a8e7aa97e58fa3e5bc95e794a8e6bc8fe6b49ee5928cxsse6bc8fe6b49ee5ae9ee78eb0e6b58fe8a788e599a8e58aabe68c81.txt">txt</a>]<br />
[0x06] 高级PHP代码审核技术 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x06e9ab98e7baa7phpe4bba3e7a081e5aea1e6a0b8e68a80e69caf1.txt">txt</a>]<br />
[0x07] WEB应用安全设计思想 [<a href="http://www.nuanyue.com/wp-content/uploads/2009/05/pstzine-0x030x07webe5ba94e794a8e5ae89e585a8e8aebee8aea1e6809de683b32.txt">txt</a>]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuanyue.com/ph4nt0m-webzine-plan-0%c3%9703.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php安全配置之参数</title>
		<link>http://www.nuanyue.com/php%e5%ae%89%e5%85%a8%e9%85%8d%e7%bd%ae%e4%b9%8b%e5%8f%82%e6%95%b0.html</link>
		<comments>http://www.nuanyue.com/php%e5%ae%89%e5%85%a8%e9%85%8d%e7%bd%ae%e4%b9%8b%e5%8f%82%e6%95%b0.html#comments</comments>
		<pubDate>Thu, 02 Apr 2009 08:52:33 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Original article | 原创文章]]></category>
		<category><![CDATA[口令破解]]></category>
		<category><![CDATA[安全设置]]></category>

		<guid isPermaLink="false">http://www.nuanyue.com/?p=246</guid>
		<description><![CDATA[<p>Php已经成为当前网络中使用最多的脚本语言之一，特别是在Web应用上，它占据了中小型应用的绝对优势。这一切都源于它的小巧易用、它的安全有效、它的开放式许可、它的多平台，更主要的是它与三大Web语言之——PHP的完美结合。但不幸的是，一个缺省安全的Php，会因为设置不当，造成灾难性的后果。<br />
第一个重要[......]</p><p class='read-more'><a href='http://www.nuanyue.com/php%e5%ae%89%e5%85%a8%e9%85%8d%e7%bd%ae%e4%b9%8b%e5%8f%82%e6%95%b0.html' target='_blank'>全文阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>Php已经成为当前网络中使用最多的脚本语言之一，特别是在Web应用上，它占据了中小型应用的绝对优势。这一切都源于它的小巧易用、它的安全有效、它的开放式许可、它的多平台，更主要的是它与三大Web语言之——PHP的完美结合。但不幸的是，一个缺省安全的Php，会因为设置不当，造成灾难性的后果。<br />
第一个重要的参数是register_globals. 这个配置影响到php如何接收传递过来的参数，说白了register_globals的意思就是注册为全局变量，所以当该参数为值On的时候，传递过来的值会被直接的注册为全 局变量直接使用，而当该参数值为Off的时候，我们需要到从特定的数组里去得到它.操作<br />
修改php.ini文件，设置register_globals=off</p>
<p>当 register_globals 打开以后，各种变量都被注入代码，例如来自 HTML 表单的请求变量。再加上 PHP 在使用变量之前是无需进行初始化的，这就使得更容易写出不安全的代码。这是个很艰难的抉择，但 PHP 社区还是决定默认关闭此选项。当打开时，人们使用变量时确实不知道变量是哪里来的，只能想当然。但是 register_globals 的关闭改变了这种代码内部变量和客户端发送的变量混杂在一起的糟糕情况。</p>
<p>当 magic_quotes_gpc=off ，写入数据库的字符串未经过任何过滤处理。从数据库读出的字符串也未作任何处理。对于未经处理的单引号在写入数据库时会使sql语句发生错误。当magic_quotes_gpc=on 写入数据库的字符串未经过任何处理。从数据库读出的字符串未作任何处理。magic_quotes_gpc=on 将单引号转换为&#8217;的转义字符使sql语句成功执行，但&#8217;并未作为数据入数据库，数据库保存的是snow&#8221;&#8221;sun而并不是我们想象的snow&#8221;&#8221;sun。<br />
修改php.ini文件，设置register_globals=off</p>
<p>php的 display_errors参数就是帮助开发者定位和确定这些错误的。容易使提供的这些信息被恶意攻击者采集信息。<br />
操作<br />
修改php.ini文件，设置display_errors =Off</p>
<p>php的安全模式是个非常重要的内嵌的安全机制，能够控制一些php中的函数，比如system()等函数，同时把很多文件操作函数进行了权限控制，也不允许对某些关键文件的访问，比如/etc/passwd，但是默认的 php.ini是没有打开安全模式的，我们把它打开。safe_mode = on。</p>
<p>操作<br />
修改php.ini文件，设置safe_mode = on 开启PHP的安全模式</p>
<p>open_basedir选项能够控制PHP脚本只能访问指定的目录，这样能够避免PHP脚本访问不应该访问的文件，一定程度上限制了webshell的跨站攻击。<br />
操作<br />
修改php.ini文件，设置open_basedir=网站路径。</p>
<p>变量disable_functions能过滤一些危害性很大的system，exec等函数。</p>
<p>操作<br />
推荐过滤的函数如下。</p>

<div class="wp_codebox"><table><tr id="p2462"><td class="code" id="p246code2"><pre class="c" style="font-family:monospace;">disable_functions <span style="color: #339933;">=</span> phpinfo，passthru，exec，system，chroot，scandir，chgrp，chown，shell_exec，proc_open，proc_get_status，ini_alter，ini_alter，ini_restore，dl，pfsockopen，openlog，syslog，readlink，symlink，popepassthru，stream_socket_server。</pre></td></tr></table></div>

<p>但需要设置另两个参数safe_mode =on；safe_mode_gid =on</p>
<p>禁用Com组件，Windows平台下的PHP脚本平台存在一个安全漏洞，使得PHP设置即使在安全模式下(safe_mode)，仍旧允许攻击者使用COM()函数来创建系统组件来执行任意命令。漏洞出现的原因是由于在安全模式下的PHP平台虽然system();pathru()函数被禁止，但是com.allow_dcom的设置依旧是为true。以至于攻击者可以使用COM()函数创建系统组件对象来运行系统命令。<br />
操作<br />
1、卸载wscript.shell对象<br />
在cmd下运行：regsvr32 WSHom.Ocx /u<br />
2、卸载FSO对象<br />
在cmd下运行：regsvr32.exe scrrun.dll /u<br />
3、卸载stream对象<br />
在cmd下运行：<br />
regsvr32 /s /u &#8220;C:Program FilesCommon FilesSystemadomsado15.dll&#8221;<br />
恢复的话，去掉/u就行了<br />
如Wscript.Shell就用在regsvr32 WSHom.Ocx就行了</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuanyue.com/php%e5%ae%89%e5%85%a8%e9%85%8d%e7%bd%ae%e4%b9%8b%e5%8f%82%e6%95%b0.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>apache安全设置</title>
		<link>http://www.nuanyue.com/apache%e5%ae%89%e5%85%a8%e8%ae%be%e7%bd%ae.html</link>
		<comments>http://www.nuanyue.com/apache%e5%ae%89%e5%85%a8%e8%ae%be%e7%bd%ae.html#comments</comments>
		<pubDate>Thu, 02 Apr 2009 08:44:29 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Original article | 原创文章]]></category>
		<category><![CDATA[安全设置]]></category>

		<guid isPermaLink="false">http://www.nuanyue.com/?p=241</guid>
		<description><![CDATA[<p>默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。</p>
<p>　　修改配置httpd.conf文件，添加如下语句：<br />
    ServerSignature O[......]</p><p class='read-more'><a href='http://www.nuanyue.com/apache%e5%ae%89%e5%85%a8%e8%ae%be%e7%bd%ae.html' target='_blank'>全文阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p>默认情况下，很多Apache安装时会显示版本号及操作系统版本，甚至会显示服务器上安装的是什么样的Apache模块。这些信息可以为黑客所用，并且黑客还可以从中得知你所配置的服务器上的很多设置都是默认状态。</p>
<p>　　修改配置httpd.conf文件，添加如下语句：<br />
    ServerSignature Off<br />
    ServerTokens Prod</p>
<p>Apache启动权限过大，容易给恶意入侵者提供便利。</p>
<p>创建一个新的帐户来替代这个帐号启动apache并设置相应的权限。<br />
1.在计算机管理里的本地用户和组里面创建一个帐户，例如：apache，设置密码，加入guests组（如果出现问题，可以赋予user权限）；<br />
2.打开开始->管理工具->本地安全策略，在用户权限分配中选择“作为服务登陆”，添加apache用户；<br />
3.计算机管理里面选择服务，找到apache2.2，先停止服务，右击->属性，选择登陆，把单选框从本地系统帐户切换到此帐户，然后查找 选择apache，输入密码apacheuser，然后点确定（这个时候apache还不能正常启动，一般情况肯定会报错：Apache2.2 服务因 1 (0&#215;1) 服务性错误而停止。）；<br />
4.赋予apache安装目录（比如：D:/apache2.2）以及web目录（比如D:/wwwroot）apache帐号的可读写权限，去除 各磁盘根目录除administror与system以外的所有权限，赋予apache安装目录所在的磁盘根目录apache帐户的可读取列目录权限（我 开始觉得没必要，但后来发现：这是导致上面出错的关键。）</p>
<p>当以 Apache 的模块方式运行 PHP 时，也可以通过 Apache 的配置文件（例如 httpd.conf）和 .htaccess 文件中的指令来修改 PHP 的配置选项（需要“AllowOverride Options”或“AllowOverride All”权限）。</p>
<p>在httpd.conf文件里有关在该目录的设定里加上 (PHP4以上版本)<br />
&#8220;php_admin_flag engine off&#8221;</p>
<p>例:</p>
<p><directory /srv/www/htdocs/path><br />
    php_admin_flag engine off<br />
</directory></p>
<p>禁止目录不必要的目录浏览权限。<br />
查找可目录浏览的目录所对应的Directory标签<br />
确认该标记下的Option Indexes<br />
将Option标记修改为：Option –Indexes（若Option标记后除Indexes外无其他命令，可改为：Option None）<br />
保存重启httpd服务</p>
<p>对于无CGI的目录可在其对应的Directory标签中进行如下操作：<br />
在需要禁用CGI目录对应的Directory标签下找到Option ExecCGI，为取消其CGI执行权限，改为：Option –ExecCGI<br />
保存重启httpd服务。</p>
<p>使用本地口令保护目录<br />
安全操作<br />
方法一：<br />
对于一些管理员登录入口，可加入口令管理，为其登录多一重保护，增加方法如下：<br />
创建用户及口令：<br />
        htpasswd –c /var/httpd/passwd admin<br />
输入上面的命令后，根据提示为admin输入口令<br />
随后设置该文件的权限以确保apache所使用的用户能访问该文件：chmod 644 /var/httpd/passwd<br />
找到需要使用口令保护的目录，在其对应的Directory标签下，修改如下行：<br />
        AllowOverride行改为：AllowOverride AuthConfig<br />
       创建如下行：<br />
       AuthType Basic<br />
       AuthName &#8220;Administration&#8221;<br />
       AuthUserFile /var/httpd/passwd<br />
       Require user admin<br />
保存httpd.conf并重启httpd服务<br />
若需要修改admin口令，可在服务器上执行命令：htpasswd /var/httpd/passwd admin，按提示输入两次口令即可更新admin口令</p>
<p>方法二：<br />
对于一些管理员登录入口，可加入口令管理，为其登录多一重保护，增加方法如下：<br />
创建用户及口令：<br />
        htpasswd –c /var/httpd/passwd admin<br />
输入上面的命令后，根据提示为admin输入口令<br />
随后设置该文件的权限以确保apache所使用的用户能访问该文件：chmod 644 /var/httpd/passwd<br />
找到需要使用口令保护的目录，在其对应的Directory标签下，修改如下行：<br />
       AllowOverride行改为：AllowOverride AuthConfig<br />
       创建如下行：<br />
       AuthType Basic<br />
       AuthName &#8220;Administration&#8221;<br />
       AuthUserFile /var/httpd/passwd<br />
       Require user admin<br />
保存httpd.conf并重启httpd服务<br />
若需要修改admin口令，可在服务器上执行命令：htpasswd /var/httpd/passwd admin，按提示输入两次口令即可更新admin口令</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nuanyue.com/apache%e5%ae%89%e5%85%a8%e8%ae%be%e7%bd%ae.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
