Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

VB Script for Logging On Locally


  • Please log in to reply
9 replies to this topic

#1 Gotcha_Hotshot22

Gotcha_Hotshot22

  • Members
  • 77 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:44 AM

Posted 02 August 2014 - 03:12 AM

So I was wondering how you could create a simple login box with vb and set it to log off the computer if the wrong password was entered three times. 

 

I want to lock my batch file with it and instead of just closing the batch file after three failed attempts I also want it to log the user off of the computer as well. I already have the log off the pc script. This is what I have so far.

 

 

(Double click batch file which starts vbs file that says (assuming you've already tried to log in three times):

msgbox "You have exceeded your max login attempts."
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "C:\windows\system32\shutdown.exe /l /f", 0, false

and if you log in successfully then the batch continues on to do follow the given instructions...

@Echo Off
Color 8F
Title Record Systems
:VarList
REM ASSIGNING VALUES TO VARIABLES
SET AdminPass=(****************)
CLS
REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REM                          SESSION LOGIN BELOW
REM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
:LOGIN
START LOGIN.vbs
REM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REM                           END SESSION LOGIN
REM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
REM Main Menu BELOW
:MainMenu
CLS
Type MainMenu.txt
set /p Key= 
if %Key%==1 goto :WorkOrder
if %Key%==2 goto :Receipts
if %Key%==3 goto :Misc
if %Key%==4 goto :LogOut

I just want to lock this batch file using a vb login screen that will log the user out of their pc if they enter the password wrong three times.

I don't have a server or anything. It'd have to be something like setting a variable to be the password and then comparing it with the entered text.

 

 

Thanks in advance,

Daniel


Thanks,

Daniel


BC AdBot (Login to Remove)

 


#2 Veitch

Veitch

  • Members
  • 31 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:01:44 PM

Posted 02 August 2014 - 03:46 AM

Everyone who knows a small bit about programming also knows that he or she can just open up the batch file and remove/modify the lines that start the vb script. So I don't see a real chance for making this secure. I also don't see why you mix up VB and batch, and command line interface and GUI. The whole concept is weird.

 

Now about the password: You don't compare or save passwords in plaintext. That would be highly insecure as well. You save a hash value of the password instead. If the user enters the password, the password must be hashed and the hash values are compared.



#3 Gotcha_Hotshot22

Gotcha_Hotshot22
  • Topic Starter

  • Members
  • 77 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:44 AM

Posted 02 August 2014 - 04:35 PM

You're right about the whole hash and plain text thing but I was planning on turning all of this into assembly afterwords. It makes it a lot harder to read. 

 

I will start looking for the hash thing, though. 


Thanks,

Daniel


#4 Veitch

Veitch

  • Members
  • 31 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:01:44 PM

Posted 03 August 2014 - 02:06 AM

I was planning on turning all of this into assembly afterwords. It makes it a lot harder to read. 

 

?

You write a bash and VB script to turn into assembly afterwards?

Why not write in assembly right from the start?

And why assembly? Yes, it is harder to read, but it is also overkill. You achieve the same just with using a high-level language that compiles to machine code.



#5 Gotcha_Hotshot22

Gotcha_Hotshot22
  • Topic Starter

  • Members
  • 77 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:44 AM

Posted 03 August 2014 - 03:16 AM

Because I'm too stupid to understand those high level languages. They make 0 sense to me. Idk why. 

I need the practice as far as batch and vb. They are both higher level languages than I'm used to, vbs most of all. I'm just more comfortable with low level languages like assembly and hex.


Thanks,

Daniel


#6 JohnnyJammer

JohnnyJammer

  • Members
  • 1,117 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:10:44 PM

Posted 03 August 2014 - 04:49 PM

dont worry mate i aintmuch of a programmer either but i manag2d to create a full app which does a hell of a lot but one of the things it also does itpulls the users sid and also checks the user token using windowsidenity in vs 2010. it then shows locations of the app dependingon domain groups they belong. i think you should start with vb.net as as far as i can say is pretty dam easy, i found ruby a lot harder as i did everything in notepad or scite.

instead of passwords create a local group on the pc and do what iexplained above, if you want an example let me inow.


Edited by JohnnyJammer, 03 August 2014 - 04:52 PM.


#7 Gotcha_Hotshot22

Gotcha_Hotshot22
  • Topic Starter

  • Members
  • 77 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:44 AM

Posted 03 August 2014 - 06:01 PM

Thanks, I'll try that out! My problem is that I'm not worried about specific computers not being able to log in but specific users. 

 

Say I have a client over and I need to fetch a part from my storage closet but it's in the back and blah blah blah...I don't want them being able to break into my program (and being that batch can be cracked just by opening it in notepad...) I need to hash the password as the guy above said but batch files aren't quite strong enough to do that. I've already pulled Powershell into my batch file to mask the password while I type it in but I'm not sure how to hash anything or if its possible with powershell. 

 

I can't wait until someone comes out with a program where you speak to it and say "I want my program to do this, this, and this." and then it programs it for you. I'd pay a million dollars for that!!


Thanks,

Daniel


#8 Veitch

Veitch

  • Members
  • 31 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:01:44 PM

Posted 04 August 2014 - 04:39 AM

Thanks, I'll try that out! My problem is that I'm not worried about specific computers not being able to log in but specific users. 

 

Say I have a client over and I need to fetch a part from my storage closet but it's in the back and blah blah blah...I don't want them being able to break into my program (and being that batch can be cracked just by opening it in notepad...) I need to hash the password as the guy above said but batch files aren't quite strong enough to do that. I've already pulled Powershell into my batch file to mask the password while I type it in but I'm not sure how to hash anything or if its possible with powershell. 

 

I can't wait until someone comes out with a program where you speak to it and say "I want my program to do this, this, and this." and then it programs it for you. I'd pay a million dollars for that!!

 

You can just lock your PC when you fetch something. http://support.microsoft.com/kb/294317



#9 JohnnyJammer

JohnnyJammer

  • Members
  • 1,117 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:10:44 PM

Posted 07 August 2014 - 01:05 PM

There is an app called dragon voice on which you say what youn want the computer to do. Its great for disabled people and after an hour reading some text for voice recognition, you start giving it key commands. Back to the password, Like veitch said, either hit the windows key and L at the same time to lock it or create a small windows form with a hard coded password (not safe but use Char() instead of open text or a crypt function).



#10 Gotcha_Hotshot22

Gotcha_Hotshot22
  • Topic Starter

  • Members
  • 77 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:07:44 AM

Posted 08 August 2014 - 06:41 PM

I could do that but even that is crackable. It'd take a little longer to do than if I were running in to the back room to get something would but say they broke in while I was closed...

 

Anyway, dragon voice is pretty cool but I ment along the lines of "I want my program to require a user login that has a submit button, not a login button. I want the background to black and login fields and submit button white." 

 

Something like that would be amazing!!!!!!!!!!!

 

Thanks for the reply!!


Thanks,

Daniel





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users