Cyber Warriors Factories

[Español] Hoy en día muchas naciones conscientes de las amenazas en Internet están creando ciber guerreros para poder combatir en este nuevo frente. Aunque la información es escasa algunas de estas naciones han hecho público parte de su plan de ciberguerra y han creado centros de entrenamientos y operaciones. También algunas empresas privadas y universidades ya empiezan a ofrecer este nuevo perfil del siglo XXI, aunque está claro que aún queda un largo camino por recorrer.

[English] Today many nations aware of threats on the Internet are creating Cyber Warriors in order to fight on this new front line. Although information is scarce some of these nations have made public part of their cyber warfare plans and are creating training and operations centers. Also some private companies and universities are beginning to offer this new role of the 21st century although clearly there is still a long way to go.

En este artículo estudiaremos algunas naciones que ofrecen la posibilidad de formarse y/o trabajar como ciber guerrero (Computer Network Operations, CNO), aunque debemos tener en cuenta que al ser un tema sensible generalmente requiere ser ciudadano de ese país para acceder a esta formación y/o trabajo.

In this article we will study some nations offering the possibility of education and/or working as a Cyber Warrior (Computer Network Operations, CNO), although we must bear in mind that due to the sensitive subject it is generally required being a citizen of that country to access this training and/or work.

EE.UU. / USA

Como no podía ser de otra manera EE.UU. dispone de diferentes opciones pero requieren ser ciudadano estadounidense.

As it could not be otherwise USA offers different options, but you need to be a U.S. citizen.

Sector público / Public Sector

Existen más opciones de las aquí presentadas pero hemos intentado resaltar las más significativas.

There are more options of the presented here but we have tried to highlight the most significant.

Sector Privado / Private Sector

El sector privado en USA ha creado una amplia oferta de formación y puestos de trabajo creados por empresas dedicadas a defensa.

The private sector in USA has created a wide range of training and jobs mostly created by companies involved in defense.

Corea del Sur / South Korea

Reino Unido/ UK

 España / Spain

OTAN / NATO

  • La OTAN desde su centro de NATO Cooperative Cyber Defence Centre of Excelence (CCDCOE) ofrece diversos cursos en CNO.
  • NATO from its NATO Cooperative Cyber Defense Centre of Excellence (CCDCOE) offers various courses in CNO.

Países como China, Israel, Francia, Rusia, Alemania, Brasil, India e Irán han anunciado públicamente la creación de unidades de ciberguerra y de centros de entrenamientos militares y/o académicos aunque no existe demasiada información pública al respecto.

Podemos apreciar que hoy en día existe una conciencia por crear estos perfiles en muchas naciones y que algunos países destacan en este campo como son los EE.UU., China o Israel. Sin duda los países que quieran sentirse “ciber seguros” tendrán que hacer grandes esfuerzos.

Si conoces más formación en ciberguerra / CNO o empresas en este campo, por favor envíame un correo con la información :)

¿Te gustaría ser un ciber guerrero o lo has sido? Cuéntanos tu experiencia! 

Countries such as China, Israel, France, Russia, Germany, Brazil, India and Iran have publicly announced the creation of cyber warfare units and training facilities both in the army and/or universities although there is not much public information about it.

We can see that today there is an awareness to create these roles in many nations and some countries stand out in this field such as the United States, China or Israel. Certainly the countries which want to feel “cyber safe” will have to make great efforts.

If you know more training courses in Cyber Warfare / CNO or companies in this area, please send me an email with the information :)

Would you like to be a Cyber Warrior or you’ve been one? Tell us your experience!

— Simon Roses Femerling

Posted in Hacking, Pentest, Security | Tagged , , , , , | Leave a comment

APT Article Published

[Español] Este mes la revista Red Seguridad incluye mi artículo sobre APT (Amenazas Persistentes Avanzadas) basado en mi experiencia personal en el trabajo donde hemos encontrado varias veces este tipo de amenazas.

[English] This month the magazine Red Seguridad includes my article about APT (Advanced persistent threats) based on my personal experience at work where we frequently discover this type of threat.

Sin duda los APT son un tema caliente y en el artículo detallo en qué consisten, casos reales de ataques, por qué se producen y son tan exitosos, así como algunas recomendaciones de cómo las empresas deberían protegerse.

No doubt APT are a hot topic and the article details what they are, cases studies of real attacks, why they occur and why they are so successful as well as some recommendations on how companies should protect themselves.

Por desgracia el artículo solo está en español pero si algún lector extranjero está interesado se lo puedo enviar para que lo traduzca con Bing :)

