Lançamos mais 04 novos projetos que serão mantidos por este site! Visite a seção Projetos e saiba mais!
 

Login






Esqueceu sua senha?

Pesquisar

O site Insphpired foi criado com o intuito de publicar artigos diferenciais sobre PHP e sobre tudo que envolve Desenvolvimento Web nesta linguagem.
Easter Eggs e Segurança no PHP Imprimir
Avaliação do Usuário: / 7
PiorMelhor 
Por Ricardo Maia   
12 de abril de 2007

Image É prática comum entre muitos desenvolvedores de software incluem easter eggs em seus aplicativos. Um Easter Egg ou "Ovo de Páscoa" são brincadeiras incluídas propositadamente com a finalidade de que sejam descobertas como diversão, similar à prática de "Caça aos Ovos" realizada em muitos países.

O que discutiremos aqui é como essa inocente brincadeira pode expor dados importantes de um servidor web a um atacante e com isso facilitar suas ações. 

 

Bem, essa "pesquisa" que realizei iniciou com uma pergunta feita numa lista sobre PHP.

O autor da pergunta queria saber como descobrir a versão do PHP instalada no servidor, com o detalhe que ele não tinha qualquer acesso a upload de arquivos ou coisa do tipo. Portanto, não poderia fazer o upload de uma página com a função phpinfo() para dar essa informação a ele.

Fiquei imaginado se havia alguma maneira de obter uma informação estática e ao mesmo tempo única para cada versão do PHP. Lembrei-me de que há algum tempo tinha visto uma matéria sobre easter eggs no PHP. Chegei a testar um deles, que exibia o logo do PHP quado passávamos um determinado valor à uma página PHP pela URL. Algo do tipo http://www.exemplo.com.br/index.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42

Me perguntei se esta imagem seria ligeiramente diferente entre versões do PHP mas exatamente igual numa mesma versão. Pra quê? Se confirmada essa idéia eu poderia criar "assinaturas" para cada imagem e correlacioná-las a sua respectiva versão. A "assinatura" seria feita através do cálculo de hash da imagens, feito com a ferramenta tipo md5sum.

Mãos à obra. Acessei diferentes sites os quais eu conhecia a versão do PHP instalada, chamei o easter egg da logo e baixei as imagens para comparação. Nada feito! Eram todas exatamente iguais!! Undecided

Sem me dar por satisfeito procurei outra forma de fazer isso. De cara já descartei os easter eggs de imagem. Fui verificar a página de créditos, acessível como http://www.exemplo.com.br/index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000.

Desta vez achei o que estava procurando!!! As páginas de créditos do PHP variavam de versão para versão, mas eram idênticas dentro daquela versão, mesmo em sites diferentes.

Então criei "assinaturas" para algumas versões do PHP e escrevi um pequeno script para detectar automaticamente as vesões.

Tudo bem... mas ainda não entendi onde está a vulnerabilidade!!?!?! Yell

Uma das etapas durante o comprometimento de segurança de um servidor é verificar que serviços ele dispõe e qual a versão do software instalado, de modo que se possa buscar falhas para aquela versão específica. Por isso expor a versão do PHP, do Apache, do MySQL ou qualquer outra coisa, pode ser um risco!

Agora sim! Mas como é que eu faço pra resolver isso? 

Basta modificar a diretiva expose_php como OFF no arquivo php.ini. Esta diretiva liga ou desliga a assinatura do PHP nos cabeçalhos do servidor web, bem como liga/desliga todos os easter eggs.

Então abra seu arquivo php.ini e modifique a linha para expose_php=off.

Se quiser testar alguns sites, fiz uma versão online da ferramenta de detecção de versão em:

http://www.insphpired.com/projetos/detecta_versao/  

EOF! 

+/-
Comentar
Nome:
E-mail:
 
