Skip to content
Life is short Play more
  • 首页
  • LifeTesting
  • Jmeter教程
    • 性能分析调优
    • Jmeter教程
    • loadrunner教程
    • 性能测试工具
    • 论坛
  • 创作
    • mockserver
    • wrapEasyMonkey
    • python测试框架
    • php语言mysql框架
  • Linux
  • 开发技术
    • Android
    • Web Programing
    • Java
    • C , C++
    • DataBase
    • Web Programing
    • Hosting
    • Security
    • Virtulization
    • Cloud
  • 软件测试
    • Automation Testing
    • Performance Testing
    • Software Testing
  • 内容分享
    • 好文,酷乐
  • 闲置书籍
  • 留言
Life is short Play more
Life is short play more

bash中的冒号, 以及bash bomb解析还有各种各样的炸弹

Posted On 2011年11月18日

bash中的冒号是内建命令

“:” is a builtin shell command, and is equivalent to to the “true” command, it is used mostly as a placeholder in scripts.

永远返回真, 相当于一个站位符号.

可以用来注释,跨行注释

: ‘this is
comment
!!’

如下是一个有冒号的,看似是一个命令. 会不断fork线程,导致机器崩溃.
但实际上, 这个和冒号命令无关.

:(){ :|:& };:

: 这里代表是定义了一个函数名字而已. 和下面的一段bash代码意义相同.

funcname() {
# Run 2 instances of the very same function
# in the background. Each of these new
# processes will do the same: each starts 2 new
# processes doing the same,... and again, and again..
funcname | funcname &
}

STUB: dont run this! It will probably halt your computer.

# Now just call the function to start forking
# bash processes indefinately.

funcname

# We will never get here.

如何让机器死机?

Perl exmaple:
perl -e "fork while fork" &
Python example:
import os
while(1):
os.fork()
Windows XP / Vista bat file example:
:bomb
start %0
goto bomb
UNIX style for Windows:
%0|%0

C program example:

#include
int main() { while(1) fork(); }

Plz note that the fork bomb is a form of denial of service, so don’t run on production or unauthorized system.

此篇文章已被阅读1806 次

相关文章

  1. javascript有sleep方法么?
  2. linux(unix)文件格式类型以及dos和unix文件格式的转换
  3. Unix domain sockets介绍
  4. linux shell经典应用
  5. how to extend root partition size

Related Posts

eclipse encoding问题
创建属于你自己的故事,音乐和游戏(编程如此简单)
12306 自动查询车票脚本

About The Author

The Tester

技术交流,生活学习

Add a Comment

取消回复

邮箱地址不会被公开。 必填项已用*标注

最热文章

  • 科学上网trojan的安装和使用
  • 关于科学上网流量分流的思考
  • linux系统的ssh客户端如何使用sz/rz上传下载文件?
  • 使用jacoco实时生成后端服务集成测试代码覆盖率报告
  • WordPress cloudflare flexible ssl 设置下解决mixed cotent相关功能问题

近期文章

  • 使用jacoco实时生成后端服务集成测试代码覆盖率报告
  • spring data jpa mongodb根据example查找不到问题
  • WordPress cloudflare flexible ssl 设置下解决mixed cotent相关功能问题
  • 关于科学上网流量分流的思考
  • 科学上网trojan的安装和使用

近期评论

  • The Tester发表在《cloudflare Rocket Loader建议中国使用者关闭》
  • zhoulujun发表在《cloudflare Rocket Loader建议中国使用者关闭》
  • The Tester发表在《vue+iviewui menu+tabs联动及tabs切换总结》
  • xiaodong.xuexd发表在《sonarqube 7.0 新功能及安装》
  • Josephnex发表在《使用github pages作图床》
  • nighteblis发表在《https访问网站浏览器取消谷歌广告联盟请求问题解决》

标签云

adsense ajax android aws crawler css eclipse findbugs git goagent htmlunit iptables jacoco java javascript jmeter joolma joomla junit jvm lcd linux moco mongodb monkeyrunner mysql oled openvpn oracle pdp php puppet python rabbitmq sonar sonarqube spring springboot ubuntu vpn vue wordpress wrapeasymonkey yii yum

分类目录

© 2021 Life is short Play more | www.hissummer.com | Powered by WordPress & Customizable Blogily