Unfortunately the article is only in Spanish but if a foreign reader is interested I can send a copy so he can translate it with Bing :)

No os perdáis otros artículos que escribo de forma frecuente en revistas de seguridad y mis servicios, que quizás sean de tu interés ;)

Como siempre un placer y ahora a seguir analizando la inseguridad…

Do not miss other articles that I usually write in security magazines and my services, which may be of interest to you ;)

My pleasure, as usual, and now on to keeping analyzing insecurity…

— Simon Roses Femerling

Posted in Hacking, Pentest, Security | Tagged , , , , , | Leave a comment

AppSec: Static Analysis Using Visual Studio 2010 for Hunting C/C++ Bugs

[Español] Para este artículo hablaremos de una magnífica herramienta como es Visual Studio 2010, el entorno de desarrollo de Microsoft, que utilizo a diario para realizar auditorías de código en C/C++ o .NET. Cuando imparto clases sobre SDL es frecuente encontrar programadores que no conocen las herramientas de seguridad que ofrece Visual Studio, incluso me sucede con expertos en seguridad que tampoco las conocen y esto debe cambiar.

[English] For this article we’ll talk about a magnificent tool such as Visual Studio 2010, Microsoft development environment, which I use on a daily basis to conduct code audits of C/C++ or.NET. When I teach the SDL courses it is common to find developers who do not know the security tools offered by Visual Studio, this even happens with security experts who do not know them either, and this must change.

Como ya he mencionado Visual Studio trae interesantes herramientas para escribir código seguro como programador o para buscar vulnerabilidades como auditor. Para ello estudiaremos dos herramientas que son identificación de funciones inseguras y análisis estático de código inseguro.

As I have already mentioned Visual Studio brings interesting tools to write secure code as a programmer or to look for vulnerabilities as auditor. To do this we will look at two tools that are unsafe functions identification and static analysis of insecure code.

Identificación de Funciones Inseguras / Unsafe Functions Identification

A estas alturas debería ser ampliamente conocido que las librerías de C contienen una serie de funciones consideradas inseguras que son la raíz de muchos avisos de seguridad. Microsoft consciente de ello en el 2010 publicó una extensión para Visual Studio para identificar estas funciones inseguras, además de prohibir su uso según el SDL.

At this stage should be widely known that C libraries contain a number of functions that are considered insecure and are the root of many security advisories. Aware of this at 2010 Microsoft released an extension for Visual Studio to identify these unsafe functions, as well as banning its use according to the SDL.

En la Fig. 1 podemos ver un código a modo de ejemplo que contiene dos funciones inseguras como son sprintf y strcpy. Nota: en este ejemplo ambas funciones no pueden ser controladas por un atacante pero lo que nos interesa es identificar estas funciones inseguras.

In Fig. 1 we can see a code example that contains two unsafe functions such as sprintf and strcpy. Note: in this example both functions cannot be controlled by an attacker, but what interests us is to identify these unsafe functions.

Fig. 1 – Ejemplo de funciones inseguras / Insecure function example

En la Fig. 2 Visual Studio, con la extensión de funciones insegura instalada, nos subraya la función sprintf en color violeta indicándonos algún problema. Al poner el cursor encima vemos que nos sale una ventana con el mensaje que esta función es insegura y prohibida según el SDL y nos ofrece alternativas seguras. Igualmente si nos ponemos encima de strcpy nos dará un mensaje parecido.

In Fig. 2 Visual Studio, with the insecure functions extension installed, point us at function sprintf in purple indicating a problem. When putting the cursor above we see that we get a window with the message that this function is unsafe and banned according to the SDL and offers safe alternatives. Also if we are on top of strcpy it will give us a similar message.

Fig. 2 – Función Insegura sprintf / Sprintf insecure function

Digamos que compilamos el código porque no hemos visto las funciones inseguras, entonces Visual Studio nos dará un aviso de error en la compilación de que existen funciones inseguras como se puede apreciar en la Fig. 3.

Let’s say that we compile the code because we have not seen the insecure functions, then Visual Studio will give us a warning notice in the compilation that there are unsafe functions as shown in Fig. 3.

Fig. 3 – Función insegura identificada al compilar el código / Unsafe function identified at compilation time

Sin duda esta extensión es de gran ayuda para identificar rápidamente las funciones inseguras que son más de 100 cuando estamos auditando código.  

No doubt this extension is of great help to quickly identify unsafe functions as there are more than 100 when we are auditing code.

