Sign in to follow this  
Followers 0
Aarstad

help with my iexplorer guard script..

14 posts in this topic

#1 ·  Posted (edited)

Hey, so I have created a script that upon detection of iexplore.exe process (internet explorer) it will ask for an input password:

If ProcessExists ("iexplore.exe") Then
        WinWait ("[CLASS:IEFrame]")
        WinSetState ("[CLASS:IEFrame]", "", @SW_HIDE )
        Local $pw = InputBox ("Passord", "Admin passord:", "", "*")
            If $pw = $passwordaccept Then
                WinSetState ("[CLASS:IEFrame]", "", @SW_SHOW )
                ProcessWaitClose ("iexplore.exe")
            Else
                WinSetState ("[CLASS:IEFrame]", "", @SW_SHOW )
                ProcessClose ("iexplore.exe")
                MsgBox(0, "Feil passord!", "Det er forbudt å surfe med denne maskinen.")
                sleep (100)
            EndIf
    EndIf

As you can see, there is a slight logical flaw with it. Whenever user attempts to open a process the window will be hidden and a password will be requested, however since the script pauses at inputbox the user can just open internet explorer again and ultimately bypass the script. Is it possible to have the inputbox on screen, but while it´s there the script doesn´t pause and keep searching for iexplore.exe windows?

 

I am most certain there is an easier way to accomplish this, but I don´t know of any. Care to help out? Thanks.

Edited by Aarstad

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You should not use any blocking function to do what you want. If you put an Inputbox or a MsbBox your script will simple be paused until the user press a button,

Hi!

Edited by Nessie

My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s).

My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all!   My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file

Share this post


Link to post
Share on other sites

I think you are almost there with this ...

Maybe this could help:

  1. Hide the IE window
  2. Show the password dialog
  3. Unhide the IE window on success
  4. Kill the IE process if password fails a certain number of times

Share this post


Link to post
Share on other sites

 

I think you are almost there with this ...

Maybe this could help:

  1. Hide the IE window
  2. Show the password dialog
  3. User simply opens up another instance of IE here
  4. Unhide the IE window on success
  5. Kill the IE process if password fails a certain number of times

 


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Hey,

You could try to do this: create 1 script that will look if Iexplore process is launched. When it is, this script will look if a hidden text file exist on the hard drive of a computer. If this file doesn't exist, it will close Iexplore process and launch another independant script that will be asking for the password (if not already showing).

This independant script will create the text file in a hidden location on the computer when the correct password is entered.

If the text file exists when Iexplore is launched, it won't close it.

When all Iexplore process are closed after correct password was entered, the hidden file is deleted by script n°1.

Share this post


Link to post
Share on other sites

can you not just set a password for IE with content advisor?

You could try one of the following to invoke it, if it is not present in IE settings.

;DllCall("Msrating.dll", "long", "RatingSetupUI", "HWND", 0, "str", @UserName)

;Run("RunDll32.exe msrating.dll,RatingSetupUI")

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Well, one of the 2 ways that I was thinking of was already mentioned in this thread. The (slightly) harder way would be to create an input box yourself in the forum of GUICreate, and a couple of objects.


Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 

Share this post


Link to post
Share on other sites

 

 

Share this post


Link to post
Share on other sites

Great amount of replies, guys. I am thankful for the help. I did manage to create a workaround based off of what Neutro replied. May not be the perfect or even proper coding advice or technique, but at least it gets the job done through "complex simplicity". Thanks bud!

This is one of those subjects where you need to make your endgame clear.

You already know you can not use an inputbox, so you exact goal is the next step toward achieving what you want.

I am not sure where you're going here. Care to elaborate on that? Even though it's solved I really want to improve my standards, so in the future I can make fully functional programs.   

can you not just set a password for IE with content advisor?You could try one of the following to invoke it, if it is not present in IE settings.

;DllCall("Msrating.dll", "long", "RatingSetupUI", "HWND", 0, "str", @UserName);Run("RunDll32.exe msrating.dll,RatingSetupUI")

The content advisor requires that I would have to do that individually on every pc, unlesss there is a software that allows one to do all that in one blow. Knowing how computers work, I am certain there are a number of ways to solve that. But that would require the same workaround for different browsers such as firefox, chrome, opera and a heap of other browsers. Simply including their processnames in a file checker and disabling them felt like a better approach.

  

