Today is Thursday, 9th September 2010

Archive for the ‘Uncategorized’ Category


Secure analysis alternative of .exe binaries

Today, I’ll explain in short three alternatives for analysing binary files.

When we had suspected about binary file, we’ve had two options:

- First one and not recomendable, running and thinking that it only get “infected” the others ;)

- Second one, to have a Windows system virtualized, run it there while we monitorize it with tools as Filemon, Regmon, wireshark…

Recently, I’ve found one quickly way, and it could help us in some cases.

We can analyse files with several antivirus engines at the same time with Virustotal, it will give us a orientation about file types that you use. This web is a Hispasec Systems creation, very good reference from my point of view.

With Joebox, we’ll have a sandbox installed, we can run the executable in a secure virtual environment. It’ll give us traces with information about the behavior. This virtual environment is easy to deploy and with same security guarantees that a virtual machine with independent operating system.

Anubis online service will analyse the binary file, and it will send us a report about its behavior. A good complement to any sandbox, it’ll allow us to contrast the information.



OpenTTD – What a good memories!

I’d like to write about this game because I think it is one the best game of management of gaming history ;) . You can become a tycoon!!

OpenTTD was born as copy of Transport Tycoon Deluxe. A group of people was been able to get the sources with reverse engineering, wow!

Later, the project was growing with the colaboration of more people: new sounds, new music, a lot of new graphs [stations, buses, trucks, roads, buildings, aka. NewGRF], but the best of all are the three available plataforms: GNU/Linux, Mac and Windows. A new multiplayer mode: competitive and collaborative; with or without dedicated server, with own commands. AI ready to go in single player and multiplayer, and a lot of people belonging to the OpenTTD Community.

Don’t think it more, info and download at: www.openttd.org



Tips AdminLinux: Bye to .old .bkp .date files

Today I tried to remember the good practice that performed when modifying configuration files, and how often does. I think we’ve all seen the type files with suffixes .old, .orig, .bkp,  .someDate to serve as a pseudo-backup important configuration file.

I will not come to assess whether this method is good or bad, because we should evaluate other factors such as whether the machine is managed by various admins, if a critical server, if it really is documented that nomenclature, etc …

But if I want to mention, and give an example of a methodology that if it is standard, and there is a very high probability of finding it in almost any GNU / Linux: RCS utils.With this system, we have a version control with all its benefits applied to a single file without creating or configure anything extra (or repositories, or demons, or service units), only installing the required package rcs. It is rare that is not installed.

This information has been obtained from RCS Intro – http://www.daemon-systems.org/man/rcsintro.1.html

What operations are usually performed more frequently in a version control system?

  • Create new files
  • Modify existing file
  • Locked to prevent concurrent modifications
  • Control versions and add comments to see at a glance this Changelog
  • Test differences between versions
  • Retrieve all versions
  • Control who and when to file an amendment during their life

Based on this short list, put the two commands that allow you to perform them:

co and ci

Read on to see examples …



Shell script: expect o autoexpect, esa es la cuestión

Bien es sabido por muchos de las virtudes de la herramienta expect para desarrollar shell scripts automatizados a través del método:

1.) stdin
2.) ¿qué stdout/stderr espero?
3.) stdin
4.) ¿qué stdout/stderr espero?
…..

Por ser breve, es un lenguaje pensado casi exclusivamente para convertir sesiones interactivas de ftp, telnet, ssh, etc… en sesiones automáticas. Casi más sorprendente, es que añadiendo el módulo TK, podremos automatizar sesiones de X11, wow!!!!

Pero este artículo no quiere ser un tutorial de expect, ni tampoco una presentación formal, su web es bastante buena para intentar hacer una copia ;) . Pretendo enseñar, y en otros casos recordar, que no es necesario saber nada, o casi nada de expect para poder utilizarlo, gracias a autoexpect.

Este script nos abrirá una sesión de comando “script”, y grabará toda la sesión interactiva. Una vez que salgamos de la sesión con “exit”, creará un script de expect que podremos ejecutar directamente. wow!!!!

Cosas a tener en cuenta:

- Cualquier salida por pantalla variable, tipo fecha, hora, y cosas así, nos obligará a editar el script expect final, y poner expresiones regulares. Genial!
- Seguro que hay más, espero esos comentarios ;)

En la siguiente página incluyo el código del autoexpect, no como referencia, sino como idea general. La recomendación que os hago es visitar la web oficial de expect, descargar las últimas fuentes de expect, descomprimir, y buscar en el directorio example/ el script autoexpect. En la versión que he descargado yo, he tenido que modificarlo para poner la ruta absoluta de expect en la primera línea:



Script: consulta de saldo de tarjeta restaurant v.2.0

Debido a algunos cambios que han realizado en la web de Ticket Restaurant, he tenido que modificar el script original para adaptarlo. Recordad el artículo anterior con el script y la explicación. Resumen de modificaciones que han realizado:

- Todas las urls ahora tienen como base www.ticketrestaurantcard.es

- Se ha incluído un nuevo campo en el envío del POST: swlang

Como véis, son cambios normales y poco entrenidos; estaba deseando que me obligaran a cambiar la expresión regular, lástima!

¿Será un buen día para empezar con el laboratorio de expresiones regulares?

http://www.tux-es.com/project1/2009/11/script-consulta-de-saldo-de-tarjeta-restaurant/

Como siempre, si alguien tiene alguna pregunta sobre el script, os invito a comentarlo.

#!/bin/bash

export AGENT="Mozilla/5.0 (X11; U; Linux i686; es-ES; rv:1.8) Gecko/20051111 Firefox/1.5"

