Batch Wlan Passwort auslesen mit findstr
Guten Tag,
ich habe ein Problem mit meinem Batch Programm und zwar habe ich mir einen Zufalls Generator mit Batch geschrieben das nebenbei einen Log für die Zufällig ausgewählte Kombination aus Zahlen und Buchstaben, Benutzer Information, Wlan Name und was leider nicht funktioniert das Passwort abspeichert. Kann mir da jemand helfen? Hab mir einen großteil des codes bei verschiedenen Plattformen wie zb. Administrator.de zusammen gesucht und dann meine eigenen Wünche ergänzt.
Der Code:
Danke im Vorraus,
DevSodoku
ich habe ein Problem mit meinem Batch Programm und zwar habe ich mir einen Zufalls Generator mit Batch geschrieben das nebenbei einen Log für die Zufällig ausgewählte Kombination aus Zahlen und Buchstaben, Benutzer Information, Wlan Name und was leider nicht funktioniert das Passwort abspeichert. Kann mir da jemand helfen? Hab mir einen großteil des codes bei verschiedenen Plattformen wie zb. Administrator.de zusammen gesucht und dann meine eigenen Wünche ergänzt.
Der Code:
@echo off & setlocal
for /f "tokens=1* delims=:" %%i in (
'netsh wlan show interfaces ^| findstr /rxc:"[ ]* SSID [ ]*: ..*"'
) do for /f "tokens=*" %%k in ("%%j") do set "SSID=%%k"
for /f "tokens=1* delims=:" %%i in (
'netsh Wlan show Profile %SSID% key=clear ^| findstr /rxc:"[ ]* Schlüsselinhalt [ ]*: ..*"'
) do for /f "tokens=*" %%k in ("%%j") do set "Schlüsselinhalt=%%k"
pause
echo %SSID%
echo %Schlüsselinhalt%
:loop
set "Zeichen=BCDEGHIJKMNOPRSTUVWXYZabcdefghijklmnopqrstvwxyz!123456789"
set G=%temp%\GetRandomText.vbs
>%G% echo R="%Zeichen%":L=Len(R):For i=1 To WScript.Arguments(0):Randomize:T=T^&Mid(Z,Int(Rnd*L+1),1):Next:WScript.Echo T
for /f %%i in ('cscript //nologo %G% 32') do set "RandomText=%%i"
echo %RandomText%
echo Benutzer=%username% >> C:\Ordner\ZLog.txt
echo Computer=%computername% >> C:\Ordner\ZLog.txt
echo Wlan Name=%SSID% >> C:\Ordner\ZLog.txt
echo Wlan Passwort=%Schlüsselinhalt% >> C:\Ordner\ZLog.txt
echo Zufall=%ZText% >> C:\Ordner\ZLog.txt
echo Datum=%date% >> C:\Ordner\ZLog.txt
echo Zeit=%time% >> C:\Ordner\ZLog.txt
echo Zufall=%ZText% >> C:\Ordner\OnlyRandomLogs.txt
echo - - - - - - - - - - - - - - - >> C:\Ordner\ZLog.txt
echo - - - - - - - - - - - - - - - >> C:\Ordner\OnlyRandomLogs.txt
goto loop
exit
Danke im Vorraus,
DevSodoku
Bitte markiere auch die Kommentare, die zur Lösung des Beitrags beigetragen haben
Content-ID: 387245
Url: https://administrator.de/forum/batch-wlan-passwort-auslesen-mit-findstr-387245.html
Ausgedruckt am: 11.04.2025 um 21:04 Uhr
5 Kommentare
Neuester Kommentar

Hi,
da fehlen ein paar Escapes, probier das:
Gruß speedlink
da fehlen ein paar Escapes, probier das:
@echo off &setlocal
for /f "tokens=2 delims=:" %%a in ('netsh wlan show interfaces ^| findstr /rc:"Profil *:"') do for /f "tokens=1*" %%b in ("%%a") do set "PROFIL=%%b"
for /f tokens^=2^ delims^=^" %%a in ('netsh wlan show profile "%PROFIL%" key^=clear ^| findstr /lic:"SSID-Name"') do set "SSID=%%a"
for /f "tokens=2 delims=:" %%a in ('netsh wlan show profile "%PROFIL%" key^=clear ^| findstr /i inhalt') do for /f "tokens=*" %%b in ("%%a") do set "PASSWORD=%%b"
echo Aktuelles WLAN Profil: %PROFIL%
echo SSID: %SSID%
echo KEY: %PASSWORD%
Gruß speedlink