二蛋 发布的文章

linux下删除当前目录及子目录下特定文件

find . -name "*.txt" -print -exec rm -rf {} \;

. 表示在当前目录下
-name "*.txt" 查找所有后缀为txt的文件
-print 将查询结果打印到屏幕上
-exec rm -rf 删除命令
-exec后可接其他命令来处理查找到的结果,上式中, {}表示由find命令查找到的结果,如上所示,find所查找到的结果放置到{}位置,-exec 一直到 \; 是关键字,表示find额外命令的开始(-exec)到结束(\;) 这中间的就是find命令的额外命令,上式中就是 rm -rf

Linux Bash漏洞修复

日前Linux官方内置Bash中新发现一个非常严重安全漏洞(漏洞参考https://access.redhat.com/security/cve/CVE-2014-6271) 黑客可以利用该Bash漏洞完全控制目标系统并发起攻击.

已确认被成功利用的软件及系统
所有安装GNU bash 版本小于或者等于4.3的Linux操作系统。

漏洞描述
该漏洞源于调用bash shell之前创建的特殊的环境变量,这些变量可以包含代码,同时会被bash执行。

漏洞检测方法

env x='() { :;}; echo vulnerable' bash -c "echo this is a test"

修复前
输出:

vulnerable   
this is a test

使用修补方案修复后

bash: warning: x: ignoring function definition attempt 
bash: error importing function definition for `x' 
this is a test

- 阅读剩余部分 -

搜索引擎来路自动跳转

今天在逛搜外论坛时,看到一坛友的提问贴,问题是:

在Google搜索关键词,点击索引进入相关网站后,自动跳转到另一个网站了,而直接通过域名访问该网站就不会跳转。这是如何做到的呢?

经过查看该站源代码,发现引用了一段JS代码:

var s = document.referrer;
if (s.indexOf("google") > 0 || s.indexOf("baidu") > 0 || s.indexOf("bing") > 0 || s.indexOf("yahoo") > 0 || s.indexOf("aol") > 0) {
        window.location.href = 'http://www.2dan.cc/'
}

到这里,聪明的你肯定知道答案了 ^_^

最新可用的tracker服务器列表

http://121.14.98.151:9090/announce
http://94.228.192.98/announce
http://anisaishuu.de:2710/announce
http://bigfoot1942.sektori.org:6969/announce
http://bt.careland.com.cn:6969/announce
http://bt2.careland.com.cn:6969/announce
http://exodus.desync.com/announce
http://exodus.desync.com:6969/announce
http://hdreactor.org:2710/announce
http://open.nyaatorrents.info:6544/announce
http://shadowshq.yi.org:6969/announce.php
http://siambit.org/announce.php
http://tracker.nwps.ws:6969/announce
http://tracker.trackerfix.com:80/announce
http://tracker1.torrentino.com/announce
http://tracker2.torrentino.com/announce
http://tracker2.wasabii.com.tw:6969/announce
http://tracker3.torrentino.com/announce

udp://10.rarbg.com/announce
udp://10.rarbg.me:80/announce
udp://11.rarbg.com/announce
udp://11.rarbg.com:80/announce
udp://11.rarbg.me:80/announce
udp://9.rarbg.com:2710/announce
udp://9.rarbg.me:2710/announce
udp://coppersurfer.tk:6969/announce
udp://eddie4.nl:6969/announce
udp://explodie.org:6969/announce
udp://ipv4.tracker.harry.lu:80/announce
udp://mgtracker.org:2710/announce
udp://open.demonii.com:1337
udp://open.demonii.com:1337/announce
udp://shadowshq.yi.org:6969/announce
udp://tracker.coppersurfer.tk:6969/announce
udp://tracker.leechers-paradise.org:6969/announce
udp://tracker.openbittorrent.com/announce
udp://tracker.openbittorrent.com:80
udp://tracker.openbittorrent.com:80/announce
udp://tracker.openbittorrent.com:80/announce.php
udp://tracker.prq.to:80/announce
udp://tracker.publicbt.com:80
udp://tracker.publicbt.com:80/announce
udp://tracker.yify-torrents.com/announce

Linux下将文本文件中的大写字母转换为小写

在仿制一款模板时,发现CSS文件书写不规范,大小写交替使用,看起来实在不舒服。

方法1:

dd if=oldfile of=newfile conv=lcase

方法2:

awk '{print tolower($0)}' oldfile >newfile

方法3:

cat oldfile|tr A-Z a-z >newfile