OWASP O2 Platform Blog

O2 Util: Add sites to IE trusted zone

Using the APIs added here and the Registry Viewer added here, this next script shows a little tool that can be used to add sites directly into IE’s trusted zone:

//var topPanel = panel.clear().add_Panel();;
var topPanel = O2Gui.open<Panel>("Add Site to IE Trusted Domains", 700,120 );      
var ieKeysLocation = @"Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\";
var domain_TextBox = topPanel.add_TextBox(0,"Root Domain:","owasp.org");
var subDomain_TextBox = topPanel.add_TextBox(21,"SubDomain:  ","www");
var addSite_Button = topPanel.add_Button(47 ,78,"Add site (for both http and https)");
var status_Label = addSite_Button.append_Label("...").topAdd(5).autoSize();
topPanel.add_Link("Open Registry Viewer", 75,78,()=> "Util - Registry Viewer.h2".local().executeH2Script())
        .append_Label("(look inside key {0} )".format(ieKeysLocation)).autoSize(); 

Action<string,string> addDomain =
                                var response = rootDomain.makeDomainTrusted(subDomain);

addSite_Button.onClick(()=> addDomain(domain_TextBox.get_Text(),subDomain_TextBox.get_Text()));

//using O2.XRules.Database.Utils

This is what it looks like:

March 4, 2011 - Posted by | IE Automation

1 Comment »

  1. […] this O2 Script: O2 Util: Add sites to IE trusted zone (Note that at the moment the IE instance running inside O2 is not picking up the zone change, so […]

    Pingback by Running Javascript in O2′s IE Automation environment « O2Platform.com for Developers | March 8, 2011 | Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: