12.07.2015 Views

Bug Hunter Diary

Bug Hunter Diary

Bug Hunter Diary

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Step 2: Test the Exported Methods in the BrowserAfter I generated lists of the available objects and exported methods,I wrote a little HTML file that calls the NewObject() method with thehelp of VBScript:01 02 WebEx PoC 103 04 05 06 arg = String(12, "A")07 obj.NewObject arg08 09 10 Listing 5-1: HTML file to call the NewObject() method (webex_poc1.html )In line 4 of Listing 5-1, the object with GUID or ClassID {32E26FD9-F435-4A20-A561-35D4B987CFDC} is instantiated. In line 7 the NewObject()method is called with a string value of 12 As as a parameter.To test the HTML file, I implemented a little web server in Pythonthat would serve the webex_poc1.html file to the browser (see Listing 5-2):01 import string,cgi02 from os import curdir, sep03 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer0405 class WWWHandler(BaseHTTPRequestHandler):0607 def do_GET(self):08 try:09 f = open(curdir + sep + "webex_poc1.html")1011 self.send_response(200)12 self.send_header('Content-type', 'text/html')13 self.end_headers()14 self.wfile.write(f.read())15 f.close()1617 return1819 except IOError:20 self.send_error(404,'File Not Found: %s' % self.path)2122 def main():23 try:24 server = HTTPServer(('', 80), WWWHandler)25 print 'server started'26 server.serve_forever()74 Chapter 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!