Jump to content

Browser-Based Firewall Configuration


DuncanM
 Share

Recommended Posts

Hello, I am new to AutoIT and would like to use it to automatically configure firewalls via their browser-based interface (via IE). First, I need to import the device's SSL certificates into IE. Then, for the device configuration, the interface has 2 frames - the first one on the left contains the different configuration categories (Network, Access Rules, Logs, etc.), and the right window is where the configuration is actually done using forms, check boxes, etc. Lastly, to ensure that the user does not interrupt, is there any way I can disable user input while the script is running? Any help as to how I might get started (or a sample script if anyone's done this before) would be greatly appreciated.

Link to comment
Share on other sites

Take a look at the IE functions in the latest beta. You'll probably need to start with _IEFrameGetCollection, and you might be able to do what you need with _IELinkClickByText. To disable user input, take a look at Blockinput.

Without more information (html code examples, etc.) , we can't do much else to help.

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

Take a look at the IE functions in the latest beta. You'll probably need to start with _IEFrameGetCollection, and you might be able to do what you need with _IELinkClickByText. To disable user input, take a look at Blockinput.

Without more information (html code examples, etc.) , we can't do much else to help.

Thanks - what I'm looking to configure is, for example, a D-Link router. Are there any AutoIT script examples that illustrate how to configure this type of application? Also, I see that the _IEFrameGetCollection is going to be discontinued in the next release - is there another function I should be using instead?
Link to comment
Share on other sites

I can see why it would be discontinued, as you can just use _IETagNameGetCollection, i.e.:

$oFramess = _IETagNameGetCollection ($oIE, "frame")

As for a UDF for configuring a D-Link router, that's going to be inherently problematic. From one model of router to another, or even from one firmware release for the same router to another, the web page code may change, which may brake a script.

How many routers do you have to configure? If they're all the same version/firmware you might be able to automate that part of your job. If they differ, well, good luck with that.

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

I can see why it would be discontinued, as you can just use _IETagNameGetCollection, i.e.:

$oFramess = _IETagNameGetCollection ($oIE, "frame")

As for a UDF for configuring a D-Link router, that's going to be inherently problematic. From one model of router to another, or even from one firmware release for the same router to another, the web page code may change, which may brake a script.

How many routers do you have to configure? If they're all the same version/firmware you might be able to automate that part of your job. If they differ, well, good luck with that.

Very true that a couple minor interface changes could hose the whole script, but I plan on using this for units with the same model/firmware, though I'm not sure exactly which model yet. Basically, it should involve "clicking" options in a left frame and entering data in the right window, then submitting it. I imagine it to be pretty repetitive, but haven't found any good examples along these lines..
Link to comment
Share on other sites

Once you sort out which model, take a shot a coding up the unit tests. Read through the IE Management UDFs in the Help file, and try merging the very good sample code to see if you can sort it out. Start small. If you get stuck, post your code, and the HTML code it's working on, and someone will help you out, I'm sure.

Have fun!

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

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...