Sign in to follow this  
Followers 0
gleem

RunAsSet user verification

5 posts in this topic

I have been searching through the forums for a way to do verify the RunAsSet command with an If then Statement.

for example... as I understand it.. normally, you would use

RunAsSet("username","domain","password",2)

Run("C:\Program Files\Internet Explorer\iexplore.exe")

this would cause iexplorer.exe to run with the RunAsSet user account.

however, if the user enters the password wrong and/or user name, the script still runs.

what I would like to do is

verify that domain user account and password is correct.

If correct, it runs the script. if not, is exit's.

I am sure this questions pertains more to an AD type verification but I am not sure how to do so.

Share this post


Link to post
Share on other sites



You would have to understand the authentication protocol to validate information. AutoIt is great, but I'm not sure if it should be validating passwords or anything like that. I could see that blowing into a brute force user password cracker.

Share this post


Link to post
Share on other sites

Can't you use the @error flag in this script?

RunAsSet("username","domain","password",2)
If @error Then Exit
Run("C:\Program Files\Internet Explorer\iexplore.exe")

????

Share this post


Link to post
Share on other sites

Can't you use the @error flag in this script?

RunAsSet("username","domain","password",2)
If @error Then Exit
Run("C:\Program Files\Internet Explorer\iexplore.exe")

????

Did you test that because it doesn't work like that..

You need to test the Run/RunWait for an @Error because at that time the process is shelled with the newly set credentials .

:)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Did you test that because it doesn't work like that..

You need to test the Run/RunWait for an @Error because at that time the process is shelled with the newly set credentials .

:)

It's easy. You just run some cmd command like this:

runasset(some credentials)

runwait("cmd.exe /c time /t","",@SW_HIDE)

$res1=@error

if $res1 == 0 then ;credentials OK

Edited by LoWang

Share this post


Link to post
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
Sign in to follow this  
Followers 0