存档

‘saving’ 分类的存档

收藏:系统安全:Linux 系统下的病毒发展及其分类

2004年12月18日 hufey 1 条评论

原文出处
系统安全:Linux 系统下的病毒发展及其分类
1996年的Staog是Linux系统下的第一个病毒,它出自澳大利亚一个叫VLAD的组织(Windows 95下的第一个病毒程序Boza也系该组织所为)。Staog病毒是用汇编语言编写,专门感染二进制文件,并通过三种方式去尝试得到root权限。 Staog病毒并不会对系统有什么实质性的损坏。它应该算是一个演示版。它向世人揭示了Linux可能被病毒感染的潜在危险。Linux系统上第二个被发现的病毒是Bliss病毒,它是一个不小心被释放出来的实验性病毒。与其它病毒不同的是,Bliss本身带有免疫程序,只要在运行该程序时加上 “disinfect-files-please”选项,即可恢复系统。  
  如果说刚开始时Linux病毒向人们展示的仅仅是一个概念,那么,在2001年发现的Ramen病毒,则已经开始引起很多人的担心。Ramen病毒可以自动传播,无需人工干预,所以和1988年曾使人们大受其苦的 Morris蠕虫非常相似。它只感染Red Hat 6.2和7.0版使用匿名FTP服务的服务器,它通过两个普通的漏洞RPC.statd和wu-FTP感染系统。  
  表面看来,这不是一个危险的病毒。它很容易被发现,且不会对服务器做出任何有破坏性的事情。但是当它开始扫描时,将消耗大量的网络带宽。  
  从1996年至今,新的Linux病毒屈指可数,这说明Linux是一个健壮的具有先天病毒免疫能力的操作系统。当然,出现这种情况,除了其自身设计优秀外,还有其它的原因。  
  首先,Linux早期的使用者一般都是专业人士,就算是今天,虽然其使用者激增,但典型的使用者仍为那些有着很好的电脑背景且愿意帮助他人的人, Linux 高手更倾向于鼓励新手支持这样一种文化精神。正因为如此,Linux使用群中一种倾向就是以安全的经验尽量避免感染病毒。其次,年轻,也是Linux很少受到病毒攻击的原因之一。事实上,所有的操作系统(包括DOS和Windows)在其产生之初,也很少受到各种病毒的侵扰  
  然而, 2001年3月,美国SANS学院的全球事故分析中心(Global Incident Analysis Center——GIAC)发现,一种新的针对使用Linux系统的计算机的蠕虫病毒正通过互联网迅速蔓延,它将有可能对用户的电脑系统造成严重破坏。这种蠕虫病毒被命名为“狮子”病毒,与Ramen蠕虫病毒非常相似。但是,这种病毒的危险性更大,“狮子”病毒能通过电子邮件把一些密码和配置文件发送到一个位于china.com的域名上。Dartmouth学院安全技术研究所工程师威廉·斯蒂恩斯说:“攻击者在把这些文件发回去之后就可以通过第一次突破时的缺口再次进入整个系统。这就是它与Ramen蠕虫病毒的不同之处。事实上,Ramen病毒是一种比较友善的病毒,它在侵入系统后会自动关闭其中的漏洞,而这个病毒却让那些漏洞敞开并开辟新的漏洞。以至于如果你的系统感染了这个病毒,我们不能百分之百确信这个系统有挽救的价值,更加合理的选择很有可能是转移你的数据并且重新格式化硬盘。”  
  一旦计算机被彻底感染,“狮子”病毒就会强迫电脑开始在互联网上搜寻别的受害者。不过,感染“狮子”病毒的系统少于感染Ramen病毒的系统,但是它所造成的损失却比后者大得多。  
  随着Klez病毒在Linux平台上的传染,防毒软件厂商开始提醒我们微软的操作系统不再是唯一易受病毒攻击的操作系统了。即使Linux和其他一些主流 UNIX平台的用户可能不是微软捆绑应用软件的大用户,不可能通过这些软件造成病毒的泛滥,Linux和UNIX仍然有它们自身并不引人注目的脆弱点。除了Klez以外,其他Linux/UNIX平台的主要威胁有:Lion.worm、OSF.8759病毒、Slapper、Scalper、 Linux.Svat和BoxPoison病毒,这些都很少被提及。  
  病毒的制造者是一些精通编写代码的黑客,他们远比那些胡乱涂改网站却对编写病毒知之甚少的黑客要危险。一个被黑掉的网站可以很快修好,而病毒却更加隐蔽,会带来潜在的安全隐患,它会一直潜伏,直到给系统带来不可挽回的损害。  
  另外,越多的Linux系统连接到局域网和广域网,就会有越多受攻击的可能,这是因为很多Linux病毒正在快速地扩散着。使用WINE的 Linux/UNIX系统特别容易受到病毒的攻击。WINE是一个公开源代码的兼容软件包,能让Linux平台运行Windows应用软件。 WINE系统特别容易遭受病毒的攻击,因为它们会使无论是对Linux的还是对 Windows的病毒、蠕虫和木马都能对系统产生威胁。  
  Linux平台下的病毒分类  
  可执行文件型病毒:可执行文件型病毒是指能够寄生在文件中的,以文件为主要感染对象的病毒。病毒制造者们无论使用什么武器,汇编或者C,要感染ELF 文件都是轻而易举的事情。这方面的病毒如Lindose,当其发现一个ELF文件时,它将检查被感染的机器类型是否为Intel 80386,如果是,则查找该文件中是否有一部分的大小大于 2,784字节(或十六进制AEO),如果满足这些条件,病毒将用自身代码覆盖它并添加宿主文件的相应部分的代码,同时将宿主文件的入口点指向病毒代码部分。一个名为Alexander Bartolich的学生发表了一篇名为《如何编写一个Linux的病毒》的文章,详细描述了如何制作一个感染在Linux/i386的ELF可执行文件的寄生文件病毒。有了这样具启发性的、在网上发布的文档,基于Linux的病毒数量只会增长的更快,特别是自Linux的应用越来越广泛之后。  
  蠕虫(worm)病毒:1988年Morris蠕虫爆发后,Eugene H. Spafford 为了区分蠕虫和病毒,给出了蠕虫的技术角度的定义,“计算机蠕虫可以独立运行,并能把自身的一个包含所有功能的版本传播到另外的计算机上。” (worm is a program that can run by itself and can propagate a fully working version of itself to other machines. )。在Linux平台下,蠕虫病毒极为猖獗,像利用系统漏洞进行传播的ramen,lion,Slapper……这些臭名远播的家伙每一个都感染了大量的 Linux系统,造成了巨大的损失。它们就是开放原代码世界的nimda,红色代码。在未来,这种蠕虫病毒仍然会愈演愈烈,Linux系统应用越广泛,蠕虫的传播程度和破坏能力也会随之增加。  
  脚本病毒:目前出现比较多的是使用shell脚本语言编写的病毒。此类病毒编写较为简单,但是破坏力同样惊人。我们知道,Linux系统中有许多的以.sh结尾的脚本文件,而一个短短十数行的shell脚本就可以在短时间内遍历整个硬盘中的所有脚本文件,进行感染。因此病毒制造者不需要具有很高深的知识,就可以轻易编写出这样的病毒,对系统进行破坏,其破坏性可以是删除文件,破坏系统正常运行,甚至下载一个木马到系统中等等。  
  后门程序:在广义的病毒定义概念中,后门也已经纳入了病毒的范畴。活跃在Windows系统中的后门这一入侵者的利器在Linux平台下同样极为活跃。从增加系统超级用户账号的简单后门,到利用系统服务加载,共享库文件注射,rootkit工具包,甚至可装载内核模块(LKM),Linux平台下的后门技术发展非常成熟,隐蔽性强,难以清除。是Linux系统管理员极为头疼的问题。  
  病毒、蠕虫和木马基本上意味着自动化的黑客行为,也许被病毒攻击比被黑客攻击更可能发生。直接的黑客攻击目标一般是服务器,而病毒是等机会的麻烦制造者。如果你的网络包含了Linux系统,特别危险的是服务器,不要在作出反应之前等待寻找Linux病毒、蠕虫和木马是否存在。做一些调查然后选择一个适合你系统的防毒产品,它们能帮你防止病毒的传播。至于Linux平台病毒在未来的发展,一切皆有可能。Windows下的病毒发展史,也有可能在 Linux上重演,这取决于Linux的发展。