export LOGINURL="https://www.ticketrestaurantcard.es/TRC/index.html"
export POSTLOGIN="https://www.ticketrestaurantcard.es/TRC/checkUserLogin.php"
export POSTDATA="swlang=es&user=usuario&passwd=password&type=trc"

curl -s -A '${AGENT}' -d "${POSTDATA}" -c ticketrestaurant.cookie -o login1.out -e ${LOGINURL} ${POSTLOGIN}
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login2.out -e ${POSTLOGIN} https://www.ticketrestaurantcard.es/TRC/home.html
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login3.out -e https://www.ticketrestaurantcard.es/TRC/home.html https://www.ticketrestaurantcard.es/TRC/consulta_tarjeta.html
curl -s -A '${AGENT}' -b ticketrestaurant.cookie -o login4.out -e https://www.ticketrestaurantcard.es/TRC/consulta_tarjeta.html https://www.ticketrestaurantcard.es/TRC/logout.html
SALDO=`cat login3.out | sed -n '/SALDO/p' | sed 's/.* \([0-9]*,[0-9]*\) .*/\1/g'`
clear
MAIL_BODY=`echo "Su saldo Sr. Señor: ${SALDO} euros" > /tmp/mail.body`
mail email@domain.com -s "Saldo Tarjeta Restaurant: ${SALDO} euros" < /dev/null


Tabla Subnetting

Simplemente me parecía interesante.

Fuente original: http://www.iniqua.com/2010/02/01/subnetting-de-cabeza-en-un-segundo/

Tabla de Subnetting



Breve opinión acerca de Software Libre, no Software Gratis

En mis años de experiencia trabajando con Software Libre, me he encontrado con muchas situaciones en las que personas con cierto criterio, no saben distinguir el matiz de free software, y no se molestan en entenderlo. Empleando su mal uso en circunstancias donde técnicamente hay que ser muy correcto.

Por ser un poco sarcástico y práctico con el ejemplo, siempre digo que hay personas que piensan que el software libre es aquel que te bajas de las redes P2P con el keygen incluído ;) .

Si acudimos a las definiciones de free en Wordreference, comprobamos que casi todas ellas están explicadas en un contexto. Puede significar gratis, libre, etc…pero de Free Software como concepto, siempre ha sido entendido como Software Libre. De hecho si nos remontamos al pasado, linux como kernel, GNU como proyecto, y FSF como fundación, veremos que Linux fue incluído en el proyecto GNU, y acogido como software por la FSF.org, se creó la licencia GPL.

Siempre intento explicar, de forma más breve ;) , todo estos conceptos a las personas que confunden software libre con gratuito, incluso a aquellos que destacan por encima de todo que es gratis, cuando debieran primar otras virtudes antes que  esta. Hoy me he encontrado otro ejemplo, leyendo Barrapunto, un artículo donde se comentaba la entrevista de la Directora de Microsoft España, María Garaña, en RNE1. En una de las partes dijo:

“Si lo del Software Libre se entiende como Software Gratuito, creo que en Microsoft y en otras compañías, se ofrece software que se puede utilizar de manera gratuita”

Es un ejemplo más que añado a mi experiencia.



¿alguna vez tu madre te escribió algo así?

CARTA DE UNA MADRE A SU HIJO INFORMATICO

Querido hijo:A la vista está que desde que comenzaste tus estudios de Informática, tu nivel de comunicabilidad con el resto de tu familia ha ido en receso, al igual que tu capacidad para mantener un mínimo orden en tu mesa de trabajo y resto de tu habitación. Es por ello que he decidido tomar cartas en el asunto y ponértelo de manifiesto en los mismos términos que empleas a diario para dirigirte a nosotros, tu familia:

sigue leyendo …



VMware Server 2.x – CLI

Hoy escribiré sobre el modo línea de comandos de VMware Server 2.x.

Antecedentes: en las versiones anteriores de VMware Server 1.x, existía una consola standalone con la que gestionábamos todas las VM’s. En esta nueva versión, 2.x, todo se realiza a través de web.
Para las operaciones automatizadas, de backup, parada y arranque, etc… antes se utilizaba la herramienta vmware-cmd, pero ya no contamos con ella.

De la mano de VMware Server 2.x nace:

# vmrun

Esta herramienta es la que nos permitirá realizar operaciones automatizadas con nuestras máquinas virtuales. Una vez más, recordar que es necesario tener las vmware tools instaladas en las máquinas virtuales, para sacar todo el provecho a vmrun.

Seguid leyendo para encontrar más información.



grep para entornos windows ^^

Cual ha sido mi sorpresa hoy, leyendo un artículo sobre implementación de Bacula Client en entornos Windows, encontré el siguiente comando:

findstr

Leyendo más sobre él, puedo concluir que tiene la apariencia de grep, que ni hablo del sed ;) , pero con menos potencia:

findstr [/b] [/e] [/l] [/r] [/s] [/i] [/x] [/v] [/n] [/m] [/o] [/p] [/offline] [/g:file] [/f:file] [/c:string] [/d:dirlist] [/a:ColorAttribute] [strings] [[Drive:][Path] FileName [...]]

Ey!, que nos deja poner algunas expresiones regulares:

.

Wildcard: any character

*

Repeat: zero or more occurrences of previous character or class

^

Line position: beginning of line

$

Line position: end of line

[class]

Character class: any one character in set

[^class]

Inverse class: any one character not in set

[x-y]

Range: any characters within the specified range

\x

Escape: literal use of metacharacter x

\<xyz

Word position: beginning of word

xyz\>

Word position: end of word

Referencias – http://www.microsoft.com/




Top