对于那些喜欢幽默的人,sudo
可以将以Sorry, try again.
下行添加到/etc/sudoers
(使用命令sudo visudo
,而不是手动编辑!),将其配置为随机打印或多或少具有侮辱性或有趣的短语而不是中性短语:
Defaults insults
Run Code Online (Sandbox Code Playgroud)
这里有些例子:
[sudo] password for bytecommander:
The more you drive -- the dumber you get.
[sudo] password for bytecommander:
I've seen penguins that can type better than that.
[sudo] password for bytecommander:
This mission is too important for me to allow you to jeopardize it.
[sudo] password for bytecommander:
He has fallen in the water!
[sudo] password for bytecommander:
Hold it up to the light --- not a brain in sight!
Run Code Online (Sandbox Code Playgroud)
现在只是为了好玩,我想通读所有这些,但整天输入错误的密码并不是最好的方法(每次尝试后延迟,每 3 次尝试只有 2 条消息,3 次尝试后中止,......)。
那么......这些侮辱实际上存储在哪里?我可以直接读取任何纯文本文件吗?还是源代码中的硬编码字符串?
如何获取所有可用sudo
侮辱信息的列表?
Zan*_*nna 206
它们在二进制文件中
/usr/lib/sudo/sudoers.so
Run Code Online (Sandbox Code Playgroud)
(发现:find /usr/lib/sudo -type f | xargs grep "fallen in the water"
)
如果您启用源下载并执行
apt source sudo
Run Code Online (Sandbox Code Playgroud)
你可以在源码目录下找到 insults 文件
plugins/sudoers
Run Code Online (Sandbox Code Playgroud)
这些文件是
ins_2001.h
ins_classic.h
ins_csops.h
ins_goons.h
insults.h
Run Code Online (Sandbox Code Playgroud)
这些文件的示例:
/usr/lib/sudo/sudoers.so
Run Code Online (Sandbox Code Playgroud)
等等……它们的可读性很强。
Win*_*nix 88
您可以更改 sudo 侮辱,而无需重新编译 sudo。
请参阅:添加新的 sudo 侮辱
当我们看到所有的侮辱时,我们发现了一个有趣的花絮:说西兰花在政治上是正确的,但说墨西哥卷饼不是。所有的侮辱都列在下面。
ins_2001.h
(2001 Space Odyssey 侮辱):.
/*
* HAL insults (paraphrased) from 2001.
*/
"Just what do you think you're doing Dave?",
"It can only be attributed to human error.",
"That's something I cannot allow to happen.",
"My mind is going. I can feel it.",
"Sorry about this, I know it's a bit silly.",
"Take a stress pill and think things over.",
"This mission is too important for me to allow you to jeopardize it.",
"I feel much better now.",
Run Code Online (Sandbox Code Playgroud)
ins_classic.h
(原文须藤8侮辱): /*
* Insults from the original sudo(8).
*/
"Wrong! You cheating scum!",
#ifdef PC_INSULTS
"And you call yourself a Rocket Scientist!",
#else
"No soap, honkie-lips.",
#endif
"Where did you learn to type?",
"Are you on drugs?",
"My pet ferret can type better than you!",
"You type like i drive.",
"Do you think like you type?",
"Your mind just hasn't been the same since the electro-shock, has it?",
Run Code Online (Sandbox Code Playgroud)
ins_csops.h
(CSOps 侮辱): /*
* CSOps insults (may be site dependent).
*/
"Maybe if you used more than just two fingers...",
"BOB says: You seem to have forgotten your passwd, enter another!",
"stty: unknown mode: doofus",
"I can't hear you -- I'm using the scrambler.",
"The more you drive -- the dumber you get.",
#ifdef PC_INSULTS
"Listen, broccoli brains, I don't have time to listen to this trash.",
#else
"Listen, burrito brains, I don't have time to listen to this trash.",
#endif
"I've seen penguins that can type better than that.",
"Have you considered trying to match wits with a rutabaga?",
"You speak an infinite deal of nothing",
Run Code Online (Sandbox Code Playgroud)
ins_goons.h
(Goon Show 侮辱):.
/*
* Insults from the "Goon Show."
*/
"You silly, twisted boy you.",
"He has fallen in the water!",
"We'll all be murdered in our beds!",
"You can't come in. Our tiger has got flu",
"I don't wish to know that.",
"What, what, what, what, what, what, what, what, what, what?",
"You can't get the wood, you know.",
"You'll starve!",
"... and it used to be so popular...",
"Pauses for audience applause, not a sausage",
"Hold it up to the light --- not a brain in sight!",
"Have a gorilla...",
"There must be cure for it!",
"There's a lot of it about, you know.",
"You do that again and see what happens...",
"Ying Tong Iddle I Po",
"Harm can come to a young lad like that!",
"And with that remarks folks, the case of the Crown vs yourself was proven.",
"Speak English you fool --- there are no subtitles in this scene.",
"You gotta go owwwww!",
"I have been called worse.",
"It's only your word against mine.",
"I think ... err ... I think ... I think I'll go home",
Run Code Online (Sandbox Code Playgroud)
该文件insults.h
包含编译器指令,说明要在编译的 sudo 程序中包含上述哪些侮辱。实际上,您可以创建自己的 insults 文件,将名称添加到 insults.h 并重新编译以显示诸如“什么,您是 ArchLinux 用户吗?”之类的消息。或“这不是错误司空见惯的 Windows!”等。
请注意#ifdef PC_INSULTS
某些侮辱文件中的 。这并不意味着“如果你有一台个人电脑”,而是“如果你想在政治上保持正确”。
对于 Ubuntu 16.04.6 LTS,您可以使用:
strings /usr/lib/sudo/sudoers.so | head -n1670 | tail -n49
Run Code Online (Sandbox Code Playgroud)
对于其他 Ubuntu 版本,传递给head
command的行号可能会改变。希望其他人可以验证他们的版本。
Flo*_*sch 84
和
dpkg -L sudo | xargs grep dumber
Run Code Online (Sandbox Code Playgroud)
我们可以搜索包sudo
中的哪些文件包含单词dumber
。
唯一的匹配在 file 中/usr/lib/sudo/sudoers.so
。这是一个二进制文件,因此我们使用该strings
命令只获取看起来人类可读的内容。由于它很多,我们将结果通过管道传输到less
:
strings /usr/lib/sudo/sudoers.so | less
Run Code Online (Sandbox Code Playgroud)
在less
我们可以使用
/dumber
Run Code Online (Sandbox Code Playgroud)
再次搜索单词“dumber”。这让我们直接受到了侮辱。使用光标键上下滚动并退出q
小智 13
以上答案非常适合离线搜索。但是我们是在线的。因此,打开Debian 代码搜索并在此处尝试其中一种侮辱 。它会立即告诉您它在sudo_1.8.12-1/plugins/sudoers/ins_csops.h
. 这样做的好处是可以在任何地方找到它,无论是要部署的配置文件/etc
还是其他任何东西。因为它是一个 .h 文件,它在源代码中是可见的,而不是你可以修改的。
要添加到其他答案,侮辱似乎在.rodata
sudoers.so 部分。您可以使用objcopy
来限制输出,尽管仍然会有很多误报:
$ objcopy /usr/lib/sudo/sudoers.so /dev/null --dump-section .rodata=/dev/stdout | strings | head
/build/sudo-g3ghsu/sudo-1.8.16/plugins/sudoers/auth/sudo_auth.c
invalid authentication methods
Invalid authentication methods compiled into sudo! You may not mix standalone and non-standalone authentication.
There are no authentication methods compiled into sudo! If you want to turn off authentication, use the --disable-authentication configure option.
Unable to initialize authentication methods.
Just what do you think you're doing Dave?
It can only be attributed to human error.
That's something I cannot allow to happen.
My mind is going. I can feel it.
Sorry about this, I know it's a bit silly.
$
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
46092 次 |
最近记录: |