Would the dialog prevent pausing the script? If thats the case it would be great to use something for that the next time.

  

Hey,

 

You could try to do this: create 1 script that will look if Iexplore process is launched. When it is, this script will look if a hidden text file exist on the hard drive of a computer. If this file doesn't exist, it will close Iexplore process and launch another independant script that will be asking for the password (if not already showing).

 

This independant script will create the text file in a hidden location on the computer when the correct password is entered.

 

If the text file exists when Iexplore is launched, it won't close it.

 

When all Iexplore process are closed after correct password was entered, the hidden file is deleted by script n°1.

I had something like that in mind. In fact, the workaround is almost an exact replica of what you wrote. Creating a new process just like that could be fatal if someone knew how to properly use their computer, but till that time this is a simple yet effective solution. I even named it something bizarre to act like a system process. Hiding the system process name would work as well, but I doubt that would be possible with autoit.

Share this post


Link to post
Share on other sites

Would the dialog prevent pausing the script? If thats the case it would be great to use something for that the next time.

Yes ... because you would make your own password dialog using GUICREATE and detect extra IE windows in the While event loop.

Share this post


Link to post
Share on other sites

Well, here's a script which is very crude, but very agressive. You've got only one chance - if you write down wrong password, then no IE will be allowed to ru. 

I'm sure someone can improve it. :)

Global $passwordaccept = "a"

While 1
IE()
WEnd

Func IE()
    Do
        Sleep(100)
    Until ProcessExists("iexplore.exe")

    If ProcessExists("iexplore.exe") Then
        WinWait("[CLASS:IEFrame]")
        WinSetState("[CLASS:IEFrame]", "", @SW_HIDE)
        WinSetState("[CLASS:IEFrame]", "", @SW_DISABLE)
        Local $pw = InputBox("Passord", "Admin passord:", "", "*")
        Do
        If $pw = $passwordaccept Then
            WinSetState("[CLASS:IEFrame]", "", @SW_SHOW)
            WinSetState("[CLASS:IEFrame]", "", @SW_ENABLE)
            ProcessWaitClose("iexplore.exe")
        Else
            Kill()
        EndIf
        Until $pw = $passwordaccept
    EndIf
EndFunc   ;==>IE

Func Kill()
    Do
        ProcessClose("iexplore.exe")
    Until ProcessExists("iexplore.exe")
    MsgBox(0, "Feil passord!", "Det er forbudt a surfe med denne maskinen.")
EndFunc   ;==>Kill

Share this post


Link to post
Share on other sites

 

Well, here's a script which is very crude, but very agressive. You've got only one chance - if you write down wrong password, then no IE will be allowed to ru. 

I'm sure someone can improve it. :)

Global $passwordaccept = "a"

While 1
IE()
WEnd

Func IE()
    Do
        Sleep(100)
    Until ProcessExists("iexplore.exe")

    If ProcessExists("iexplore.exe") Then
        WinWait("[CLASS:IEFrame]")
        WinSetState("[CLASS:IEFrame]", "", @SW_HIDE)
        WinSetState("[CLASS:IEFrame]", "", @SW_DISABLE)
        Local $pw = InputBox("Passord", "Admin passord:", "", "*")
//User can ignore the inputbox from here
        Do
        If $pw = $passwordaccept Then
            WinSetState("[CLASS:IEFrame]", "", @SW_SHOW)
            WinSetState("[CLASS:IEFrame]", "", @SW_ENABLE)
            ProcessWaitClose("iexplore.exe")
        Else
            Kill()
        EndIf
        Until $pw = $passwordaccept
    EndIf
EndFunc   ;==>IE

Func Kill()
    Do
        ProcessClose("iexplore.exe")
    Until ProcessExists("iexplore.exe")
    MsgBox(0, "Feil passord!", "Det er forbudt a surfe med denne maskinen.")
EndFunc   ;==>Kill

 

Hey, thanks for the script, but sadly its just a longer version of what I already created. It doesn't improve upon it. See where I wrote the text beneath the inputbox in the quoted code you added? This is the problemspot. Because inputbox will ask for a password and wait for a full eternity for an answer here, the user can just open another instance of internet explorer and ignore the inputbox all together.

Again, thanks for the script and you taking your time, though.

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