Monday 14 March 2016

Save all your passwords to a text file with one click!

Tutorial 59 on my site explains how to set up a script file to collect and save all your passwords into text files with just one click.

The Tutorial was a bit out of date and needs tweaking (I will update it in a day or two). Nirsoft had put some of the command line utility versions in a separate, password-protected download because they were being detected as a virus and it was causing the nirsoft site to be blacklisted!

Here is the new cmd script I ended up with:

@echo off


pushd "%~dp0"
color 1f

if exist 7za.exe 7za e -y *.*
if exist 7za.exe 7za e -y *.* -pnirsoft123!

echo Getting passwords...
for /F "tokens=1-2 delims=: " %%l in ('time /t') do set hhmm=%%l%%m
set r="%computername%_%username%_%date:/=%_%hhmm%"
mkdir %r% > nul
start /wait BulletsPassView.exe     /stext %r%\Bullets.txt
start /wait Chromepass.exe          /stext %r%\Chrome.txt
start /wait dialupass.exe           /stext %r%\dialup.txt
start /wait iepv.exe                /stext %r%\IE.txt
start /wait mailpv.exe              /stext %r%\Mail.txt
start /wait mspass.exe              /stext %r%\MS.txt
start /wait netpass.exe             /stext %r%\Net.txt
start /wait OperaPassView.exe       /stext %r%\Opera.txt
start /wait PasswordFox.exe         /stext %r%\Fox.txt
start /wait pstpassword.exe         /stext %r%\Pstpassword.txt
start /wait routerpassview.exe      /stext %r%\router.txt
start /wait VNCPassview.exe         /stext %r%\VNC.txt
start /wait WebBrowserPassView.exe  /stext %r%\Browser.txt
start /wait WirelessKeyView.exe     /stext %r%\WiFi.txt
REM delete 0 length or empty log files
FOR /F %%G IN ('DIR /b %r%\*.txt') do call :DELZ %r%\%%G
dir  %r%\*.txt | find /I ".txt"

if exist 7za.exe ren 7za.exe 7za.x
del *.exe
if exist 7za.x ren 7za.x 7za.exe

del *.chm

goto :EOF
REM if size of file is less than 3 bytes then delete it
if %~z1 LEQ 2 del "%~f1"

This script will extract all the files in the first zip file and then overwrite some of them with their commandline versions (which are detected as viruses by some AV software). It will then run the executables and delete the nirsoft files to prevent your AV software from throwing a 'hissy fit'.

After running the script, the end result is that you will have a new folder that has the computername+date+time as the folder name and contains the password files. Any empty files are deleted by the script to keep things tidy.

To make this work:

1. Download the nirsoft file and the file.
2. Make a new \PassRec folder on your USB flash drive (any empty folder will work)
3. Copy the zip files and 7za.exe (from a 7zip download) into the new folder.
4. Make a GetPass.cmd file using the script above into NotePad, and save as .GetPasscmd (not .txt!)

This .cmd file and 7za.exe is in the download here.

U:\PassRec folder:

Now run the GetPass.cmd as Administrator - temporarily disable your AV (it doesn't like these executables for some reason ;-) and in a few seconds you will have saved all your passwords!

As they say on the TV - 'use this product responsibly'!

P.S. Don't leave the password.txt files lying around! Delete them or keep them in an encrypted folder or on a secure drive.

Note: The FireFox password app. may only support 32-bit FireFox (not the 64-bit version) and you may get an error reported.

No comments:

Post a Comment