Пожалуй, всем известно, что сегодня, 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 лет назад.
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
buy an essay online - 15-12-20 10:12:43
Nicely put. Thanks!
Best Essay writing
buy aan essay online https://admissionessaywritingservice.com
urgent essay writing service - 15-12-20 05:12:02
That is a very good tip particularly to those new to the blogosphere.
Brief but very precise info… Thank you for sharing this one.
A must read article!
https://onlineessaydigital.com
urgent essay writing service
urgent essay writing service
https://onlineessaydigital.com https://onlineessaydigital.com
buy essay online reviews - 15-12-20 04:12:01
Amazing all kjnds of great information!
Bestt Essay writing
buy essay online reviews https://writemyessaybest.com/
help essay - 15-12-20 03:12:30
Reqlly loads of amazing data!
Best Essay writing
help essay https://writingmypaper.com
custom essay writing - 14-12-20 18:12:21
My brother suggested I might like this web site.
He was totally right. This post trully made my day.
You cann't imagine simply how much time I had
spent for this information! Thanks!
https://yescheapessaywriting.com
custom essay writing
custom essay writing
https://yescheapessaywriting.com https://yescheapessaywriting.com
top essay writing service - 14-12-20 16:12:08
What i don't understood is in fact how you are now not really a
lot more well-preferred than you might be right now. You're so intelligent.
You know therefore significantly wth regards to this topic,
made me in mmy view believe it from a lot of varied angles.
Itts like women andd men are not involved until it is something
to accoomplish with Lady gaga! Your own stuffs nice.
Always deal with it up!
https://writinessayideas.com
top essay writing service
top esway writing service
https://writinessayideas.com https://writinessayideas.com
write papers for me - 14-12-20 07:12:35
I am actually glad to read this weblog posts which contains
tons of helpful facts, thanks for providing such data.
https://goodpaperwritingservices.com
wrrite papers for me
write papers for me
https://goodpaperwritingservices.com https://goodpaperwritingservices.com
help me write - 13-12-20 17:12:57
hello there and thank you for your information – I have definitely picked up something new from right here.
I did however expertise some technical isaues ueing this web
site, as I experienced to reload the site llts of tiimes previous to I could get
it to load correctly. I had been wondering if your webb hostiing is OK?
Not that I amm complaining, but slow loading instances times will sometimes affect your placement in google and could damage your quality score if
ads and marketing with Adwords. Well I'm adding
tnis RSS to my e-mail and can look out for much more of your respective interesting content.
Make sure you update this again very soon.
https://foracademicwriting.com
help me write
help me write
https://foracademicwriting.com https://foracademicwriting.com
best college paper writing service - 12-12-20 22:12:07
What's up, I llog on to your blogs regularly.
Your story-telling style is witty, keep doing
what you're doing!
https://howtowriteanessay28058749.wordpress.com/bcci-competency-essay-writing-guide
best college paper writing service
best college paper writing service https://compare-and-c8618.hpage.com/buy-term-paper-online-to-boost-your-academic-performance.html
fast essay writing service - 12-12-20 17:12:48
Wonderful goods from you, man.I've understand your stuff
previous to and you are just extremely fantastic.
I really like whatt you have acquired here, certainly like what you're saying and the way in which yyou
say it. You make iit enjoyable and you still take care of to keedp iit
smart. I can't wait to read much more from you. This is
really a great web site.
https://clubcustomessay.com
fast essay writing service
fast essay writing service
https://clubcustomessay.com https://clubcustomessay.com
buy essay online reviews - 12-12-20 07:12:21
You actually stated this effectively!
Best Essay writing
buy essay online reviews https://buyessayonlinereviews.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