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

Author Topic: * as batch file password characters  (Read 13446 times)

0 Members and 1 Guest are viewing this topic.

Yogotiss

  • Guest
* as batch file password characters
« on: November 29, 2008, 07:34:55 PM »
I've been searching and searching codes to hide characters for a batch file password. Can anyone help?

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: * as batch file password characters
« Reply #1 on: December 01, 2008, 03:52:38 AM »
There are third party programs that can do this. A likely solution would be a C program, however you have the tools to do this yourself with a debug script:

Code: [Select]
A
MOV AH,0C ;function flush buffer
INT 21 ;DOS call
MOV AH,0A ;function buffered input
INT 21 ;DOS call
MOV DL,AL ;store user input
MOV AH,4C ;function exit
INT 21 ;DOS call

RCX
14
N PSWDHIDE.COM
W
Q


The last line of the script is intentionally left blank. Save the script with a scr extension and from the command line run debug < scriptname.scr

The resulting file, pswdhide.com, can be incorporated into your batch file to mask input at the console:

Code: [Select]
@echo off
set /p userid=Enter UserId:
:retry
set /p password=Enter password: <nul
for /f "tokens=*" %%i in ('pswdhide.com') do set password=%%i
if %password%==password goto next
cls
echo Incorrect password, Try Again
goto retry

:next
echo. & echo You are logged in!

While all this is very entertaining, the password is hiding in plain sight. This is a definite security breach. Might be better to hide the password in a file, database or even the registry. While still not 100% secure, it should slow down all but the most determined hacker.

Note: if you put pswdhide.com in a directory on your path, any of your batch files can use it.
   
Good luck.  8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

Kuenchinu



    Starter

    Re: * as batch file password characters
    « Reply #2 on: December 01, 2008, 02:53:46 PM »
    thanks for replying to my mail, what am trying to do is to catch out the person who keeps using my laptop, i was told 3 simple batch files can help me, i have set the first but having problems with the password batch tho, i have a time log batch for when my start bar is opened, a program used batch working but the pass word batch is a bother :(

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: * as batch file password characters
    « Reply #3 on: December 01, 2008, 05:01:55 PM »
    Quote
    i was told 3 simple batch files can help me, i have set the first but having problems with the password batch tho, i have a time log batch for when my start bar is opened, a program used batch working but the pass word batch is a bother

    Where did the info come from? Vista is a Windows OS and I suspect you can find any information you need in the event logs. For instance you can check event code 528 (logins) in the security log which should pinpoint all the users who used your machine (including you).

    The batch file above was nothing more than a slick demonstration of how to introduce a password to a batch file. Unfortunately, it does nothing to enhance the security of Windows. As explained in the PM's, any user could bypass the password security by directly starting the application from a shortcut or the run box.

    Quote
    what am trying to do is to catch out the person who keeps using my laptop

    How does this work? Do you leave your PC unattended and another person uses your PC? Does this other person login with your credentials or his own? If you change your password, will this prevent someone else using your machine? I really need for you to layout the scenario on how this other person gets access to your PC.

     8)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein