El libre pensamiento para un internet libre
No estas registrado.
He puesto este tema aquí pero vale para encontrar todo tipo de brechas.
Como somos un foro Wifi ; la llave WPA es un poco la cereza en el pastel.
Binwalk es otro código libre python del maestro Craig Heffner que podemos encontrar en sus repositorios Git Hub:
Binwalk is a fast, easy to use tool for analyzing, reverse engineering, and extracting firmware images.
Binwalk es una herramienta rápida y fácil de uso para extraer imágenes de firmware para su estudio
Lo habéis entendido, con Bin Waslk podremos examinar de cerca los firmwares de nuestros routers y "pasearnos por los ficheros bin" para encontrar fallos de seguridad .
Se trata de una herramienta mortal, una maquina a descuartizar en serie que podría usar un niño una vez que se haya resuelto un par de dependencias (o tres, no seaís mamones )
descargamos la herramienta
wget https://github.com/devttys0/binwalk/archive/master.zip
Y descomprimir el archivo *.zip así descargado
unzip master.zip
Obtenemos un carpeta llamada "binwalk-master" dónde tenemos un fichero llamado "INSTAL.md" que contiene las instrucciones:
Installation
============Installation follows the typical Python installation procedure:
```bash
# Python2.7sudo python setup.py install
```
```bash
# Python3.xsudo python3 setup.py install
```
tenemos a python3 ya instalado en xubuntu,ubuntu etc... y la herramienta rula mejor con python3 así que es aconsejable instalar nuestro bin walk con python3
Luego vemos en el fichero que se necesitan varias dependencias.
Algunas son "opcionales" ya que son para visualizar graficos.
Y otras indispensables (para por ejemplo las extracciones)
Binwalk relies on multiple external utilties in order to automatically extract/decompress files and data:
```bash
# Install standard extraction utilities
sudo apt-get install mtd-utils gzip bzip2 tar arj lhasa p7zip p7zip-full cabextract cramfsprogs cramfsswap squashfs-tools
Una vez instaladas las utilidades de extracción "estándar" nos encargamos de sasquatch
```bash
# Install sasquatch to extract non-standard SquashFS images
necesitamos estas dependencias :
sudo apt-get install zlib1g-dev liblzma-dev liblzo2-dev
Luego nos procuramos sasquatch
git clone https://github.com/devttys0/sasquatch
que instalamos
cd sasquatch
make
sudo make install
seguimos con "jefferson"
```bash
# Install jefferson to extract JFFS2 file systems
requiere una dependencia propia a python que se obtienen con "pip"
Asi que tenemos que instalar "pip":
sudo apt-get install python-pip
para instalar nuestras dependencias
sudo pip install cstruct
estamos listo para jefersson... lo descargamos
git clone https://github.com/sviehb/jefferson
y instalamos
cd jefferson
sudo python setup.py install
Y para acabar (dejamos lo de los gráficos de lado) nos queda StuffIt
wget -O - http://my.smithmicro.com/downloads/files/stuffit520.611linux-i386.tar.gz | tar -zxv
sudo cp bin/unstuff /usr/local/bin/
ya podemos instalar bin walk.
nos volvemos a situar
cd binwalk-master
y podemos instalar invocando a python3
sudo python3 setup.py install
acabamos obteniendo esto si todo ha ido ha ido bien:
byte-compiling /usr/local/lib/python3.4/dist-packages/binwalk/modules/entropy.py to entropy.cpython-34.pyc
running install_scripts
copying build/scripts-3.4/binwalk -> /usr/local/bin
changing mode of /usr/local/bin/binwalk to 755
running install_egg_info
Writing /usr/local/lib/python3.4/dist-packages/binwalk-2.1.0.egg-info
Voy a intentar extraer el firmware de mi Alfa aipw525h.
File Extraction
You can tell binwalk to extract any files that it finds in the firmware image with the -e option:
$ binwalk -e firmware.bin
así que el uso básico sería
binwalk -e ruta_firmare
hay varias opciones
Binwalk v2.1.0
Craig Heffner, http://www.binwalk.org
Usage: binwalk [OPTIONS] [FILE1] [FILE2] [FILE3] ...
Signature Scan Options:
-B, --signature Scan target file(s) for common file signatures
-R, --raw=<str> Scan target file(s) for the specified sequence of bytes
-A, --opcodes Scan target file(s) for common executable opcode signatures
-m, --magic=<file> Specify a custom magic file to use
-b, --dumb Disable smart signature keywords
-I, --invalid Show results marked as invalid
-x, --exclude=<str> Exclude results that match <str>
-y, --include=<str> Only show results that match <str>
Extraction Options:
-e, --extract Automatically extract known file types
-D, --dd=<type:ext:cmd> Extract <type> signatures, give the files an extension of <ext>, and execute <cmd>
-M, --matryoshka Recursively scan extracted files
-d, --depth=<int> Limit matryoshka recursion depth (default: 8 levels deep)
-j, --size=<int> Limit the size of each extracted file
-r, --rm Cleanup extracted / zero-size files after extraction
-z, --carve Carve data from files, but don't execute extraction utilities
Entropy Analysis Options:
-E, --entropy Calculate file entropy
-F, --fast Use faster, but less detailed, entropy analysis
-J, --save Save plot as a PNG
-Q, --nlegend Omit the legend from the entropy plot graph
-N, --nplot Do not generate an entropy plot graph
-H, --high=<float> Set the rising edge entropy trigger threshold (default: 0.95)
-L, --low=<float> Set the falling edge entropy trigger threshold (default: 0.85)
Raw Compression Options:
-X, --deflate Scan for raw deflate compression streams
-Z, --lzma Scan for raw LZMA compression streams
-P, --partial Perform a superficial, but faster, scan
-S, --stop Stop after the first result
Binary Diffing Options:
-W, --hexdump Perform a hexdump / diff of a file or files
-G, --green Only show lines containing bytes that are the same among all files
-i, --red Only show lines containing bytes that are different among all files
-U, --blue Only show lines containing bytes that are different among some files
-w, --terse Diff all files, but only display a hex dump of the first file
General Options:
-l, --length=<int> Number of bytes to scan
-o, --offset=<int> Start scan at this file offset
-O, --base=<int> Add a base address to all printed offsets
-K, --block=<int> Set file block size
-g, --swap=<int> Reverse every n bytes before scanning
-f, --log=<file> Log results to file
-c, --csv Log results to file in CSV format
-t, --term Format output to fit the terminal window
-q, --quiet Suppress output to stdout
-v, --verbose Enable verbose output
-h, --help Show help output
-a, --finclude=<str> Only scan files whose names match this regex
-p, --fexclude=<str> Do not scan files whose names match this regex
Probamos entonces con mi firmware que se basa en la sdk4 de realteck y que es similar a todos los firmwares del "rtl8x project"
WoW, no es bin "walk" es.... bin "run"
(lo siento por la cualidad de las bromas, tener en cuenta que es un foro linux, no el club de la comedia ) .... dos segundillos y ya tenemos nuestra carpetita lista para pasear por nuestros binarios...
Es bonito un firmware,:D
Hay binarios que tenemos todos en nuestra distribuciones linux, sh, md5, iw, ifconfig etc...
Y unos scripts bash muy simplones, con los dos primeros temas del curso bash "para principiante paso a paso" que tienes aquí se entienden de sobra:
digo upsss.... que cosa más mona.
notad que se genera el PIN justo depues que se haya generado el tiempo...
Que el PIN se encuentra en la variable "HW_WSC_PIN" y que se genera mediante la funcción pin-gen.
Mas o menos lo tenemos todo entre mano solo mirando en este simpático "startup.sh"
Si el resto es así de facíl me parece que los realteck tienen los dias contados
Desconectado
Muy bueno! es efectivo para la búsqueda de algoritmos a ver si puedo y lo instalo para hacer una pruebas, tengo algo en mente ( y poco tiempo )
Haces unos post muy buenos
Saludos!!
Desconectado
esta el binario en alguna parte? A ver si lo cargo en IDA
Desconectado
Buenas tardes kcD4MdG2yD9r y sobre todo ¡Bienvenido al foro!
Hay algo más de información sobre este firmware aquí : Estudiando el algoritmo de los dispositivos con chipset realtek vinculados con el "rtl189x project"
Te respondo ahí
Desconectado
Tema | Respuestas | Vistas | Ultimo mensaje |
---|---|---|---|
Duda con "Probes" de airodump-ng por Vantroll
|
3 | 82 | Ayer 16:26:03 por kcdtv |
0 | 79 | 24-02-2021 16:57:37 por kcdtv | |
2 | 343 | 22-02-2021 22:35:09 por kcdtv | |
0 | 67 | 22-02-2021 22:33:06 por kcdtv | |
|
60 | 51892 | 22-02-2021 18:32:56 por kcdtv |
Ultimo usuario registrado: 277233
Usuarios registrados conectados: 0
Invitados conectados: 5
Número total de usuarios registrados: 2,125
Número total de temas: 1,505
Número total de mensajes: 14,651
Atom tema feed - Impulsado por FluxBB