Posted in

Script CMD untuk mendapatkan semua Wifi dan Password yang tersimpan di komputer

berikut adalah script yang saya dapat dari Google Gemini dengan prompt

” make a script in CMD windows to get all wifi profile and password in a text file”

@echo off
REM ============================================================================
REM Title:         Get Wi-Fi Passwords
REM Description:   Retrieves all saved Wi-Fi profiles and their passwords,
REM                then saves them to a text file named "wifi_passwords.txt".
REM Author:        Gemini
REM Version:       1.0
REM Requirements:  Run as Administrator.
REM ============================================================================

REM Set the output filename
SET "output_file=wifi_passwords.txt"

REM Create or overwrite the output file and add a header
(
    echo ====================================================
    echo        Wi-Fi Network Profiles and Passwords
    echo ====================================================
    echo.
    echo Report generated on: %date% at %time%
    echo.
    echo.

    REM This command lists all WLAN profiles. We use a FOR loop to process each one.
    REM The 'tokens=4,*' part helps us grab the profile name, which can contain spaces.
    for /f "tokens=4,*" %%G in ('netsh wlan show profile') do (
        
        REM The profile name (SSID) is stored in the variable %%H
        set "ssid=%%H"
        
        REM We use a subroutine to get the key for the current SSID
        call :get_key "%%H"
    )

) > %output_file%

REM Notify the user that the script has finished and where the file is.
echo [+] Wi-Fi profiles and passwords have been successfully saved to %output_file%
echo.
pause
goto :eof


REM Subroutine to extract the password (key) for a given profile
:get_key
    set "profile_name=%~1"
    
    REM Display the Profile Name in the output file
    echo Profile Name: %profile_name%
    
    REM This command shows the details for a specific profile.
    REM We add 'key=clear' to expose the password in plain text.
    REM The output is piped to 'findstr' to only grab the line containing "Key Content".
    netsh wlan show profile name=%profile_name% key=clear | findstr /C:"Key Content"
    
    REM Add a separator for better readability in the output file
    echo ----------------------------------------------------
    echo.
goto :eof

Siman file tersebut dengan nama get_all-wifi_pass.bat.

cukup klik kanan dan pilh Run As Administrator. Jika sukses dijalankan di folder tersebut akan muncul file wifi_passwords.txt

====================================================
       Wi-Fi Network Profiles and Passwords
====================================================

Report generated on: 08/06/2025 at 15.51.42,91


Profile Name: GRAND BROADBAND
----------------------------------------------------

Profile Name: candraAP
    Key Content            : rahasia
----------------------------------------------------

Profile Name: LAB KOMPUTER
----------------------------------------------------

Profile Name: mahasiswa
    Key Content            : cerdasberintegritas
----------------------------------------------------
Share Artikel ini:

Candra Adi Putra S.Kom adalah Alumni STMIK AKAKOM Yogyakarta. hubungi saya di candraadiputra (at) gmail (dot) com

Leave a Reply

Your email address will not be published. Required fields are marked *