Análisis Estático de Código Inseguro / Static Analysis of Insecure Code

Visual Studio incorpora una potente herramienta de análisis estático para identificar código vulnerable en C/C++ que todo programador debería utilizar para validar su código. Algunas clases de errores que detecta la herramienta son:

  • Desbordamiento de buffer
  • Memoria sin inicializar
  • Referencia a puntero nulo

En la Fig. 4 tenemos un código modificado del ejemplo anterior conteniendo una clásica vulnerabilidad. En este fallo se copia una cadena de carácter A en un buffer, buf, de menor tamaño que provoca un desbordamiento de buffer (buffer overrun).

Visual Studio includes a powerful static analysis tool to identify vulnerabilities in code for C/ C++ that every programmer should use to validate its code. Some bug classes detected by the tool are:

  • Buffer overflow / Buffer overrrun
  • Un-initialized memory
  • Null pointer dereference

In Fig. 4 we have a modified code from previous example containing a classical vulnerability. In this bug a string, A, is being copied to a buffer, buf, of smaller size causing a buffer overflow.

Fig. 4 – Desbordamiento de buffer / Buffer overflow

Utilizamos la potente herramienta de análisis estático para buscar vulnerabilidades que ejecutamos desde la línea de comando con el parámetro /analyze. En la Fig.5 podemos ver cómo se nos informa de dos errores, C6202 y C6386, en referencia al desbordamiento de buffer.

We use the powerful static analysis tool to find vulnerabilities which we run from the command line with the parameter /analyze. In Fig. 5 we can see how it informs us of two warnings, C6202 and C6386, in reference to the buffer overflow.

Fig. 5 – Utilizando VS /analyze para identificar vulnerabilidades / Using VS /analyze to identify vulnerabilities

En la Fig. 6 podemos apreciar otra clase de vulnerabilidades que aparece con frecuencia cuando se libera memoria del mismo puntero en varias ocasiones. En este ejemplo si foo es verdadero se ejecuta un trozo de código y al final se libera el puntero. El problema es que al final de la función también se libera el mismo puntero. Tenemos dos mensajes de aviso C6001 y C6011 en referencia a uso de memoria sin inicializar y referencia a  puntero nulo.

In Fig. 6 we can appreciate another class of vulnerabilities that often appears when memory is being freed on the same pointer on several occasions. In this example if foo is true it runs a piece of code and finally releases, free, the pointer. The problem is that the same pointer is also being released, free, at the end of the function. We have two warnings C6001 and C6011 messages in reference to un-initialized memory and null pointer dereference.

Fig. 6 – Referencia a puntero nulo / Null pointer dereference

El último ejemplo de código vulnerable (Fig. 7) es un fallo donde el programador se ha equivocado en la sentencia For ya que el rango de la variable buff comienza en 0 y termina en 14 y en el For se ha utilizado el mismo índice, 15 en este caso. Por tanto en este ejemplo se produce un desbordamiento de buffer ya que el índice esta fuera de rango.  

The last example of vulnerable code, Fig. 7, is a bug where the programmer has mistaken the For loop as the variable buff range starts at 0 and ends at 14 and the For loop uses the same index declared in buff, 15 in this case. In this example there is a buffer overflow due to the declared index being out of range.

Fig. 7 – Índice fuera de rango / Index out of range

Sin duda Visual Studio es una poderosa herramienta para auditar código que debería formar parte de nuestro arsenal. Los ejemplos presentados no distan demasiado de ejemplos reales que he visto auditando código, por desgracia muchas veces la realidad supera a la ficción.

La herramienta de análisis estático es más efectiva si la combinamos con el Standard Annotation Language (SAL), que nos permite definir los parámetros de las funciones por lo que aportamos conocimiento a la herramienta y puede profundizar en sus análisis para identificar fallos, pero este uso avanzado lo dejaremos para otro artículo :)

¿Y tú que herramientas utilizas para análisis estático?

Undoubtedly Visual Studio is a powerful tool to audit code that should be part of our arsenal. The presented examples are not too far from real examples I’ve seen auditing code, unfortunately often fact is stranger than fiction.

The static analysis tool is most effective if we combine it with the Standard Annotation Language (SAL) that allows us to define the functions prototypes for which you provide knowledge to the tool so it can go deeper with the analysis to uncover bugs, but I leave this advanced usage for another article :)

What tools do you use for static analysis?

— Simon Roses Femerling

Posted in Microsoft, Pentest, SDL, Security, Threat Modeling | Tagged , , , , , , , , | 1 Comment