Jump to content

Phony Windows Lock-Out


cybie
 Share

Recommended Posts

i get this error:

>Running: (3.1.1.80):C:\Program Files\AutoIt3\autoit3.exe "C:\Documents and Settings\Administrator\Desktop\test.au3"

C:\Documents and Settings\Administrator\Desktop\test.au3 (2) : ==> Unable to execute the external program.:

$Password = RunWait(@Comspec & ' /c dir 1')

Logon failure: unknown user name or bad password.

when running this code:

RunAsSet(@Username, '', 'default')
$Password = RunWait(@Comspec & ' /c dir 1')
MsgBox(0, "", $Password)

I assume this code is supposed to get the users password?

what am i doing wrong?

It is really sad to see a family torn apart by something as simple as a pack of wolves.

Link to comment
Share on other sites

  • Replies 74
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

No, the 'default' needs to be replaced by the user-inputted password. If it has a logon failure, it will return a failure notification to the $Password variable, which can be tested against. If they did put the right password, the dir 1 command will be allowed, and a return success code will be sent to $Password. There is a func I posted somewhere with an implementation of it...

I forgot RunAsSet() at the end...

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

Updated! Well, I updated the au3 in the previous post. It now will ask for a username and password and authenticate you. Not sure if it works for the local machine, but it works on a domain. It just attemps to run charmap as the user specified (hidden, also who has charmap open consistently?), kills it and lets you in if successful. Pretty much keeps up with the look and feel of the windows component. I'm not a big fan of killing explorer so I haven't included that, but if you did, this should pretty much function like the windows lock computer.

Link to comment
Share on other sites

Thanks

thanks MSLx Fanboy, i wasnt sure what that bit of code was doin.

Updated! Well, I updated the au3 in the previous post. It now will ask for a username and password and authenticate you. Not sure if it works for the local machine, but it works on a domain. It just attemps to run charmap as the user specified (hidden, also who has charmap open consistently?), kills it and lets you in if successful. Pretty much keeps up with the look and feel of the windows component. I'm not a big fan of killing explorer so I haven't included that, but if you did, this should pretty much function like the windows lock computer.

i get this error with your file archrival:

>Running: (3.1.1.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\Lock\FakeLock.au3"

C:\Program Files\Lock\FakeLock.au3 (52) : ==> Unknown function name.:

$objWshNet = ObjCreate("WScript.Network")

$objWshNet = ^ ERROR

plus my firewall popped up asking if i wanted to allow it access.

It is really sad to see a family torn apart by something as simple as a pack of wolves.

Link to comment
Share on other sites

Thanks

thanks MSLx Fanboy, i wasnt sure what that bit of code was doin.

i get this error with your file archrival:

>Running: (3.1.1.0):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\Lock\FakeLock.au3"

C:\Program Files\Lock\FakeLock.au3 (52) : ==> Unknown function name.:

$objWshNet = ObjCreate("WScript.Network")

$objWshNet = ^ ERROR

plus my firewall popped up asking if i wanted to allow it access.

Requires the latest beta, which I mentioned.

Link to comment
Share on other sites

ok, got it all setup to check against the actual windows users password.

if they enter the wrong password the script displays an error message and shuts down.

if the password matches the script saves the password to the .ini file for future use.

if you dont kill the explorer process anyone could just hit the windows key on the keyboard and disable the login.

Edited by random667

It is really sad to see a family torn apart by something as simple as a pack of wolves.

Link to comment
Share on other sites

I understand the need to kill explorer, I just didn't add it in mine because trayicons disappear among other issues. The latest version of my script should behave exactly the same as windows (except of course it doesn't actually lock you out, but that's easy to fix).

I've tried this on XP machines with no problems. It will authenticate as a local or domain user. It requires 3.1.1+.

Correction

For some reason the domain combo box is not adding the 2nd item properly on 2000.

Edited by archrival
Link to comment
Share on other sites

so, looks like we got two good versions then,

one for those who want to lock up their machine

and one for those just want it to look locked.

but i havent had time to go update to the latest beta AGAIN, to try yours out.

That got me thinkin,

is there a way to run the actual windows logon screen with out actually logging out?

If so, that would have probably been the easiest solution. B)

Edited by random667

It is really sad to see a family torn apart by something as simple as a pack of wolves.

Link to comment
Share on other sites

I've been streamlining the code a bit. I haven't downloaded the images yet, however, I notice that I can still Alt-Tab and all that. I'm going to look into working with IsPressed or HotKeySet or something to try and resolve the issue

