Пожалуй, всем известно, что сегодня, 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 лет назад.
Keep on working, great job!
https://harborbaystorage.net/tadalafil-prezzo-in-farmacia
cialis buy
cialis buy https://harborbaystorage.net/
Doctor cardone - 3-04-21 07:04:42
Simply desire to say your article is as amazing. Thee clarity
in your post iss jst excellent andd i can suppose you are aan expert in this subject.
Finne wwith your permission allow me to take hold of your feed to
stay updated with impending post. Thank you 1,000,000 and please keep up the enjoyable work.
https://www.musta.io/doctor-cardone.pdf
Doctor cardone http://layarpelangi.com/can-t-fill-pdf-form.pdf
Gawyzomudi - 31-03-21 09:03:09
От чистого сердца делюсь сообществом vkontakte, где публикуются десятки тысяч угарных анекдотов. Загляните https://vk.com/Vash_Pozitiv и найдёте свою дозу прикольного настроения и как результат СЧАСТЬЯ ;) Будьте с Вашим-Позитивом и тогда всё получится!
Jeremiah - 12-02-21 19:02:57
Hurrah! At last I got a website frm where I be able
to really get helpful information regarding my study and knowledge.
This is very interesting, Youu are a very skilled blogger.
I've joined your rss feed and look forward to seeking mode of your magnificent
post. Also, I've shared your website in my socia networks!
https://600135e89a34e.site123.me/blog/tips-on-how-to-write-a-university-essay-step
paper writer
paper writer https://postsriwap.medium.com/satiric-essays-c5ead25ef58
best essay writing service uk - 26-12-20 07:12:04
This website certainly has all the information I wanted anout
this subject and didn't know who to ask.
https://mywritingexperience.com
best essay writing service uk
best esszy writing service uk
https://mywritingexperience.com https://mywritingexperience.com
cheap essay writing - 26-12-20 06:12:45
bookmarked!!, I really like your site!
https://globalwritinganessay.com
cheap essay writing
cheap essay writing
https://globalwritinganessay.com https://globalwritinganessay.com
top essay writing service - 25-12-20 08:12:05
excellent issues altogether, you just received a emblem new reader.
What might youu suggest in regards too your post that you simply made some days
in the past? Anny positive?
https://bestessaytech.com
top essay writing service
top essay wtiting service
https://bestessaytech.com https://bestessaytech.com
college paper writing - 22-12-20 09:12:12
I love your blog.. vsry nice colirs & theme. Did you design this website yourself or did you hirre someone to do iit for you?
Plz reply ass I'm looking to create my own blog and would like to find
out here u got this from. cheers
http://5ch.bz/read/thread/9247268572/l50/
college paper writing
college paper writing https://tpmformacion.com/fedeme/2017/09/15/hola-mundo/
help essay - 21-12-20 09:12:41
When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each time
a comment iss added I get four emails with the same comment.
Is there any way you can remove me from that service? Bless
you!
https://argumentativeresearch.com
help essay
help essay
https://argumentativeresearch.com https://argumentativeresearch.com
academic essays - 20-12-20 11:12:08
Sweet blog! I found it while searching on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Many thanks
https://essayquestionwriting.com
academic essays
academic essays
https://essayquestionwriting.com https://essayquestionwriting.com
writing essay website - 19-12-20 21:12:11
I have fun with, lead too I discovered exactly what
I used to be taking a look for. You have ended myy 4 day long hunt!
Good Bless you man. Have a nice day. Bye
https://digitalessaywriters.com
writing essay website
writing essay website
https://digitalessaywriters.com https://digitalessaywriters.com
dissertation writerswriting an essay - 19-12-20 21:12:12
What's Happening i am new too this, I stumbled upon this
I've found It positively hellpful and it has aided me out loads.
I am hoping to contribute & assist other users like its aidrd me.Great job.
https://techcheapcustomessay.com
dissertation writerswriting an essay
dissertation writerswriting an essay
https://techcheapcustomessay.com https://techcheapcustomessay.com
cheap research paper writing - 19-12-20 19:12:38
If some one wishes expert view regarding running a blog afterward i suggestt him/her to
pay a quick vsit this webpage, Keep upp the pleasant job.
https://marketwritingservices.com
cheap research paper writing
cheap research paper writing
https://marketwritingservices.com https://marketwritingservices.com
essay writer websites - 19-12-20 06:12:20
I was recommended this web site by mmy cousin. I'm noot sure whether this
post is written by him as nobody else knmow such detailed about my problem.
You are wonderful! Thanks!
https://studiowritingservices.com
essay writer websites
essay writer websites
https://studiowritingservices.com https://studiowritingservices.com
cheap essay writing service usa - 18-12-20 22:12:58
I've been browsing on-line more than 3 hours these days,
but I never found any interesting article like yours.
It is pretty value enough for me. In my opinion, iif alll
webmasters and bloggers mmade just right content material
as you did, the net will likely be much more useful than ever before.
https://essayglobalservices.com
cheap essay writing service usa
cheap essay writng service usa
https://essayglobalservices.com https://essayglobalservices.com
cheap reliable essay writing service - 18-12-20 19:12:28
At this time itt seems like Wordpress iis the preferred blogging platform available right now.
(from what I've read) Is that what you are using on your blog?
https://internationaltopwriting.com
cheap reliable essay writing service
cheap reliable essay writing service
https://internationaltopwriting.com https://internationaltopwriting.com
custom essay writing service uk - 18-12-20 09:12:41
Hi there ery nice blog!! Guy .. Excellent ..
Wonderful .. I'll boolmark your site and take the feeds also?
I'm satisfied to find numerous helpful information right here within the post,
we need work outt extra techniques in this regard, thanks for sharing.
. . . . .
https://servicesdigitalwriters.com
custom esxay writing service uk
custom essay writing service uk
https://servicesdigitalwriters.com https://servicesdigitalwriters.com
dissertation writerswriting an essay - 18-12-20 06:12:37
Wonderful knowledge With thanks.
Best Essay writing
dissertation writerswriting an essay https://antichat.com/members/372678/
writing services - 17-12-20 10:12:54
Amazing issues here. I'm very satisfied to see your article.
Thank you so much and I'm looking forward to contact you.
Will you kindly drop mee a mail?
https://www.portlandfishingtrips.com/board/board_topic/5380397/3397677.htm?page=12
writing services
writing services https://www.americandigital.shoppingcartsplus.com/board/board_topic/2138442/5500675.htm?page=3
write my essay - 17-12-20 07:12:04
Regards, Amppe information.
Best Esay writing
write my essay https://researchpaperorder.com
cheap dissertation writers - 17-12-20 00:12:21
We are a gaggle of vopunteers and openjng a brand new scheme
in our community. Your site offered us with helpful info to work on. Yoou have done an impressive twsk and our
entire group can bee grateful to you.
https://writeessayformoney.com
cheap dissertation writers
cheap dissertation writers https://writeessayformoney.com/
buy essay paper online - 16-12-20 21:12:20
You eexpressed that very well!
Best Essay writing
buy essay paper online https://admissionessaywritingservice.com
buy essays - 16-12-20 20:12:33
Thanks a lot, A good amount of write ups!
Best Essay writing
buy essays https://buyessayonlinesafe.com
Superb stuff Cheers!
Best Essy writing
https://www.lespharaons.com/2020/08/14/retrait-des-fonds-des-comptes-des-abonnes-mtn-au-coeur-dune-nouvelle-polemique-au-benin/ https://indyschild.com/listing-of-psychology-research-paper-topics/
essay writing help service - 16-12-20 06:12:05
Heya fantasti website! Does running a blog similar to this take a
great deal of work? I have very little knowledge of
computer programming however I was hoping to sgart my own blog iin the near future.
Anyhow, if you have any ideas or techniques for new blog owners please share.
I know this is off topic nevertheless I simply haad
too ask. Thanks a lot!
https://www.patreon.com/posts/44569283
essay writing help service
essay writing help service https://gumroad.com/gresampleissueessayt/p/buy-research-papers-online-15-off-3222a319-f0f0-43fc-942f-4772a1cffb8c
essay helper - 16-12-20 02:12:27
You said it perfectly.!
essay helper
essay writer service https://webcustomwritinghelp.com/
essay help service - 15-12-20 13:12:44
I think this is among the most important information for me.
And i'm glad reading your article. But want to remark on some general things, The web site styyle is
great, the artidles is really nice : D. Good job, cheers
https://topessaystore.com
essay help service
essay help service
https://topessaystore.com https://topessaystore.com
best essay writing service uk - 15-12-20 12:12:23
Useful info. Fortunate mme I found your site
unintentionally, and I am stunned why this twist of ffate didn't came about in advance!
I bookmarked it.
https://goodenglishessaywriting.com
best essawy writing service uk
best essay writing sservice uk
https://goodenglishessaywriting.com https://goodenglishessaywriting.com
essay writing service - 15-12-20 12:12:13
This is nicely expressed! .
Best Essay writing
essay writing service https://argumentativeresearch.com
cialis buy - 4-04-21 00:04:53
Keep on working, great job!
https://harborbaystorage.net/tadalafil-prezzo-in-farmacia
cialis buy
cialis buy https://harborbaystorage.net/