‏إظهار الرسائل ذات التسميات distro_checker. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات distro_checker. إظهار كافة الرسائل

الخميس، 17 سبتمبر 2015

Cross Distribution Exploit Testing: 2da Parte.

El mes pasado publicamos el siguiente post junto con la herramienta:
http://github.com/infobyte/distro_checker

Una de las cosas que nos limitaba la primer version es que trabajabamos utilizando Docker. No todas las vulnerabilidades podían ser probadas utilizando esta herramienta ya que problemas relaciones con kernel no pueden ser explotados porque docker no es una sistema de virtualización  es en pocas palabras un chroot con esteroides.

Hicimos nuevos cambios para incorporar ademas Vagrant de esta manera podemos probar cualquier tipo de vulnerabilidades ya que seria un entorno de virtualización completo.

Ejemplo:
El siguiente comando ejecutaría el comando id dentro de las distintas VMs especificadas en el variable "distros"

./vagrant_build.py -c id

Correría ese comando en las siguientes distros

distros = [
           {'name' :'centos/7',
            'url':'https://atlas.hashicorp.com/centos/7',
            'provider':'virtualbox'},

           {'name' :'ubuntu/vivid64',
            'url':'https://atlas.hashicorp.com/ubuntu/vivid64',
            'provider':'virtualbox'},

           {'name' :'ubuntu/trusty64',
            'url':'https://atlas.hashicorp.com/ubuntu/trusty64',
            'provider':'virtualbox'},
                                    
           {'name' :'debian/jessie64',
            'url':'https://atlas.hashicorp.com/debian/jessie64',
            'provider':'virtualbox'},

           {'name' :'debian/wheezy64',
            'url':'https://atlas.hashicorp.com/debian/wheezy64',
            'provider':'virtualbox'},
          ]

Demo:
En la siguiente demo utilizamos el exploit ofs.c para la vulnerabilidad CVE-2015-1328 en distintas distribuciones de Ubuntu:

https://atlas.hashicorp.com/sincerely/trusty64
https://atlas.hashicorp.com/puphpet/ubuntu1204-x64
https://atlas.hashicorp.com/ubuntu/trusty64

Usamos otros repositorios salvo el ultimo ya que Ubuntu actualiza los últimos parches en su VM
Esta nueva version se encuentra disponible en
http://github.com/infobyte/distro_checker

Clean:
No se olviden de tener en cuenta los siguientes comandos para realizar limpieza

$ vagrant box list  #lista de vms en nuestro repositorio local
$ vagrant box remove "vmname" #elimina la vm especificada
$ vagrant destroy #elimina vm del directorio local, si por algún problema cancelamos la ejecución de vagrant_build.py recomendamos correr este comando ya que es posible que haya quedado una VM en su repositorio.

Adicionalmente esta herramienta se puede también utilizar (como estamos haciendo en nuestro caso), para hacer pruebas de cross distribution testing sobre funcionalidades, instalación, setup de Faraday en distintos ambientes.

Espero que les sea de utilidad!
Saludos

Cross Distribution Exploit Testing: 2 Part


Last month we published a post about a tool we were using:
http://github.com/infobyte/distro_checker

One of the things that limited us a bit the first time around was that we were working with Docker. Not all the vulnerabilities can be tested using the first version of the tool, because kernel's related problems can't be exploited inside Docker.

To improve upon this, we made some changes and we incorporated Vagrant, which lets us try basically any vulnerability as we already have a complete virtual environment.

Example:
In the following example, we would execute the "id" command within the different VMs, specifying the variable "distros".

./vagrant_build.py -c id

We have to run this command in the following distros:

distros = [
           {'name' :'centos/7',
            'url':'https://atlas.hashicorp.com/centos/7',
            'provider':'virtualbox'},

           {'name' :'ubuntu/vivid64',
            'url':'https://atlas.hashicorp.com/ubuntu/vivid64',
            'provider':'virtualbox'},

           {'name' :'ubuntu/trusty64',
            'url':'https://atlas.hashicorp.com/ubuntu/trusty64',
            'provider':'virtualbox'},
                                    
           {'name' :'debian/jessie64',
            'url':'https://atlas.hashicorp.com/debian/jessie64',
            'provider':'virtualbox'},
           {'name' :'debian/wheezy64',
            'url':'https://atlas.hashicorp.com/debian/wheezy64',
            'provider':'virtualbox'},
          ]

Demo:
In the following demo we will use the exploit ofs.c for the vulnerability CVE-2015-1328 in different distributions of Ubuntu:

https://atlas.hashicorp.com/sincerely/trusty64
https://atlas.hashicorp.com/puphpet/ubuntu1204-x64
https://atlas.hashicorp.com/ubuntu/trusty64

We are going to use other repositories except for the last one as Ubuntu already has the last parches in its VM.
This new version we can find in
http://github.com/infobyte/distro_checker

Clean:
After a few tests, it's important not forget the following commands so you can do cleanings:

$ vagrant box list  #list of vms in our local repository
$ vagrant box remove "vmname" #eliminates the specific vm
$ vagrant destroy #eliminates vm for the local directory, if por some reason we were to cancel the executtion of vagrant_build.py, we recommend running this command as it possible that there still is a VM in the repository.


This tool can also be used (like we did in our case) for doing cross distribution testing for functionalities, installation and for setting up Faraday in different environments

Hopefully you found this useful.
Best,