发布人:snow 来自:eNet硅谷动力

分类: saving 标签:

FireFox的几个小技巧(提高浏览速度)

2004年12月6日 hufey 评论已被关闭

CSDN – 文档中心 – 其他 阅读:72 评论: 0 参与评论
标题 FireFox的几个小技巧(提高浏览速度) 选择自 ycool1984 的 Blog
关键字 FireFox的几个小技巧(提高浏览速度)
出处
1. Enalbe IPv6。大部分网站使用IPv4协议,在FF里IPv6默认是disabled的,所以打开IPv6,对支持IPv6的网站会提高浏览速度。 具体步骤: a. 在FF地址栏里输入:about:config; b. 然后找到Network.dns.disableIPv6,双击后,其键值由”false”变为”true”; c. 重启FF后生效。 2. 另外如下设置也会提高浏览速度:具体步骤同上。 network.http.max-connections: 48 network.http.max-connections-per-server: 24 network.http.max-persistent-connections-per-proxy: 12 network.http.max-persistent-connections-per-server: 6 network.http.pipelining: true network.http.pipelining.maxrequests: 32 network.http.proxy.pipelining: true 3。地址栏自动填入完成。 FF虽然也能记忆以前输入的地址,但只是在下拉菜单里,并不直接把最相近的地址显示在地址栏里。如下设置会完成此功能: a. 在FF地址栏里输入:about:config; b. 右击任何空白处,选new->boolean,然后输入browser.urlbar.autoFill,设置成”true”; c. 同上步骤建立browser.urlbar.autocomplete.enabled d. 重启FF后生效。
作者Blog:http://blog.csdn.net/ycool1984/