Website:
Título:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Por favor coloque o código anti-spam que você lê na imagem.
+/- Comentários
Adicionar novo Busca
wow power leveling  - 9     |123.145.188.xxx |2009-09-30 05:33:55
We are sell wow gold and wow power leveling or wow gold
Last Chaos Gold     |218.104.230.xxx |2009-11-16 21:13:45
294716833691754 This little Fae, Eve Online Isk who meets the Runescape Gold sweet name of Eve Isk Mylandra at first Runescape Money glance is all that is Aion Kina more normal ?? But if Replica Watches we look more closely ?? If so, Replica Watch check out its wings! It carries the "Eve Online Isk Sale wings courageous, even those Buy Eve Online Isk that can be earned in the Radiance of Cheap Eve Online Isk Love, as long as they do show Lotro Gold a little patience. and Maple Story Mesos we do not be Dofus Kamas afraid to make Jordan Shoes several times Aion Kinah the body.
Last Chaos Gold     |218.104.230.xxx |2009-11-16 21:14:03
294716833691754 This little Fae, Eve Online Isk who meets the Runescape Gold sweet name of Eve Isk Mylandra at first Runescape Money glance is all that is Aion Kina more normal ?? But if Replica Watches we look more closely ?? If so, Replica Watch check out its wings! It carries the "Eve Online Isk Sale wings courageous, even those Buy Eve Online Isk that can be earned in the Radiance of Cheap Eve Online Isk Love, as long as they do show Lotro Gold a little patience. and Maple Story Mesos we do not be Dofus Kamas afraid to make Jordan Shoes several times Aion Kinah the body.
Last Chaos Gold     |218.104.230.xxx |2009-11-16 21:14:15
294716833691754 This little Fae, Eve Online Isk who meets the Runescape Gold sweet name of Eve Isk Mylandra at first Runescape Money glance is all that is Aion Kina more normal ?? But if Replica Watches we look more closely ?? If so, Replica Watch check out its wings! It carries the "Eve Online Isk Sale wings courageous, even those Buy Eve Online Isk that can be earned in the Radiance of Cheap Eve Online Isk Love, as long as they do show Lotro Gold a little patience. and Maple Story Mesos we do not be Dofus Kamas afraid to make Jordan Shoes several times Aion Kinah the body.
GVTY   |125.70.146.xxx |2009-12-29 05:40:00
Although the industry has seen changes over the years,wow goldwemetin2 yangHalverson Constructionmetin2 goldwow gold has steadfastly adhered to the principles and values upon which Vern
Halverson founded our company. whatmetin2 yangmetin2 goldWith confidence and pride in our past,dofus kamasmetin2 yangwow gold and a on the future,metin2 yang
we are committed to enduring partnerships which  the Halverson tradition
of and trust
Anônimo   |125.70.146.xxx |2009-12-29 05:44:00
"Thursday's incident occurred amid concern over the pope's health
prompted by a Vatican decision to schedule the mass two hours early
this year instead of the traditional midnight hour due to the
pontiff's advanced age.wow cd keyaion cd keywow time cardeve time cardsaion time cardxbox 360 live pointswow eu cd keywow time cardLombardi insisted earlier that the change, a Vatican first, was only a
"sensible prcaution" for the octogenarian pontiff.The decision
was taken several weeks ago. wow us cd keybuy wow us cd keyxbox live 12 month cardxbox 360 live pointsaion eu cdkeyaion us cdkeyeve cd keyguildwars cdkeyLombardi said the change was "no cause for alarm," adding that the
German pontiff's condition was "absolutely normal" for a man
of his age.Lombardi said the move was aimed at making Christmas "a
little less tiring for the pope, who has many engagement...
wow power leveling  - hdhf     |123.145.164.xxx |2010-01-11 00:21:38
Welcome to world of warcraft power leveling buy cheap wow leveling wow gold,aoc gold service,wow cdkeys WoW Powerleveling aoc gold is our Aion gold primary last chaos gold service, last chaos gold and is on sale last chaos money love you SilkRoad Gold good wotlk SilkRoad Goldor wedding dresses
zjcjy   |125.70.58.xxx |2010-01-11 23:09:32
jobsray ban 3211he
Rayban Sunglassesjobs
rb3025she
ray ban 3025 aviatorto
ray ban aviatoragenda
ray ban 3183altered
ray ban aviator sunglassesby
wayfarer ray ban sunglassesthe
ray ban wayfarer sunglassesChristmas
tory burch shoesbombing
manolo blahnik shoesattempt
jimmy choo sandalsPresident
jimmy choo shoesBarack
christian louboutin priveObama
christian louboutin pumpspivoted
ysl shoesback
zanotti shoesto
prada messenger bagthe
Miu Miu Totedomestic
Miu Miu Bageconomy
prada hoboon
Prada ClutchFriday
Prada Handbagpromoting
Prada Totenew
Christian Louboutin ShoesU.S
Christian Louboutin Pumpsspending
christian louboutin bootsto
christian louboutin shoes redcreate
christian louboutin redtens
louboutin shoesof
christian louboutin sandalsthousands
high heel pumpsof
Love Kills Slowlyclean
Ed Hardy Skulltechnology
Ed Hardy Tiger Shirtjobs
jachefas  - replica handbags     |113.64.241.xxx |2010-01-16 03:25:43
zhjchv0116
And this wasReplica Handbags not merely aReplica Louis Vuitton dream. Because she had Replica Watcheslarge eyesreplica watches which can earn others
jachefas  - replica handbags     |113.64.241.xxx |2010-01-16 03:26:29
zhjchv0116
Replica Handbags
Replica Louis Vuitton
Replica Watches
replica watches
Wholesale Replica Handbags
Gucci handbags
Louis Vuitton handbags
replica designer handbags
Alexander Wang
Prada Handbags
Hermes handbags
Bottega Veneta Handbags
Burberry Handbags
Dior Handbags
Fianl Sales Handbags
Marni Handbags
Fendi handbags
[b]Miu Miu handbags[b]
Balenciaga handbags
Jimmy Choo,Jimmy Choo handbgs
Chloe handbags
Lancel hhandbags
Loewe handbags
Thomas Wylde handbags
Valentino handbags
Versace handbags
Replica Belts
replica Hermes Belts
pandora bracelets Thompsen  - Mr     |113.53.145.xxx |2010-01-29 05:34:34
Problema com caractere. comentário vazio
cv   |123.161.70.xxx |2010-02-08 03:34:58
christian louboutin
christian louboutin cheap
christian louboutin sale
christian louboutin discount
christian shoes
christian louboutin shoes
designer handbags
louis vuitton handbags
replica handbags
ugg classic tall
ugg classic short
ugg ultra tall boots
christian louboutin boots
MBT shoes discount
MBT shoes
ugg classic cardy boots
ugg boots
Tory Burch Shoes
Giuseppe Zanotti shoes
ugg boot
ReplicaScarf  - Replica scarf     |113.68.238.xxx |2010-02-09 06:00:06
aqian100209
Alexander McQueen
Fendi Scarf
Police Sunglasses
Chopard Sunglasses
|Replica Sunglasses|
|Replica Scarf|
Hermes Handbags
honeyreplica
hermes handbags
replica handbags
Honeyreplica
Anônimo   |125.70.58.xxx |2010-02-23 04:48:17
All of ghd us hair straighteners are ghd straighteners familiar ghd hair straighteners with ghd uk the ghd hair styler exams. Cheap GHD Maybe ghd wide straighteners some GHD pure of pink ghd you GHD Purple may tiffany jewellery feel tiffany jewelry nervous tiffany or Cheap Tiffany Jewelry may tiffany and co be UK tiffany horrible Tiffany Necklace when Tiffany Bracelet you Tiffany Earrings hear Tiffany rings that tiffany engagement rings there Oakley Sunglasses will Oakley Sunglasses Sale be Oakley Sport Sunglasses an mens oakley sunglasses examination oakley whisker tomorrow. oakley juliet sunglasses These Nfl Jerseys days, Nfl Jersey Sale I cheap nfl jerseys was mens nfl jerseys stuck charles woodson jersey in authentic nfl jerseys the authentic nfl jerseys cheap exams, discount nfl jerseys too. I football nfl jerseys have football jerseys taken nfl shop two

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."




Gostou do artigo? Então compartilhe!
Digg!Reddit!Del.icio.us!Google!Technorati!StumbleUpon!Add this social bookmarking functionality to your website! title=
Última Atualização ( 10 de janeiro de 2008 )
 

Enquete

Quando prazo é um fator limitante no desenvolvimento, qual aspecto normalmente é negligenciado?
 




Add to Technorati Favorites

Feed