Пожалуй, всем известно, что сегодня, 5 апреля 2010 года, и католики и православные отмечают Пасху. Пользуясь случаем, я решил написать статью о пасхальных яйцах, только не таких, которые красят, а о тех, происхождение которых связано с тематикой Хабра. Речь пойдёт о пасхальных яйцах языка PHP.
Сразу хочется подчеркнуть, что пасхальные яйца PHP, о которых пойдёт речь, абсолютно безобидны. Их существование никак не может отрицательно сказаться на работе сайта. Как я уже сказал, существует несколько особых строчек (назовём их сигнатурами), добавление которых к запросу ВНЕЗАПНО меняет ответ сервера. Синтаксически сигнатура должна являться значением безымянной и единственной GET-переменной (например, mypage.php?=×××).
Талисман PHP «elePHPant» (некоторые версии 5.2.?).
Подробнее о соответствии версий PHP и этих картинок можно посмотреть в одной англоязычной статье на эту тему на сайте 0php.com. Жалко, что не получилось абсолютно точно установить зависимость, потому что на официальном сайте PHP CVS-log файла, где хранятся изображения, не работает. Прошу прощения, если я где-то ошибся.
Все три изображения (логотип Zend, логотип PHP, забавная картинка) имеют формат GIF и хранятся в виде массивов байт в файле main/logos.h.
Можно ли как-то это отключить?
Если Вы администрируете написанный на PHP сайт, Вы, скорее всего, уже попробовали провернуть этот трюк со своим проектом. Если пасхальное яйцо «работает», то Вы, вероятно, уже решили от него избавиться. Сделать это чрезвычайно просто.
Достаточно открыть у себя на сервере файл php.ini, найти параметр expose_php и поменять его значение на «off»:
expose_php = off
После перезагрузки веб-сервера картинки и страница с информацией о разработчиках перестанут появляться — необычные запросы начнут обрабатываться в обычном режиме. Также сервер прекратит добавлять строку «X-Powered-By: PHP/×.×.× ...» в HTTP-заголовки ответов, упоминание о PHP уберётся из строки «Server: ...» (если оно сейчас там есть).
Избавившись от этого «ужасного хака», Вам удастся всего лишь скрыть факт того, что Ваш сайт использует PHP. Конечно, это относится только к проектам с ЧПУ (да и то далеко не всем). Если же ссылки на Вашем сайте имеют вид «my_cosy_guestbook.php?do=delete_all», Вас это, естественно, не спасёт. Перед поиском и изменением файла php.ini обязательно не забудьте для себя ответить на вопрос: «А оно мне надо?».
Применение в хозяйстве
Несмотря на кажущуюся бесполезность, у описанного пасхального яйца есть практическое применение. Если на своём сайте вывести информацию о системе с помощью функции phpinfo(), Вы увидите логотипы PHP и Zend, а также ссылку «PHP Credits». По какому URI будут запрошены картинки, и куда будет вести ссылка на список разработчиков, догадаться теперь совсем несложно. Ресурсы получаются доступными, даже если сайт тестируется на локальной машине, не имеющей доступ в Интернет. Это работает только при включенной опции expose_php (иначе картинки и ссылка не отображаются). Вот рабочий пример: www.it.tsu.ge/info.php (сайт не мой, я просто разместил объяву ссылку). Ещё пример: hosting.iptcom.net/phpinfo.php (оказывается, картинка с логотипом Zend была совсем другой в версии PHP 4.4.4). Пример сайта с выключенной опцией expose_php на сервере: help.secureserver.net/linux-phpinfo.html.
Яйцо-бонус
Изучая исходники PHP, я случайно наткнулся на источник ещё одного забавного секрета, несколько раз упомянутого в Интернете. Оказывается, что 1 апреля логотип, генерируемый функцией php_logo_guid(), заменяется забавной картинкой (как для случая с сигнатурой PHPE9568F36-D428-11d2-A769-00AA001ACF42). Получается, что в этот день логотип поменяется и на странице, полученной с помощью phpinfo().
В исходниках версии 5.2.13 за это «яйцо» отвечают строчки 1237-1238 файла ext/standard/info.c. Жаль, что увидеть в действии его можно только почти через год. Хотя, нетерпеливые товарищи в любой момент могут поменять системную дату. ;)
Яйцо-бонус № 2
К концу написания статьи выяснилось, что есть ещё одна сигнатура, которая работает в PHP 5. Для этого пасхального яйца нужно, чтобы было включено расширение Suhosin (оно используется для усиления безопасности PHP). Сигнатура такая: SUHO8567F54-D428-14d2-A769-00DA302A5F18. Результатом добавления её в запрос является картинка с тремя иероглифами, которые переводятся с корейского примерно как защитник или ангел-хранитель.
Хорошо, когда люди, разрабатывающие серьёзные вещи, имеют чувство юмора и позволяют себе безобидно пошутить. К тому же пасхальные яйца — неплохая вирусная реклама своего продукта (фактически, я сейчас бесплатно рекламирую PHP). Главное здесь для разработчиков — не переусердствовать.
P.S.: Я понимаю, что для некоторых хабровчан описанный факт покажется бородатым и неинтересным, но уверен, что кто-то слышит о пасхальных яйцах в PHP впервые. Лично я узнал обо всём этом совсем недавно, хотя первый мой php-файл был создан около 5 лет назад.
Hello there, juat became aware of your blog through Google, and found that it is really informative.
I'm gonna wath out for brussels. I'll bee grateful
if you continue this in future. Many people
will be benefited from our writing. Cheers!
https://link.springer.com/chapter/10.1007/978-1-4302-6014-1_7
writing help
writing help https://architecture.uii.ac.id/outputs/annual-theme-2011-hybridity/
essay paper writing service - 9-12-20 22:12:36
You actually mentionerd it fantastically.
essay paper writing service
writing service https://amazingcustompaperwritingservice.com/
best law essay writing service - 2-12-20 21:12:07
Hello! I know this is kinda off topic however I'd
figured I'd ask. Would you be interested in trading links or maybe guest writing a blog post or vice-versa?
My blog goes over a lot of the same topcs as yours and I believe we could greatly
benefit from each other. If you're interested feel free
too shoot me an email. I lok forward to hearing from you!
Superb blog by thhe way!
https://works.bepress.com/socialtopicsforresearchpapers/17/
best law essay writing service
bestlaw essay writing service https://medium.com/p/d55fd5a701fd/edit
help essay writing - 2-12-20 21:12:33
Kudos! I like it!
Best Essay writing
help essay writing https://admissionessaywritingservice.com
buy an essay online - 2-12-20 18:12:02
Thanks a lot! I like this.
Best Essay writing
buy an essay online https://highqualitywritingservice.com
paper writing website - 2-12-20 16:12:33
What's up to every one, the contents present at this website are truly
remarkable for people knowledge, well, keep upp the nice work fellows.
https://cheapessaywritingserviceusa.com/
paper writing website
paper writing website https://cheapessaywritingserviceusa.com/
buy essay writing - 2-12-20 12:12:54
My partner and I stumbled over here by a different website and thought I may as well check things out.
I like what I see so i am just following you. Look forward tto
explorihg your web page for a second time.
https://portal.lackawanna.edu/ICS/Campus_Life/Campus_Groups/Human_Services_Club/Discussion.jnz?portlet=Forums&screen=PostView&screenType=change&id=31ab5b80-01e6-4693-8c10-8013056621c7&p=2
buy essay writing
buy essay writing https://www.folsomimplantdentistry.com/
essay assistance - 2-12-20 07:12:14
Excellent article! We wiull be linking too this great content on our site.
Keepp up the ggreat writing.
https://susanna4fees.medium.com/
essay assistance
essay assistance https://why-do-you-wa9243.hpage.com/buy-research-papers.html
write my essays - 30-11-20 10:11:27
What's up everyone, it's my first pay a vissit aat thuis web site,
and post is actually fruitful for me, keep up posting these types of articles or reviews.
https://cheapessaywritinghelp.com
write my essays
write my essays https://cheapessaywritinghelp.com
academic essay writing service - 29-11-20 23:11:46
Hi there to every body, it's mmy first visit of this blog; thiis web site carries amazing and truly fine material in support
of readers.
https://usessaywritingservice.com
acadermic essay writimg service
academic essawy writinng service
https://usessaywritingservice.com/ https://usessaywritingservice.com
dissertation writerswriting an essay - 29-11-20 20:11:31
It's remarkable for me to have a wweb page, which is helpful inn favor of my knowledge.
thanks admin
https://ordertermpaper.com
dissertation writerswriting an essay
dissertation writerswriting an essay
https://ordertermpaper.com https://ordertermpaper.com
best college essay writing service - 29-11-20 16:11:00
Spot on with thks write-up, I absolutely believe that this web
ite needs a great deal more attention. I'll probagly be back again to read through
more, thanks for the advice!
https://writeargumentativeessay.com/
best college essay writing service
best college essay writing service https://writeargumentativeessay.com
professional essay writing service - 29-11-20 02:11:17
Wow, awesome blog layout! How long have you been bloggiing for?
you made blogging look easy. The overall look of your website is magnificent, let alone the content!
https://admissionessaywritingservice.com/
professional essay writing service
professional essay writing service
https://admissionessaywritingservice.com/ https://admissionessaywritingservice.com/
english essay writing service - 29-11-20 01:11:53
Your style is so unique compared to other people I've read stuff from.
I appreciate you for posting when you have the opportunity, Guess I'll just book mrk this
site.
https://orderessaycheap.com/
english essay writing service
english essay writing service
https://orderessaycheap.com/ https://orderessaycheap.com/
academic writing service - 26-11-20 10:11:56
Unquetionably consider that which you said. Youur favourite reason appeared to be on tthe net the simplest factor to be aware of.
I say to you, I certainly gett irkerd whle other folks consider issuess that they plainly don't understand about.
Youu managed to hit the nail upon the top and also defined ouut the whnole thing without having side-effects , folks could tak a signal.
Will likely be back to get more. Thank you
https://argumentativeresearch.com
academic writing service
academic writing service
https://argumentativeresearch.com https://argumentativeresearch.com
affordable paper writer - 26-11-20 07:11:36
Peculiar article, just what I was looking for.
https://buyessayonlinesafe.com
afordable paper writer
affordable paper writer
https://buyessayonlinesafe.com https://buyessayonlinesafe.com
best online essay writing service - 26-11-20 06:11:26
Good post. I drfinitely love this website. Keep it up!
https://buyingtermpaper.com
best online essay writing service
best online essay writing service
https://buyingtermpaper.com https://buyingtermpaper.com/
essay writing services - 26-11-20 05:11:14
Do you have a spam issue on this website; I also am a blogger, and I was wanting too know your
situation; we have developed some nice practices and we are lopoking to trade
techniques with other folks, please shoot me an e-mail
if interested.
https://buyanessayonlinecheap.com
essay writing services
essay writing services
https://buyanessayonlinecheap.com https://buyanessayonlinecheap.com
application essay writing service - 25-11-20 20:11:00
Tremendous issues here. I'm very glad to peer your article.
Thanks a lot and I am looking ahead to contact you.Will you please drop
mme a e-mail?
http://kevinhill.website2.me/how-to-write-a-persuasive-essay
application essay writing service
application essay writing service https://www.patreon.com/posts/44256188
college application essay writing service - 25-11-20 09:11:48
At thiks time it sounds like expression Engine is the best blogging latform available right
now. (from what I've read) Is that what yyou are using on your blog?
http://angieangeles.website2.me/how-to-use-a-direct-quote-in-an-essay
cllege appllication esseay writing service
college application essay writing service https://sioqiola.medium.com/do-you-underline-book-titles-efcb4302977e
buy essays - 25-11-20 07:11:51
Howdy! I could have sworn I've been to this blog before but after
reading through some of the post I realized it's nnew to me.
Anyhow, I'm definitely happy I found it and I'll be book-marking and checking back frequently!
Hi there! Would you mind if I share your blog with my twitter
group? There's a loot of folks that I think would really enjoy your
content. Please let me know. Many thanks
https://orderessayonlineuk.com
essay writing serrvice review
essay writing service review
https://orderessayonlineuk.com/ https://orderessayonlineuk.com
write a essay online - 24-11-20 21:11:17
Today, I went to the beach wityh my children. Ifound a sea shell and gave it to myy 4 year old daughter and said
"You can hear the ocean if you put this to your ear." She
put the shell to her ear and screamed. There was a
hermit crab inside and it pincherd her ear. She never
wants to go back! LoLI know this is completely off topic but I had to tell someone!
https://argumentativewriting.com
write a essay online
write a essazy online https://argumentativewriting.com
Willard - 24-11-20 19:11:01
I'm extremely impressed with your writing skills
andd also with the layout on your weblog. Is this a paid theme or ddid you modify it
yourself? Either way keep up thhe nice quality writing, it's rare to see a great blog like
this oone these days.
https://essaygood.com
last minute essay writing service
last minute essay writing service (Willard)
https://essaygood.com https://essaygood.com
essay writing service australia - 24-11-20 16:11:44
I think that everything published was ery reasonable.
But, what about this? suppose you were to write a killer title?
I aam nott sayjng your information is nott good, however what if
you added something to possibly grab a person's attention? I mean
PHP - -
- -
iss kinda plain. You should peek at Yahoo's
home page and note how they create article titles tto grab
people interested. You might add a related video or a picture or two tto get people interested about everything've written. Just myy opinion, it might bring your posts a little bbit more interesting.
https://buyessayonlinereviews.com
essay writing service australia
essay writing service australia
https://buyessayonlinereviews.com
essay writing service - 24-11-20 15:11:06
You actually make it serem so easy with your presentation but I
find this topic to be really someghing that I think I would never understand.It seems
ttoo complex and very broad for me. I'm looking forward for your next post, I will try
to get thee hang of it!
https://essaypaperwritingservice.com
essay writing service
essay writing service
https://essaypaperwritingservice.com
buy essay paper - 24-11-20 01:11:14
Hello would you mind letting me know which webhost you're utilizing?
I've loaded your blog in 3 completely different browsers and I must say this blog loads a lot faster then most.
Can you recommend a good hosting provider at a fair price?
Thanks, I appreciate it!
https://servicethesis.com/
buy essay paper
buy essay paper
https://servicethesis.com/ https://servicethesis.com/
custom essay help - 24-11-20 00:11:39
Hi, I do believe this is an excellent site.
I stumbledupon it ;) I will come back once again since I
book-marked it. Money and freedom is the greatest way
to change, may yoou be rich and continue to help others.
https://highqualitywritingservice.com/
custom essay help
custom essay help
https://highqualitywritingservice.com/ https://highqualitywritingservice.com/
cheap essay writer - 20-11-20 12:11:52
Remarkable! Its truly awesome article, I have got much clear idea on the topic of from
this paragraph.
https://dillieszw786am.medium.com/easy-essay-xname-bdfe1663869a
cheap essay writer
cheap essay writer https://bennettxvwcdzzj.medium.com/
essay writing service - 20-11-20 11:11:34
I couldn't refrain from commenting. Perfectly written!
https://medium.com/p/41a6984c04d4/edit
essay writing service
essay writing service https://social-issue-2598.hpage.com/ap-lit-poetry-comparison-essay.html
writing help - 9-12-20 23:12:04
Hello there, juat became aware of your blog through Google, and found that it is really informative.
I'm gonna wath out for brussels. I'll bee grateful
if you continue this in future. Many people
will be benefited from our writing. Cheers!
https://link.springer.com/chapter/10.1007/978-1-4302-6014-1_7
writing help
writing help https://architecture.uii.ac.id/outputs/annual-theme-2011-hybridity/