Пожалуй, всем известно, что сегодня, 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 лет назад.
Watch Jav Online Free - JavFree - 19-02-19 09:02:55
Good web site you have got here.. It's hard to find high quality writing like yours these days.
I really appreciate individuals like you! Take care!!
hoteles baratos en guadalajara - 30-01-19 21:01:32
Centro Guadalajara, C.P. 44100 Jalisco, M_xico.
Streaming Hentai Online Free - 7-12-18 22:12:17
I was recommended this website by my cousin.
I am not sure whether this post is written by him as nobody else know such detailed about my problem.
You're incredible! Thanks!
minecraft - 16-09-18 10:09:09
Heya i'm for the first time here. I found this board
and I find It truly useful & it helped me out a lot. I hope to give something back and help
others like you helped me.
I always used to study piece of writing in news papers but now as I am a user of net therefore from now I
am using net for posts, thanks to web.
RadikScoda - 8-08-18 16:08:58
Meet a guy to communicate and more
write I won't bite you +79967254947
boys write WhatsApp +79967254947
boys write WhatsApp +79967254947
boys write WhatsApp +79967254947
FrancisBem - 29-07-18 08:07:14
Оказываем услуги по сбору любой информации по интернет.
Соберем все: информацию, ссылки, статьи, контакты клиентов
или поставщиков итд
Выполним любые Ваши поручения по сбору информации в интернет
Подробности по email: dimagurin491@gmail.com
Payday Loans - 24-07-18 22:07:13
loan for bad credit rise loans online best cash advance loans online [url=http://aloans.cars]usa payday[/url]
FrancisBem - 12-07-18 04:07:17
Оказываем услуги по сбору любой информации по интернет.
Соберем все: информацию, ссылки, статьи, контакты клиентов
или поставщиков итд
Выполним любые Ваши поручения по сбору информации в интернет
Подробности: https://www.instagram.com/bazydannykh4/
RichardwEd - 11-06-18 10:06:13
19 (Xinhua) Three people, among them a U. [url=http://www.cheapwholesalenflnikejerseys.us.com/]Wholesale Jerseys China[/url]. dollars, according to the event organizer DMGEvents. Some girls and women develop body image problems that cause them to work out intensely and not eat enough to provide them with the nutrients their bodies need. Of course, the invitations and ceremony etiquettes should not be neglected either.S. The book and this ecourse is so easy to understand and follow that will not miss anything out. Even if the trash contains some hazardous materials like asbestos, the service provider comes in with proper measures that help a client get rid of the unwanted materials safely. The best approach is of course to include both aerobic and anaerobic exercises such as circuit training regularly. Though you can get these services easily, they have to act fast and ensure you get the best.[url=http://www.cheapwholesalenflnikejerseys.us.com/]Cheap Jerseys Free Shipping[/url].[url=http://www.cheapwholesalenflnikejerseys.us.com/]Cheap NFL Jerseys From China[/url]. Azoospermia is a condition in which there is complete absence of sperm. However, this treatment can be very expensive and can burn a hole in your pocket.The game in question was a Ligue 2 match drawn 11 on May 13, which helped Nimes avoid relegation from the second division while Caen virtually secured their promotion to the top flight.Visit my siteЈєhttp://www.cheapwholesalenflnikejerseys.us.com/
beannyAnece - 7-06-18 10:06:30
"What we have done is increasing efficiencies in the public serviceЈ¬ delaying spending on noncritical infrastructureЈ¬ and putting a stop to excess such as unwarranted overseas travel by bureaucrats. It is a natural brain tonic and boosts sperm count. Muscles keep the shoulder joint in place including the glenoid cavity that accommodates the ballandsocket in which the head of the humerus plays."We will make sure that districts are properly funded through their (District Service Improvement Programs) and that core services will be deliveredЈ¬" PNG Prime Minister Peter O'Neill said in a statement. If you’re overweight you might also be selfconscious, [url=http://www.cheapnfljerseyswholesaleonline.com/]Cheap Vintage NFL Jerseys Sale[/url], and it won’t help your morale if you’re stuck in the local Tesco staring at the weight loss aisle for 15 minutes deciding what to get. It improves sexual stimulation by toning the nerve endings. Since weight loss supplements are widely available,[url=http://www.cheapnfljerseyswholesaleonline.com/]Cheap Jerseys From China[/url], you would be entitled to question the need to go online to do your shopping, if the corner Tesco might have it. Great luck!In all probability the most coveted and soughtfollowing bag in the fashion entire world is the Hermes Birkin bag. Basically a staffing agency is the one that provides companies with almost any kind of capable and skilled human resources.In front of the local government of Iidate Village in Japan's Fukushima PrefectureЈ¬ there stands a sharp radiation measuring device. It has antimicrobial and antibacterial properties.[url=http://www.cheapnfljerseyswholesaleonline.com/]Cheap Nike NFL Jerseys[/url].S.Visit my siteЈєhttp://www.cheapnfljerseyswholesaleonline.com/
Speedy Cash - 6-06-18 00:06:22
payday loans hamilton unsecured loan secured loans [url=http://creditloans.cars]unsecured personal loan[/url]
An impressive share! I've just forwarded this onto a co-worker who has been conducting a little research on this.
And he actually ordered me breakfast due to the fact that I found it for
him... lol. So allow me to reword this....
Thank YOU for the meal!! But yeah, thanks for spending the
time to talk about this subject here on your web site.
chuabenhthan.vn - 2-06-18 02:06:18
Hello! This is my first comment here so I just wanted to give
a quick shout out and say I genuinely enjoy reading through your
posts. Can you recommend any other blogs/websites/forums that go over the same topics?
Thanks a ton!
t_ng c__ng sinh l_ - 1-06-18 13:06:59
I got this site from my pal who shared with me regarding this website
and now this time I am browsing this site and reading very informative articles or reviews here.
We stumbled over here from a different web page and thought I should check things out.
I like what I see so now i am following you. Look forward to looking over
your web page yet again.
__ng tr_ng h_ th_o - 14-05-18 09:05:08
My partner and I stumbled over here different web page and thought I should check things out.
I like what I see so i am just following you.
Look forward to going over your web page again.
It is the best time to make some plans for the future and
it is time to be happy. I've read this post and if I could I
want to suggest you some interesting things or suggestions.
Perhaps you could write next articles referring to this article.
My brother suggested I might like this website. He was totally right.
This post truly made my day. You can not imagine just how much time
I had spent for this information! Thanks!
Paulo Jo_o - 27-04-18 13:04:49
Eu s_ queria deixar uma bela sauda__o porque.
Sou precisamente a website. http://markface2.cosolig.org/post/visto-que-obter-arame-atravs-da-web-
Daniel - 13-04-18 10:04:43
e nao esqueca de penetrar as portas certas. http://www.moya-planeta.ru/go.php?url=http://trick.s201.xrea.com/x/yybbs/yybbs.cgi?list=thread
como ganhar dinheiro na internet clicando pagsegur - 13-04-18 03:04:32
Super page, sou discordomais uma vez. http://Thorpebredahl4.Jiliblog.com/12153556/microssaia-p-gina-da-internet-ninja-funciona-leia-certo-outrora-a-comprar
Chang - 8-04-18 15:04:22
Ol_ , depois de ler este incr_vel artigo tamb_m estou confort_vel para compartilhar
minha experi_ncia com amigos ! http://jmanajemen.journal.ipb.ac.id/index.php/jurnalilkom/comment/view/1097/0/134789
Mong r_ng nh_ng th_ng tin tr_n kia s_ gi_p cho _ch cho b_n.
Th_n _i, http://khamsuimaoga.com/
Lancenox - 20-01-18 03:01:45
Вопрос о том, когда отношения можно считать по-настоящему счастливыми, давно волнует исследователей, причем каждый старается развить собственную теорию, пишет Die Welt (перевод на Inopressa.ru), подробнее об этом читайте на сайте [url=http://xozyaika.com]xozyaika.com[/url]
Francistic - 17-01-18 10:01:40
Gullion | Posted in AdvertisingThe advent of the web has given numerous small companies with the capability to level themselves with major corporations. Just imagine, [url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap Jerseys[/url], even the well-known brands like Google and Amazon still market themselves to increase revenue.[url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap NFL Jerseys[/url]. ThatR17;s why a domain name is so important.[url=http://www.cheapwholesalenflfootballjerseys.com/]Cheap NFL Jerseys Wholesale[/url]. Setting up a sequence of small steps needed to reach your goal will make its achievement easier. As much more gigs are extra to Fiverr, itR17;s going to turn into more difd??cult to separate the wheatfrom your chaff.The venerable habit of turning of unnecessary lights when leaving a room. Checking the history and selling background of the company will certainly help avoid any issues along the way.There are numerous processes and so much of avoidable waste and consequently the medical care system could definitely profit out of application of lean principle. Straw is a great insulator and it also cheap to use. This will save both yourself and your usersR17; time.Among the most memorable testimonials requires an eccentric English male who goes through theusername, samcornwell. This is very essential since there are now lots of frauds out there.Visit my siteЈєhttp://www.cheapwholesalenflfootballjerseys.com/
JesseThelm - 16-01-18 16:01:03
Improvements availabledrug storeEnsuring pharmacies have optimum degree of stocks that medicines are never stocked out at the point of use & to stay clear of losses as a result of expiry of medicines and so on. The issue will likely be finding the one which has not yet already been taken by another individual. These products can cut down dramatically on your cooling and heating costs.A good tip for saving energy is to switch your boiler. This can prevent any nasty surprises during winter, and you have excess during the summer. This will save both yourself and your usersR17; time. [url=http://www.cheap-wholesalenfljerseys.com/]Wholesale NFL Jerseys Free Shipping[/url].[url=http://www.cheap-wholesalenfljerseys.com/]Wholesale Jerseys Cheap[/url].Remain AdaptableEven imagined you have every single day pre-prepared,[url=http://www.cheap-wholesalenfljerseys.com/]Cheap Jerseys Free Shipping[/url], never fail to remember to use typical sensation and be ready to swap out one day for a different. Apart from accessing files of libraries on the web, businesses these days can access stock exchange data and breaking new instantly through the internet. Setting up a sequence of small steps needed to reach your goal will make its achievement easier. The issue will likely be finding the one which has not yet already been taken by another individual. But this does not mean one should enhance the inconvenience of customers by not really providing them with appropriate repair manuals. Even lingering in a Pub and observing sport on Television (with the Londoners) can give you a excellent knowledge of what it is like to stay in the United kingdom additional than a museum or guide.Visit my siteЈєhttp://www.cheap-wholesalenfljerseys.com/
Watch Jav Online Free - JavFree - 19-02-19 09:02:55
Good web site you have got here.. It's hard to find high quality writing like yours these days.
I really appreciate individuals like you! Take care!!