分类: saving 标签:

Python 2.4

2004年12月2日 hufey 评论已被关闭

What’s new in Python 2.4
Here are the (subjective) highlights of what’s new in Python 2.4.
Faster
A number of modules that were added in Python 2.3 (such as sets and heapq) have been recoded in C. In addition, there’s been a number of other speedups to the interpreter. (See section 8.1, Optimizations, of the “What’s New” document for more).
New language features
* multi-line imports – when using imports in the form from foo import bar, baz, bing, bang, you can surround the imported names with brackets, and they can be split across lines. This is part of PEP 328.
* Farewell to OverflowWarning – as documented in PEP 237, Python no longer generates OverflowWarnings.
* function/method decorators – function and method decorators, first described in PEP 318, have been added to the language, using ‘pie-decorator’ syntax. Decorators are on the line before the ‘def’, and prefixed with an ‘@’ sign. (PEP 318)
* Assigning to None – the compiler now treats assigning to None as a SyntaxError.
* Failed import cleanup – when a module import failed, versions of Python prior to 2.4a2 would leave a broken module in sys.modules – subsequent attempts to import the failing module would silently succeed, but use the broken module object. The import machinery now removes the failing module from sys.modules if the import fails.
* The -m command line option – python -m modulename will find a module in the standard library, and invoke it. For example, python -m pdb is equivalent to python /usr/lib/python2.4/pdb.py
New or upgraded built-ins
* built-in sets – the sets module, introduced in 2.3, has now been implemented in C, and the set and frozenset types are available as built-in types (PEP 218)
* unification of integers and long integers – an operation that would return a number too big for an integer will automatically return a long integer. (PEP 237)
* generator expressions – generator expressions are similar to a list comprehension, but instead of creating the entire list of results they create a generator that returns the results one by one. This allows for efficient handling of very large lists. (PEP 289)
* reversed() – a new builtin that takes a sequence and returns an iterator that loops over the elements of the sequence in reverse order (PEP 322)
* new sort() keyword arguments – sort() now accepts keyword arguments cmp, key and reverse
* sorted() – a new builtin sorted() acts like an in-place list.sort() but can be used in expressions, as it returns a copy of the sequence, sorted.
* string methods – strings gained an rsplit() method, and the string methods ljust(), rjust() and center() accept an argument to specify the fill character.
* eval() now accepts any form of object that acts as a mapping as its argument for locals, rather than only accepting a dictionary. There’s all sorts of new and shiny evil possible thanks to this little change.
New or upgraded modules and packages
* a new subprocess module for spawning processes in a platform-independent way (see PEP 324)
* decimal – a new numeric type that allows for the accurate representation of floating point numbers (avoiding the problems of binary floating point) (PEP 327)
* os.urandom() has been added for systems that support a source of random data (entropy)
* The mpz, rotor and xreadlines modules have been removed.
* The difflib module now includes an HtmlDiff class that creates an HTML table showing a side by side comparison of two versions of a text.
* The socket module gained the socketpair() function, on systems that support it.
* os.path.lexists(), which tests whether the path is a symlink.
* The doctest module has been massively refactored, with many new features added, and many new hooks for customizing behavior.
* Non-blocking SSL sockets work again.
* time.strptime() can now infer the date using %U or %W (week of the year) when the day of the week and year are also specified.
* The optparse module was updated to Optik 1.5a1.
* The new module cookielib supports client-side HTTP cookies. urllib2 gained a new class HTTPCookieProcessor that uses this new module.
* The CJKCodecs collection of East Asian codecs, maintained by Hye-Shik Chang, was integrated into 2.4.
* The email package’s Parser was completely rewritten to better handle malformed email messages. It should now never fail to parse a message and will annotate the parsed message to indicate what problems were found during the parsing. There is also a new FeedParser that allows messages to be fed into the parser as they are read in.
* The bisect module now has an underlying C implementation for improved performance.
* There is a new collections module for various specialized collection datatypes. Currently it contains just one type, deque, a double-ended queue that supports efficiently adding and removing elements from either end.
* The asyncore module’s loop() now has a count parameter that lets you perform a limited number of passes through the polling loop. The default is still to loop forever.
* The curses module now supports the ncurses extension use_default_colors(). On platforms where the terminal supports transparency, this makes it possible to use a transparent background.
* imaplib now supports the IMAP THREAD command
* heapq has two new functions nlargest() and nsmallest() to find the N largest or smallest values in a dataset.
* itertools has a new function groupby() that acts a little like an SQL “GROUP BY” statement. It also gained a function tee() that returns N independent iterators that replicate the iterator passed as an argument.
* A new function basicConfig() was added to the logging package to simplify setup for logging. There is also a new TimedRotatingLogFileHandler which automatically rotates log files at a fixed interval.
* The operator module gained functions attrgetter() and itemgetter()
* The posix module (available as os) has a new function getsid()
* poplib supports POP over SSL
* profile can now profile C extension functions
* random has a new method getrandbits(N) to return a random integer N bits long.
* The re module was extended to allow simple conditional expressions in regular expressions. In addition, the underlying SRE engine is now non-recursive (previously, certain types of regular expression would run into troubles with recursion).
* The weakref module now supports a wider variety of Python objects includes Python functions, class instances, sets, frozensets, deques, arrays, files, sockets and regular expression objects. In addition, the weakref type is now a new-style object which can be subclassed.
* xmlrpclib now supports a multi-call extension for transmitting multiple XML-RPC calls in a single HTTP operation.
* The base64 module now supports Base64, Base32 and Base16 encoding and decoding, and more complete support for RFC 3548.

