OWASP O2 Platform Blog

O2 Script – Retrieving crossdomain.xml from Google

This script shows an example of using Google to retrieve the crossdomain.xml file from popular websites

Matt Parsons  as also created a blog post around this script:

var topPanel = panel.clear().add_Panel();
var ie = topPanel.add_IE().silent(true);
ie.open("<a href="http://www.google.com">http://www.google.com</a>");
ie.field("Search").value("inurl:crossdomain.xml filetype:xml");        
ie.button("Google Search").click();var listOfUrls = topPanel.insert_Left<Panel>(350).add_TreeView();
var fileContents =listOfUrls.insert_Below<Panel>(200).add_SourceCodeViewer();

listOfUrls.afterSelect<string>(
 (selectedUrl)=> {
      listOfUrls.backColor(Color.LightPink);
      Application.DoEvents();
      var html = selectedUrl.uri().getHtml();
      fileContents.set_Text(html);
      listOfUrls.backColor(Color.White);
     });

foreach(var link in ie.links().urls())
 if (link.ends("crossdomain.xml"))
  listOfUrls.add_Node(link,link);

listOfUrls.selectFirst();

return "ok";
 
//O2File:WatiN_IE_ExtensionMethods.cs
//using  O2.XRules.Database.Utils.O2
//O2Ref:WatiN.Core.1x.dll

December 2, 2010 - Posted by | IE Automation, WatiN

No comments yet.

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: