Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Wifi Password Recovery  (Read 4837 times)

0 Members and 1 Guest are viewing this topic.

Hackoo

    Topic Starter


    Hopeful
  • Thanked: 42
  • Experience: Expert
  • OS: Windows 10
Wifi Password Recovery
« on: March 22, 2017, 01:26:30 AM »
Hi  :)
I'm making a batch file to recover all the wifi passwords stored on computer !
I just have tested only on Windows 7 and Windows 10 (French Machines)
I wonder is there a trick to change this piece of code to get it working for all languages with windows is installed ?

Code: [Select]
@echo off
:Main
Title  WiFi Password Recovery by Hackoo 2017
Mode con cols=50 lines=30 & color 9E
echo [SSID] Menu :
set "pwd="
echo(
Setlocal Enabledelayedexpansion
for /f "skip=2 delims=: tokens=2" %%a in ('netsh wlan show profiles') do (
    if not "%%a"=="" (
        set "ssid=%%a"
        set "ssid=!ssid:~1!"
echo [!ssid!]
    )
)
EndLocal
echo(
Set /p "Input=Type your SSID Name : "
cls
Mode con cols=85 lines=5
for /f "tokens=2 delims=:" %%a in ('netsh wlan show profile name^="%Input%" key^=clear ^|find /I "Cont"') do (
set "pwd=%%a"
)
If defined pwd (
echo(
echo  The password of the SSID [%Input%] is ==^> "%pwd:~1%" without double quotes
) else (
echo(
color 0C
echo The password of the SSID [%Input%] is empty or not defined !
)
echo(
echo Hit any key to return to SSID Menu
Pause>nul & goto Main

Geek-9pm


    Mastermind
  • Geek After Dark
  • Thanked: 1026
    • Gekk9pm bnlog
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Wifi Password Recovery
« Reply #1 on: March 22, 2017, 02:23:34 AM »
Why not just write them down?

camerongray



    Expert
  • Thanked: 306
    • Yes
    • Cameron Gray - The Random Rambings of a Computer Geek
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Mac OS
Re: Wifi Password Recovery
« Reply #2 on: March 22, 2017, 05:11:16 AM »
Does it not work on machines that aren't in French?  I can't see any reason why it wouldn't.

Hackoo

    Topic Starter


    Hopeful
  • Thanked: 42
  • Experience: Expert
  • OS: Windows 10
Re: Wifi Password Recovery
« Reply #3 on: March 22, 2017, 10:12:43 AM »
Does it not work on machines that aren't in French?  I can't see any reason why it wouldn't.
Here is the problem :
Consider if you have a German or spanich machine : this will not work with this piece of code :
Code: [Select]
for /f "tokens=2 delims=:" %%a in ('netsh wlan show profile name^="%Input%" key^=clear ^|find /I "Cont"') do (
set "pwd=%%a"
)
Because when you want to find this string with the command Find /I "Cont" you will not find it  ;)

Hackoo

    Topic Starter


    Hopeful
  • Thanked: 42
  • Experience: Expert
  • OS: Windows 10
Re: Wifi Password Recovery
« Reply #4 on: March 22, 2017, 05:27:35 PM »
I update this script in order to find and display all SSIDs saved on a PC with their passwords and save them in a text file. and here is its screenshot :
Wifi Passwords Recovery.bat
Code: [Select]
@echo off & setlocal enabledelayedexpansion
Set "Copyright=by Hackoo 2017"
Title  %~n0 %Copyright%
Mode con cols=75 lines=8
cls & color 0A & echo.
echo             ***********************************************
echo                 %~n0 %Copyright%
echo             ***********************************************
echo(
if _%1_==_Main_  goto :Main
Set Count=0
Set L=0
:getadmin
    echo               %~nx0 : self elevating
    set vbs=%temp%\getadmin.vbs
(
echo Set UAC = CreateObject^("Shell.Application"^)
echo UAC.ShellExecute "%~s0", "Main %~sdp0 %*", "", "runas", 1
)> "%vbs%"
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
goto :eof
::*************************************************************************************
:Main
Call :init
Call :CountLines
Set "PasswordLog=%~dp0Wifi_Passwords_on_%ComputerName%.txt"
%Mod%
echo(
echo             ***********************************************
echo                 %~n0 %Copyright%
echo             ***********************************************
echo(
Call :Color 0E "                 [Num][SSID] ============== Password" 1
echo(
(
echo             ***********************************************
echo                 %~n0 %Copyright%
echo             ***********************************************
echo(
echo                  [Num][SSID] ============^> "Password"
echo(

)>"%PasswordLog%"
for /f "skip=2 delims=: tokens=2" %%a in ('netsh wlan show profiles') do (
    if not "%%a"=="" (
        set "ssid=%%a"
        set "ssid=!ssid:~1!"
call :Getpassword "!ssid!"
    )
)
echo(
echo Done
If exist "%PasswordLog%" start "" "%PasswordLog%"
pause>nul
exit
::*************************************************************************************
:Getpassword
set "name=%1"
set "name=!name:"=!"
Set "passwd="
for /f "delims=: tokens=2" %%a in ('netsh wlan show profiles %1 key^=clear ^|find /I "Cont"') do (
set "passwd=%%a"
Set /a Count+=1
)

If defined passwd (
set passwd=!passwd:~1!
echo                  [!Count!][!name!] ====^> "!passwd!"
echo                  [!Count!][!name!] ====^> "!passwd!" >> "%PasswordLog%"
) else (
Set /a Count+=1
call :color 0C "                 [!Count!][!name!] The Password is empty" 1
echo                  [!Count!][!name!] The Password is empty >> "%PasswordLog%"
)
exit /b
::*************************************************************************************
:init
prompt $g
for /F "delims=." %%a in ('"prompt $H. & for %%b in (1) do rem"') do set "BS=%%a"
exit /b
::*************************************************************************************
:color
set nL=%3
if not defined nL echo requires third argument & pause > nul & goto :eof
if %3 == 0 (
    <nul set /p ".=%bs%">%2 & findstr /v /a:%1 /r "^$" %2 nul & del %2 2>&1 & goto :eof
) else if %3 == 1 (
    echo %bs%>%2 & findstr /v /a:%1 /r "^$" %2 nul & del %2 2>&1 & goto :eof
)
exit /b
::*************************************************************************************
:CountLines
for /f "skip=2 delims=: tokens=2" %%a in ('netsh wlan show profiles') do (
    if not "%%a"=="" (
set /a L+=1
)
)
set /a L=!L! + 10
Set Mod=Mode con cols=75 Lines=!L!
exit /b
::*************************************************************************************

[attachment deleted by admin to conserve space]

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Wifi Password Recovery
« Reply #5 on: March 22, 2017, 05:54:11 PM »
Topic Closed.
" Anyone who goes to a psychiatrist should have his head examined. "