分类: saving 标签:

shell编程中expr的问题

2004年11月16日 hufey 评论已被关闭


LOOP=0
LOOP=`expr $LOOP+1`
这个时候LOOP结果是多少?
LOOP=0
LOOP=`expr $LOOP + 1`
这个时候LOOP结果是多少?

阅读全文…

分类: saving 标签:

esmtp fetchmail mutt configuration files

2004年11月12日 hufey 评论已被关闭

俺们这有个VPN,这个可以理解,因为不能让任何人在任何地方
都能访问到公司内部的资源。
可是有个麻烦就是回家之后连公司的mail都收不到了
现在都globalization/internationalization了
经常要跟世界各地的人联系,
如果赶上周末,再加上时差的问题,会在礼拜一收到
很多的mail,加上公司的mail不一定都是公事等等其他原因,
迫切需要一个在家能收mail的方案。
俺鼓捣了个把小时,终于成功了。那就是用fetchmail收下来
再转到一个普通的帐户上去。当然了,熟的话几下子就设好了,
俺不是不熟么。。。。。。
这样单位机器不关就可以收下mail给家里发回去了

阅读全文…

分类: saving 标签:

vsftp writable anonymous root问题的解决

2004年11月11日 hufey 1 条评论

500 OOPS: vsftpd: refusing to run with writable anonymous root
很多人问这个问题
google中文没人回答
google英文说的都含糊
其实只要把anon_root目录本身的 w权限去掉就可以了
比如 在配置文件中设定了 anon_root=/var/ftp
那么 /var/ftp就是这样:
dr-xr-xr-x 4 root root 4096 Nov 11 09:52 /var/ftp/
/var/ftp里就是这样:
drwxrwxrwx 3 ftp ftp 4096 Nov 11 11:15 incoming
dr-xr-xr-x 2 ftp ftp 4096 Jul 6 14:24 pub

