[Topic DIscussion] 如何让我的Linux服务器装死,但是不是真死
Tofloor
poster avatar
来自Ubuntu的某位用户
deepin
2022-06-03 22:18
Author

请问,有没有哪个方法,可以让其他机器ssh到我的服务器时,连接成功时自动执行脚本:

(前面的省略不写出来了)

#脚本的最后一行是

echo "Kernel Panic - Not syncing : Fatal Exception"

脚本执行完之后,将他屏幕上ssh里的Bash的命令提示符变成"grub rescue>"

然后输入所有命令提示

command not found

此时他以为这台服务器故障了,但是实际上服务器没有故障,我自己可以输入任何命令,控制这台服务器,但是从其他电脑ssh到这台服务器,在ssh中出现上述的“内核错误”界面,就立刻实现上述的“装死”?

怎么实现?

Reply Favorite View the author
All Replies
2 / 2
To page
callcz
deepin
2022-06-04 08:03
#21
来自Ubuntu的某位用户

删库跑路属于让电脑“真死”了,这里讨论的是让Linux电脑或服务器“装死”的方法,同样可以输入

echo c > /proc/sysrq-trigger

这是linux /proc/sysrq-trigger的强大机制让内核故意崩溃,属于让主机“真死”的方法

更新了一下脚本:

1.添加了退出密码功能,使用方法:xxx.sh yourpasswd,默认退出密码是2333,只需在grub rescue>下输入即可

2.针对输入增加假的报错语句:xx command not found/: is a directoryxx: no such file or directory

#/bin/bash
pass=$1
if [ $pass ]
	then
	pass=$pass
	else
	pass='2333'
fi
trap 'echo "[[^C";sleep $[RANDOM%5+1]' SIGINT
while :
do
	for i in $(seq $[RANDOM%10+1])
	do
		read -p "grub rescue>" comm
		if [[ $comm = $pass ]]
		then
			echo ":)"
			exit 0
		elif [[ $comm ]]
		then
		echo $comm |awk '{print $1}'|grep -q '/'
		test_comm=$?
			if [[ $test_comm -ne 0 ]]
				then
				echo "$(echo $comm|awk '{print $1}'): command not found"
				elif [[ $comm = / ]]
					then
				echo "/: is a directory"
				else
				echo "$(echo $comm|awk '{print $1}'): no such file or directory"
            fi
		fi
	done
echo "Kernel Panic - Not syncing : Fatal Exception"
sleep $[RANDOM%30+1]
echo "Restart grub rescue mode ..."
sleep $[RANDOM%10+1]
done
exit

Reply View the author
callcz
deepin
2022-06-04 09:25
#22

我自己玩了一下挺逗B的,拿来整蛊一下同事还行,骗网管就算了joy

Screenshot_20220604_011832.jpg

Reply View the author
来自Ubuntu的某位用户
deepin
2022-06-04 19:44
#23
callcz

我自己玩了一下挺逗B的,拿来整蛊一下同事还行,骗网管就算了joy

Screenshot_20220604_011832.jpg

打开终端执行这个脚本,把终端的配色方案改成黑底白字,然后全屏终端窗口,让光标闪,隐藏一下鼠标指针,这样上班就可以摸鱼了

Reply View the author
callcz
deepin
2022-06-12 08:00
#24
来自Ubuntu的某位用户

感谢callcz提供的脚本,你可以把脚本放到github上,很实用

https://github.com/callcz/fake-computer-crashed

Reply View the author
来自Ubuntu的某位用户
deepin
2022-06-12 16:36
#25
callcz

https://github.com/callcz/fake-computer-crashed

thanks

Reply View the author
不会开车有驾照
deepin
2022-06-12 17:03
#26

你们太坏了

Reply View the author
2 / 2
To page