Для тех, кто любит юмор, sudo может быть настроен для печати случайной более или менее оскорбительной или смешной фразы вместо нейтральной Sorry, try again., добавив строку ниже к /etc/sudoers (используя команду sudo visudo, не редактируя вручную!):
Defaults insults
Вот несколько примеров:
[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!
Теперь просто для удовольствия я бы хотел прочитать все, но введя неверные пароли весь день не самый лучший метод (задержка после каждой попытки, только 2 сообщения за 3 попытки, отмена после 3 попыток, ...).
Итак ... где хранятся эти оскорбления? Любой текстовый файл, который я могу прочитать прямо? Или жестко закодированные строки в исходном коде?
Как я могу получить список всех доступных sudo сообщений оскорбления?
С
dpkg -L sudo | xargs grep dumber
мы можем искать, какие файлы из пакета sudo содержат слово dumber.
Единственное совпадение - в файле /usr/lib/sudo/sudoers.so. Это двоичный файл, поэтому мы используем команду strings, чтобы получить только то, что выглядит как читаемое человеком. Поскольку это много, мы передаем результат в less:
strings /usr/lib/sudo/sudoers.so | less
В less мы можем использовать
/dumber
для повторного поиска слова «dumber». Это подводит нас к оскорблениям. Прокрутите вверх и вниз с помощью клавиш курсора и закройте с помощью q
Когда мы смотрим на все оскорбления, мы обнаруживаем интересный лакомый кусочек: говоря, что Брокколи политически корректна, но говорит, что Burrito - нет.
.
/*
* 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.",
/*
* 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?",
/*
* 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",
.
/*
* 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",
Файл insults.h содержит инструкции компилятора на какие из указанных выше оскорблений включить в скомпилированное ядро. В самом деле, вы можете создать свой собственный файл оскорблений, добавить имя в insults.h и перекомпилировать, чтобы иметь такие сообщения, как «Что, вы пользователь ArchLinux?» или «Это не Windows, где ошибки являются обычным явлением!» и т. д.
Обратите внимание на #ifdef PC_INSULTS в некоторых файлах оскорблений. Это не означает «если у вас есть персональный компьютер», это означает «если вы хотите быть политически корректным».
Вышеупомянутые ответы отлично подходят для автономного поиска. Но мы в сети. Поэтому откройте поиск кода 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.
$