阅读全文…

分类: saving 标签:

mykill.sh

2004年11月8日 hufey 评论已被关闭

记得以前买过一本杂志
有一段代码是杀掉所有指定名字的进程
很感兴趣,因为像evolution这样的程序经常不会自己退出去
再起来之前必须手工杀掉,而且他有好几个进程,所以
必须一个一个手工杀掉
不过那本杂志忘了丢哪去了,只好自己琢磨着写了一个

阅读全文…

分类: saving 标签:

写了一个Hello World的gaim plugin版

2004年11月4日 hufey 2 条评论

折腾了好几天。

开始想写一个给gaim用的机器人,发现gaim.sf.net
上有个perl写的plugin例子。照着抄了一个发现基本不知他在不在跑。其实根本没跑。
因为:gaim安装时会给perl加Gaim module,否则use Gaim如何能生效呢?
可我的perl早就升到了5.8.5,目录位置早就不对了。找到一些用C写的例子,
不过代码太多了,嗯,我越来越发现自己岁数大了,什么也不原意深究了。
结果鼓捣perl鼓捣了两天。
Gaim的官方网站上根本没有用C写plugin的例子。
后来下载了一个SmartEar的plugin,才几十K,终于有兴趣往下看了……
一编译发现需要头文件,于是下载gaim-devel的rpm装。
还不对,
只好下载gaim的源代码,装了之后竟然启动就会segment fault,而root下就没问题。
想了想把自己用户目录下的 .gaim改个名。果然就启动好了。
其实,gaim.sf.net给的perl例子已经不能运行在最新的1.0.2下了。抓狂
偶尔在看版本信息的时候发现了gaim的irc在 freenode。
于是irc,/join #gaim。又问里面的人,终于有一个大概是gaim的开发者告诉了我
How to write a plugin for gaim by C language
还好,照葫芦画瓢搞出了第一个plugin。
接下来就是完善它,再搞搞NLP。。。。。。

分类: saving 标签:

movabletype 对spam message的patch

2004年9月21日 hufey 2 条评论

Movable Type Spam Vulnerability
11.26.2003
The “Email this to a friend” functionality in the mt-send-entry.cgi script is vulnerable to being used by spammers to send spam messages. In principle, all “email this to a friend” programs are vulnerable to being used by spammers, because they allow the user to specify a To: address and a message body. But in practice, MT’s implementation of this is not as robust as it should be, and a new version is available below.
This fix is already included in all versions of MT 2.64 downloaded from today on.
If you’re not using this functionality at all, we recommend that you simply remove mt-send-entry.cgi from your MT directory. MT doesn’t have any hooks to use this script by default anyway, so you won’t be breaking your MT installation.
If you are using this functionality on your MT weblog, you should download this package with a new version of mt-send-entry.cgi, unzip it, and replace the version of mt-send-entry.cgi on your server. The new version:
* fixes a vulnerability that allows spammers to inject extra headers into messages;
* removes the ability to send the message to multiple recipients;
* restricts the message to 250 characters.
All of these fixes serve to discourage the script being used by spammers.

分类: saving 标签:

升级了binutils到2.15

2004年8月31日 hufey 评论已被关闭

为了正常编译glibc+nptl必须升级gas到2.15
于是升级binutils
tar xvzf glibc+nptl.tar.gz
mkdir glibc-build
cd glibc-build
../glibc+nptl/configure –prefix=/usr/lib/nptl –enable-add-ons=nptl –with-tls
编译glibc+nptl中

分类: saving 标签: