Archive for the 'Herramientas / Tools' Category

Simple python web server

Thursday, October 28th, 2010

Existe una forma rápida de compartir archivos vía web usando un simple comando de python:

python -m SimpleHTTPServer 9914

Con esto se compartirán todos los files del directorio en el que se ejecute este comando y sus subdirectorios en el puerto 9914.

Entonces es cuestión de abrir un browser en cualquier máquina que sea visible poniendo la ip y el puerto y se verán los archivos compartidos (ejemplo: http://192.168.1.1:9914)

There is a way to share files via web by entering a simple python command:

python -m SimpleHTTPServer 9914

With this, the directory where this command was executed will be shared (including the subdirectories) in the port 9914.

So, to access the file it will be a matter of open a browser with the ip and the port of the machine where the command was executed (eg.  http://192.168.1.1:9914)

Tutorial de testlink

Thursday, May 6th, 2010

El siguiente tutorial muestra rápidamente como manejar testlink. Quien hizo este tutorial, utilizó el feature de importar xmls para agregar casos, pero también los casos pueden ser creados en la herramienta.

Generate Data

Saturday, October 24th, 2009

Muchas veces necesitamos generar datos aleatorios para diferentes tests. En generatedata.com se puede encontrar una toolcita que permite generar archivos HTML, excel, XML, CSV y SQL con datos aleatorios.

Many times we need to generate random data for a test. In generatedata.com we can found a small tool that allows us to generate HTML, excel, XML , CSV and SQL files with random data.

Tutorial instalacion testlink

Sunday, June 14th, 2009

Este pequeño tutorial explica como instalar rápidamente testlink. Testlink es una aplicación web, por lo que requiere ser tener un servidor web y una base de datos para funcionar. Precisamente testlink requiere PHP y MySQL. Para no complicarnos y tener que instalar todo de cero una buena solución es la que brinda xampp, que permite fácilmente levantar el server web y mysql sin tener que complicarse. Xampp se puede obtener aca.

Tener en cuenta que esta guía permite instalar testlink rápidamente en una máquina común. O sea que la computadora donde se sigan estos pasos sería el “server” de testlink donde se conectarían los usuarios. Si algo pasa con esa computadora y no se hizo un backup de la base de datos se podría perder la info que se llenó en la herramienta.

Bien, la instalación de xampp no es complicada, es cuestión de bajarse el ejecutable y correrlo, seguir el wizard y listo. Luego esto nos instala una consola que permite ir levantando los servicios.  Sólo necesitamos levantar Apache y MySQL.

Una vez levantados esos servicios, para cambiar el password de la base de datos de MySQL abrimos un browser y vamos a http://localhost/security/xamppsecurity.php 

Necesitamos bajar testlink. Este es el site de testlink. Ir a downloads y bajarse la versión en .zip. Luego simplemente descomprimimos todo en el directorio (dir de XAMPP)\htdocs\testlink. Para iniciar la instalación de testlink en un browser ponemos http://127.0.0.1/testlink/install/index.php. Vamos a ver una pantalla como esta:

teslink instalacion 1

Seleccionamos new instalation y continuamos. Vamos a llegar a una pantalla donde nos va a preguntar el password de la BD, ahi ingresamos el que usamos para configurar cuando instalamos XAMPP:

testlink instalacion 2

Seguimos con el instalador hasta terminar. Para acceder a teslink entonces entramos : http://[la ip de la maquina donde lo instalamos]/testlink . Podemos entrar desde cualquier maquina de la red.

This small tutorial, explains how to install quickly testlink. Testlink is a web application, to run it needs a web server and a database. In fact it needs PHP and MySQL. To make things easy we are goint to use XAMMP, it will let us to run a web and database server in an easy way. You can get XAMPP in this link.

This guide is only to install testlink quickly in any computer. So that computer will be the testlink “server”where the users will connect. If something happens to that computer all the info saved there in testlink will probably lost, at least a backup is performed.

Well, the instalation of XAMPP is not complicated, is just a matter of download the executable and run it, follow the wizard. Then we can control the services provided by XAMPP from a the  XAMPP console. We will only need to have apache and mysql up.

Once the services are up, to change the MySQL password we open a browser and we enter this URL:http://localhost/security/xamppsecurity.php 

Now we need to get testlink. This is testlink site. Go to downloads and download the zip version. Then we just unzip all in the directory (XAMPP dir)\htdocs\testlink. To start the testlink installation enter the following URL in a browser:  http://127.0.0.1/testlink/install/index.php. We are going to see a screen like this:

teslink instalacion 1

Then we choose new instalation to continue. We are going to get another windows where we have to enter the password of the DB, there we just enter the password that we entered when installing XAMPP:

testlink instalacion 2

The next is just follow the installer. Once it finishes, to enter testlink we enter:  http://[the ip of the computer where we installed all]/testlink . We can access to teslink from any computer in the same network or with access to that network.

Testlink

Sunday, January 11th, 2009

 Testlink logo

Testlink es una herramienta para la administración de casos de prueba. Es gratuita y se puede bajar en este link www.testlink.org . En mi empresa la venimos usando hace tiempo con muy buenos resultados. Tal vez la instalación sea complicada, es una aplicación web hecha en php por lo cual se requiere tener una máquina con php+mysql como server y los usuarios accederán a testlink a través de un browser. Esta herramienta nos ofrece:

  • Soporte para diferentes productos
  • Creación de diferentes roles con distintos permisos para los integrantes del equipo de testing
  • Creación ilimitada de carpetas en forma de arbol (llamadas testsuites) para una mejor organización y agrupamiento de los casos de prueba
  • Versionado de casos de prueba
  • Ejecución de los casos de prueba por versión del software bajo prueba
  • Creación de testplans para la ejecución
  • Asignación de casos (para ejecución) a los usuario. De modo que en un mismo test plan podemos tener varios testers trabajando y ellos sólo ven sus casos de prueba asignados
  • Soporte para linkear casos con requerimientos/especificaciones
  • Generación de distintos tipos de reportes: generales del producto, por testplan, gráficos, queries específicas, etc…
  • Posibilidad de mandar los reportes por mail al tester

Testlink is a tool for testcases administration. It is free and it can be downloaded from www.testlink.org. We’ve been using it in my company for a while and it is great. Perhaps the installation could be complex, it is a web app made in php, so it is required to use a computer with php+mysql installed as a server and the users will access to testlink via a web browser. This tool has the following features:

  • Support for different products
  • Creation of roles with different permissions for the members of the testing team
  • Unlimited creation of folders in a tree (called testsuits) to group and organize testcases
  • Testcase versioning
  • The execution of the testcases is following the version of the software under test
  • Creation of testplans for execution
  • Testcase assign to the users for their execution. So many users can share the same testplan and execute only the testcases assigned.
  • It allows to link testcases with requirements/specification
  • Report generation: general product status, by testplan, charts, specific queries, etc…
  • It allows the user to send the report by email

Honeyd II

Tuesday, November 11th, 2008

 honeyd logo

En el primer post de honey expliqué como configurarlo y correrlo. En este me dedicaré a explicar las partes del archivo de configuración de modo que se puedan crear redes simples pero bien simuladas. Se pueden crear muchos escenarios complejos con esta herramienta, incluyendo el uso de rutas y diferentes tipos de dispositivos de red. Básicamente la estructura de un archivo de configuración de honeyd consiste en:

1. Personality (debe coincidir con el nombre exacto de un fingerprint del archivo de nmap (base de fingerprints usado para correr honeyd).

2. Puertos TCP y UDP

3. Acción por defecto de los puertos (default action, en el caso de que el puerto no sea especificado no debería responder)

4. Binds, para asignar la ip específica a una personalidad determinada.

Este es un archivo de configuración de ejemplo:

 

create template
set template personality "AIX 4.0 - 4.2"
add template tcp port 80 "sh scripts/web.sh"
add template tcp port 22 LISTEN
add template tcp port 23 proxy 192.168.110.10:23
add template udp port 100 LISTEN
set template default tcp action reset
set template default udp action reset

create template2
set template personality "Linux 2.2.14"
add template tcp port 80 LISTEN
add template tcp port 21 LISTEN
add template tcp port 22 proxy 192.168.110.5:22
add template udp port
set template2 default tcp action reset
set template2 default udp action reset

bind 10.0.0.1 template
bind 10.0.0.12 template2

bind 10.0.0.32 template

1. Personality: Los nombres template y template2 son simplemente etiquetas para nuestras personalidades. Como escribí anteriormente es importante asegurarse de que el nombre de la personalidad coincida con algún nombre exacto de un fingerprint en el archivo de fingerprints usado al correr honeyd.

2. Puertos TCP y UDP: Esto es muy importante para hacer la red mas realística. Hay varias formas de simular puertos:

a. Especificando el estado (ej: LISTEN o FILTERED)

b. Usando scripts (ej: sh scripts/web.sh, este script simula un web server) Pueden encontrarse algunos scripts en la página de honedy (www.honeyd.org) que pueden utilizarse para simular diferentes servicios.

c. Proxiando el puerto a una máquina física (ej: proxy 192.168.110.5:22). En este caso si nos conectamos al puerto en la red simulada en realidad nos estaríamos conectando al puerto de la máquina especificada luego de la palabra proxy.

3. Default action al puerto: Especificando esto nos aseguramos que ningún puerto que no se especifique en la lista no responda. Es necesario poner el comportamiento esperado por defecto como en el ejemplo.

4. Bindings: Con esto tenemos la posibilidad de asignar las ip a las diferentes personalidades usando la misma personalidad en diferentes ips.

También es posible reducir las comunicaciones a uno o muchos puertos usando la opción ‘tarpit’ para hacerlo más realista:

ej: add template tcp port 25 tarpit LISTEN

It is possible to create several complex scenarios with this tool, including the use of routers and many kind of devices. Basically the structure of the configuration file consist in:

1. Personality (it should match with the name of any available fingerprint in a nmap configuration file used to run honeyd).

2. TCP and UDP ports

3. Default action for the ports (in case that the port wasn’t specified, it should not respond)

4. Bindings to the specific ip addresses of our simulated network

This is an example configuration file:

 

create template
set template personality "AIX 4.0 - 4.2"
add template tcp port 80 "sh scripts/web.sh"
add template tcp port 22 LISTEN
add template tcp port 23 proxy 192.168.110.10:23
add template udp port 100 LISTEN
set template default tcp action reset
set template default udp action reset

create template2
set template personality "Linux 2.2.14"
add template tcp port 80 LISTEN
add template tcp port 21 LISTEN
add template tcp port 22 proxy 192.168.110.5:22
add template udp port
set template2 default tcp action reset
set template2 default udp action reset

bind 10.0.0.1 template
bind 10.0.0.12 template2

bind 10.0.0.32 template

1. Personality: The names template and template2 are just labels for our personalities. As I wrote before it is important to make sure that the name of the personality matches with any available name in the nmap fingerprints file used to run honeyd.

2. TCP and UDP ports: This is very important to make this more realistic. There are many ways to simulate ports:

a. Specifying the state (e.g. LISTEN or FILTERED).

b. Using scripts (e.g. sh scripts/web.sh, this script simulates a web server.) Some scripts can be found in the honeyd page (www.honeyd.org) that can be used to simulate many services.

c. By proxying the port to a physical box (e.g. proxy 192.168.110.5:22). In this case if we connect to the port in the simulated network we will be actually connecting to the computer specified after the word proxy.
3. Default action to the port: By specifying this we make sure that the ports not entered in the list will not respond. It is necessary only to put the default action like in the example.
4. Bindings: The great thing of this is that we can reuse the personalities many times in different ips in our simulated network. For example, we can have template and template2 and have many hosts as we can in the whole network, many of them will be the same but we can reuse them.

It is also possible to slow down communications in any or all ports by using the ‘tarpit’ option:
e.g: add template tcp port 25 tarpit LISTEN

Python Testing Tools!

Monday, May 19th, 2008

En este wiki: http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy hay un montón de herramientas hechas en python para testing. Para ver más sobre python y bajarselo pueden visitar: http://www.python.org/

In this wiki http://pycheesecake.org/wiki/PythonTestingToolsTaxonomy you’ll find a bunch of testing tools in python. To learn more about python you can visit: http://www.python.org/

Sendkeys

Friday, January 25th, 2008

Sendkeys es una librería para python que nos permite automatizar pruebas de GUI. Como dice el nombre consiste en enviar teclas, o sea que uno puede armar scripts con las diferentes teclas que se deben presionar para hacer una tarea determinada en nuestro soft a probar.

Instalarlo es sencillo, hay que bajarse un .exe y asegurarse de tener python instalado (soporta desde la version 2.1 hasta la 2.5). En el link que les paso a continuación pueden bajárselo y encontrar un mini manual con ejemplos:

http://www.rutherfurd.net/python/sendkeys/

SendKeys is a library in python that can be used to automatize GUI testing. As you can see for the name of it, it consist in send keys so with this we can create scripts by telling the soft under test what keys should be pressed.

Installation is simple, you have to download a .exe file and make sure that you have python installed on you computer (it supports version 2.1 to 2.5). You can download it from this link, there you can also find a quick tutorial to use this library:

http://www.rutherfurd.net/python/sendkeys/

Honeyd

Monday, January 14th, 2008

 honeyd logo

Honeyd es un honeypot. Un honeypot simula redes con hosts activos con puertos y servicios abiertos, entonces se tienen redes simuladas levantadas para atraer atacantes a dichas redes. Ustedes se preguntaran: ¿Para qué nos sirve un honeypot a un tester?. A mi en particular me fue muy útil para tener una red estática y probar la parte del descubrimiento de redes de un software de penetration testing. Además se pueden diseñar diferentes tipos de redes con la cantidad de hosts que queramos, los os que queramos y los puertos TCP y UDP abiertos que queramos. En esta primer parte les voy a enseñar como configurar el honeyd.
Sé que existe una versión de honeyd para windows pero siempre usé para linux. La primera vez que comencé con esto lo instalé en un slackware pero en ubuntu es realmente simple.
Para instalar el honeyd en ubuntu basta sólo con correr el siguiente comando:

sudo apt-get install honeyd

Yo por lo general tengo un ubuntu server corriendo en un vmware en la misma máquina de pruebas y el software a probar en la misma máquina física o en otro vmware en esa máquina. Esto nos da la ventaja de tener una red local entre la máquina con el ubuntu que corre el honeyd y el soft que corre el software a probar sin ningún tipo de interferencia que tiene una red cableada.

Para usar honeyd es necesario tener un archivo de fingerprints, yo utilizo el de nmap que es el más completo, si se tiene instalado nmap se puede utilizar ese que es nmap-os-fingerprints y se encuentra en /usr/share/nmap (si no se tiene instalado nmap, en ubuntu se puede instalar corriendo sudo apt-get install nmap).

En el ejemplo vamos a simular una red 10.0.0.0/24 con algunos hosts en este archivo honeyd

La máquina que tiene honeyd nos servirá de “gateway” a la red simulada.

Luego copiamos el archivo de fingerprints de nmap y el de configuracion de honeyd a un mismo directorio, nos hubicamos en el mismo y levantamos honeyd en la maquina con:

honeyd -p nmap-os-fingerprints -f red66.conf -i [interfaz] 10.0.0.0/24

Finalmente para llegar a esta red desde la máquina donde tenemos el software a probar, que necesita usar la red de pruebas, debemos agregar la siguiente ruta (en dicha máquina claro está): route add 10.0.0.0 mask 255.255.255.0 [ip de la maquina que corre honeyd]

Para probar que funciona se podemos hacer ping a la dir 10.0.0.2:  “ping 10.0.0.2″ desde la máquina donde se ingresó la ruta estática.
En la parte dos se explicará detalladamente las partes del archivo de configuración de honeyd para que puedan variar un poco con las configuraciones y crear diferentes ambientes.

Honeyd is a honeypot . A honeypot simulates networks with active hosts, their respective services and ports opened (or in whatever state that we want) so with it it is possible to have simulated network to attract the attacker to that fake networks. You now probably wondering : What doest it have to do with testing?. In my situation it was very usefull to have a static network so I could test the network discovery module of a penetration testing tool. With this it is also possible to design different kind of networks with the quantity of hosts that we want, TCP ports and UDP ports. In this first article I will teach you how to set up a honeyd in an Ubuntu box.

I know that a windows honeyd version is available but I always used this on a linux machine. The first time I installed it on a Slackware but with Ubuntu is really simple.

To install honeyd in ubuntu you can do it from the repository, so you only need to write in your console:

sudo apt-get install honeyd

I always have an Ubuntu in my test computer (in a vmware) and the software under test installed on a physical machine in this same box on in another vmware in the same machine that I have Ubuntu running. Having a vmware enviroment in the same machine give us the advantage of having a virtual local network between the software to test and the honeyd, this is great because we are not going to have the interference that is ussually found in a wired network.
To use honeyd it is necessary to have a fingerprints file, I use the nmpa fingerprint file because it is the most complete. If you have nmap installed you can use that, which is located in /usr/share/nmap (if you don’t have nmap installed you can install with this simple command: “sudo apt-get install nmap).

In the example we will simulate a network 10.0.0.0/24 (class C) with some hosts, this is the honeyd file.The honeyd computer will be the “gateway” to the simulated network.

Then we copy the nmap fingerprints file and the honeyd configuration file to a same directory, we go to that directory and we start honey with this command:

honeyd -p nmap-os-fingerprints -f red66.conf -i [interfaz] 10.0.0.0/24

Finally to get to that simulated network from the computer where we have the software under test we should add the following network:

route add 10.0.0.0 mask 255.255.255.0 [ip de la maquina que corre honeyd]

To test the network we can do a ping to the dir 10.0.0.2 which is a host in the fake network : “ping 10.0.0.2″.

In the next article about honeyd I will explain the parts of a honeyd config file so you can play with the different configurations and create many network enviroments.