Пожалуй, всем известно, что сегодня, 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 лет назад.
you're in point of fact a good webmaster.
The web site loading pace is incredible. It kind of feels that you're doing any unique trick.
Also, The contents are masterwork. you've performed a magnificent
task in this subject!
https://www.wideopenspaces.com/
buy essay online safe
buy essay online safe (Tresa)
https://www.ansaroo.com/ https://www.revolvy.com/page/PTRS%2D41
moon kratom maeng da - 8-11-20 15:11:57
Goodd day! I know this is kinda off topic but
I was wondering which blog platform are youu using for this website?
I'm getting sick and tired oof Wordpress because I've had problems
wiith hackers and I'm looking at alternatives for another platform.
I would be fantastic if you could ppint me inn the directioon of a
good platform.
https://cbdwwwkratom.com
moon kratom maeng da https://cbdwwwkratom.com
best essay writing service uk - 4-11-20 10:11:34
I visit everyday some sites and blogs to read content, except this website presents feature based writing.
https://essayserviceusukua.com
best essay writing service uk
https://termpaperwriterservice.com/ https://ordertermpaperonline.com
best cheap essay writing service - 27-10-20 18:10:40
Hello, Neat post. There iis a problem with your siite in internet explorer, might test this?
IE still iss the market leader and a good portion of folks will miss your fantastic writin due to this problem.
https://medium.com/@vonniejafk/cultural-analysis-topics-b2013af062f4
best cheap essay writing service
best cheap essay writing service
https://medium.com/@dalstonfoo5133/euthanasia-essay-outline-316d1cc5121b https://cul2gchiang.medium.com/leadership-styles-essay-55abd219c5d
writing essay website - 27-10-20 07:10:17
This websiote was... how do I say it? Relevant!! Finally I have found something that helped me.
Cheers!
https://buyessayonlinecheap.info
writing essay website
writing essay website
https://buycustomessay.info https://writeessaysforme.info
writing my paper - 27-10-20 06:10:25
Howdy! I could have sworn I've been to this blog before butt after reading through some off the post I realized
it's new to me. Anyhow, I'm definitely glad I found it and I'll be bookmarking and
checking back often!
https://servicethesis.info
writing my paper
writing my paper
https://writinganessay.info https://essaywritingservicereddit.info
thesis writing services - 25-10-20 17:10:38
Heya i'm forr the first time here. I found this board and I find It truly useful & it helped me
out much. I hope to give something back and aid others like
you aided me.
https://essaywritingservicereddit.info
thesis writing services
thesis wriying services
https://essaywritingservicereddit.info https://essaywritingservicereddit.info
paper help - 23-10-20 01:10:27
I'll immediately snatch your rss feed as I can't to find your e-mail subscription hyperlink or newsletter service.
Do you have any? Kindly let me recognise in order that I could
subscribe. Thanks.
https://rosanaswangog9aq.medium.com/how-to-write-an-essay-9c2f2ac2e2c4
paper help
paper help
https://rosanaswangog9aq.medium.com/how-to-write-an-essay-9c2f2ac2e2c4 https://leiconttio.medium.com/essay-writing-practice-31b46d8e22d7
homepage - 21-10-20 06:10:48
It iss perfect time to make some plans for the long run and it's time to
be happy. I've learn this publish and if I mayy just
I wish to recommend you some fascinating issuees or advice.
Maybe you could write subsequent articles referring to this article.
I wsnt to reawd mmore things approximately it!
https://australianessaywritingservice.info
Hi! Quick question that's completely off topic. Do you knoww
how to make your site mobile friendly? My bllog looks weird when viewing from my iphone.
I'm trying to find a theme or plugin that might be able to fix this issue.
If you have aany suggestions, please share. Cheers!
https://helpassignmentwritingservice.info
write my paper affordable
write my paper affordable
https://servicethesis.info https://bestessaywritingservice.info
writing essays - 18-10-20 16:10:18
I know this web page presents quality depending articles orr reviews and extra information,
is there any other site which provides these
kinds of information in quality?
https://writinganessay.info
writing essays
writing essays
https://writinganessay.info https://writinganessay.info
buy essays online - 16-10-20 03:10:53
Very descriptive article, I liked that bit.
Will thwre be a part 2?
https://howtowriteanessayinenglish645.blogspot.com/
buy essays online
buy essays online
https://essaywritersforhire634.blogspot.com/2020/10/eight-tips-on-how-to-write-essay-fast.html https://essayideas671.blogspot.com/
custom dissertation writers - 16-10-20 01:10:44
Paragraph writing iis also a excitement,
if you be familiar with thedn you can write otherwise it is complex to write.
Hurrah! Finally I got a weblog from where I be able to actually
obtain useful data concerning my study and knowledge.
click site
click site
https://movpicture.com https://violetloan.com
buy essay papers online - 15-10-20 09:10:25
Hi thee friends, its enormous paragraph abou teachingtand entirely explained, keep itt up all the time.
Hello, Neat post. There's an isaue along with your web site in internet explorer, could
test this? IE nonetheless is the market leader and a large portion of people will miss your excellent writing because of this problem.
https://essayserviceuk.info
essay writing service usa
essay writing service usa
https://essayserviceuk.info
buy essay online uk - 15-10-20 04:10:14
I'm curious to find out what blog platform you happen tto be
utilizing? I'm experiencing sime minor security problems with my latest site and I'd
like to find something more safe. Do you have anyy recommendations?
https://collegeapplicationessaywritingservice.info/
buy essay onine uk
buy essay online uk
https://collegeapplicationessaywritingservice.info/
buy an essay - 14-10-20 22:10:46
It's very simple to find out any matter on net as compared to textbooks, as I found this article
at this website.
https://essaywritingusauk.com
buy an essay
buy an essay
https://essaywritingusauk.com
writing service - 14-10-20 19:10:22
continuously i used to read smaller articles which as well clesar their motive, and that is also happening with this article which I am readfing at this time.
https://helpassignmentwritingservice.info
writing service
writing service
https://helpassignmentwritingservice.info
buy an essay cheap - 14-10-20 08:10:02
It's the best time to make some plans for the future and it's time to be happy.
I've learn this publish and if I may I want to
recommend you few interesting things or tips.
Maybe you could write subsequent articles relating
to this article. I wish to read even more issues about it!
https://collegeapplicationessaywritingservice.info
buy an essay cheap
buy an essay cheap00000039
https://writingmypaper.info https://collegeapplicationessaywritingservice.info/
cheap essay writer - 13-10-20 16:10:08
Hurrah, that's what I was exploring for, what a information! existing here
at this web site, thanks admin of this web page.
https://writemycustompaper.com
cheap essay writer
cheap essay writer
https://writemycustompaper.com
essay writers - 9-10-20 00:10:32
Hello, i think that i saw you visited my website so i came to “return the
favor”.I am attmpting to find things to enhance my site!I supose its ok to use some of your ideas!!
We are a gaggle of volunteers and opening a brand
new scheme in our community. Your web site provided us with
helpful information to work on. You have done a formidable activity and our whole neighborhood
will probably be grateful to you.
can you buy cbd oil at gnc
can you buy cbd oil at gnc
essay writers - 1-10-20 14:10:01
After looking into a number of the bllog articles
on your web page, I really like your techniue of writing a
blog. I saved it to mmy bookmark website list and
will be checking back soon. Please visit my web site too and let
me know how you feel.
https://essaywritingmyteacher82.blogspot.com/2020/09/blank-manuscript-paper.html
help me write my essay
essay writers
https://vacationessaywriting553.blogspot.com
acquisto cialis online - 27-09-20 04:09:44
Article writing is also a excitement, if you be familiar with then you can write if not it is difficult to write.
After I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and now whenever a comment is added I get 4 emails with the
same comment. Perhaps there is an easy method you can remove me from that service?
Many thanks!
cbd oil that works 2020 - 4-04-20 12:04:52
Do you have a spam issue on this website; I also am a blogger, and I was curious about your situation; many of us have created some nice procedures and we are looking to trade techniques with others, please
shoot me an e-mail if interested.
Abermotgom - 21-03-20 19:03:31
Ontario dejtingsajter [url=https://babedont.net/dejtingsajt-pretoria-sydafrika.html]dejtingsajt Pretoria Sydafrika[/url] vn dating pa natet dejtingsajter fungerar det rostade #1 dejtingsajt 2014 https://babedont.net/12-tecken-du-dejtar-en-riktig-man-inte-en-playboy.html dating rad Miranda sjunger
Tresa - 18-11-20 08:11:04
you're in point of fact a good webmaster.
The web site loading pace is incredible. It kind of feels that you're doing any unique trick.
Also, The contents are masterwork. you've performed a magnificent
task in this subject!
https://www.wideopenspaces.com/
buy essay online safe
buy essay online safe (Tresa)
https://www.ansaroo.com/ https://www.revolvy.com/page/PTRS%2D41