Edit: Still working on issues, maybe someone else can help (I'm not good at blocking input). Updated the code though to protect the password, and to simplify all of the unnecessary variables and what not. Make sure to delete whatever password might already be set in the ini file!

lock.au3

Edited by MSLx Fanboy

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

I've been streamlining the code a bit. I haven't downloaded the images yet, however, I notice that I can still Alt-Tab and all that. I'm going to look into working with IsPressed or HotKeySet or something to try and resolve the issue

Edit: Still working on issues, maybe someone else can help (I'm not good at blocking input). Updated the code though to protect the password, and to simplify all of the unnecessary variables and what not. Make sure to delete whatever password might already be set in the ini file!

I've updated my script to include hotkeyset for Alt-Tab and Alt-F4, those work with hotkey set, others do not. I've tried Ctrl-Esc (Start), Ctrl-Shift-Esc (Task Manager), Win-Tab (Cycle through taskbar), Win (Start), Win-D (Show Desktop), those do not work properly. I think it would make more sense to disable key inputs than to kill explorer outright. I'm not sure what other key shortcuts should be trapped, but possibly these. Another option would be to write a DLL with keyboard hooks in it to disable these functions and FileInstall it. I've updated my above posting, it's fooled all sorts of people. It could also be used as a password hoarder!

Link to comment
Share on other sites

I'm not that good with C++ yet, however, if it would be possible to hook all special keys (ESC, Ctrl, Alt, Tab, etc), and then release at end of application, that would be best.

Until then, I'll see what other code simplifications can be made on what we have

Don't have AutoIt installed on this machine right now, but I made one modification...Please excuse the large amount of code to follow B)

I also want to see if I can simplify the image install part, but I'll work on that later

Edit: Updated code again, took at next post

Edited by MSLx Fanboy

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

I couldn't help but do it now B) Updated the FileInstall code to cut down on wasted lines. Images must be separated by OS version and renamed.

Windows XP images must be put in a folder titled 'WIN_XP', and the filenames will be 'High.bmp' and 'Liner_High.bmp' or 'Low.bmp' and 'Liner_Low.bmp'

Windows 2000 images must be put in a folder titled 'WIN_2000', and the filenames will be of the same format as those for Windows XP.

I will make a zip file of all of the files later today for simplification.

I've attached the updated file, now with only 124 lines of code, hopefully we can get the HotKeySet or other keyboard hooks working soon.

Edit: I've fixed a small bug where if no password is set in the ini file, only the correct windows logon password can be used, no admin backup is possible. Updated attachment.

lock.au3

Edited by MSLx Fanboy

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

I believe I'm finally done. I found a major bug in that any password that was not blank was allowed, due to issues in ValidUserPassword() (Run returns string regardless, set ret_val based on @error).

I still don't understand what the pictures are about...I haven't gotten any of them to work on my system properly...but if they work for you, all's good B)

ScreenLock.zip

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

I still don't understand what the pictures are about...I haven't gotten any of them to work on my system properly...but if they work for you, all's good B)

Then I guess you don't understand what I was attempting to accomplish. In my opinion, the script I wrote is much more useful, it attemps to emulate the actual computer locked screen of both 2000 and XP. Using an input box and specifying GUI colors instead of using the system setting looks terrible in my opinion. The bitmaps were pulled directly from msgina.dll, they are the actual images used when a computer is locked, from both 2000 and XP. I think if I can modify my code to block the shortcut keys, the script I wrote will be complete. It's almost there already. I have a DLL that will block the shortcuts, as long as I can get it to work, I will have an almost exact replica. I need to fix the case of only one local user available since it doesn't give you the options >> button. I suggest you take a look at my code, I've had no issues on XP at all (domain member and non-domain member PC).

Link to comment
Share on other sites

No, I understand the concept (from the first posts), however, I've never had it work for me, and I wasn't sure if it works for the other people working with the code right now.

If the pictures are pulled directly from the DLL, is it possible to pull them directly from the DLL through the script?

Writing AutoIt scripts since

_DateAdd("d", -2, _NowCalcDate())
Link to comment
Share on other sites

No, I understand the concept (from the first posts), however, I've never had it work for me, and I wasn't sure if it works for the other people working with the code right now.

If the pictures are pulled directly from the DLL, is it possible to pull them directly from the DLL through the script?

I've tried, I can't figure out how to pull a bitmap, I have no problems with icons in DLL files obviously.

Edited by archrival
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...