codeblock

2016年3月30日 星期三

Python Challenge level 13

http://www.pythonchallenge.com/pc/return/disproportional.html (logon:huge/file)

- "call him"... click number 5 on the phone, and then a xml error page shows up!
- Google the fault code (105) and knowing that it is a XMLRPC module error. According to http://stackoverflow.com/questions/7950297/faultcode-105-faultstring-xml-error-invalid-document-end-at-line-1-column-1, I should send some "xml request" to this page rather than just browsing the page.
- See also: https://docs.python.org/2/library/xmlrpclib.html
- Use ServerProxy.system.listMethods() to see what can we do for it!

import xmlrpclib
xml_request = xmlrpclib.ServerProxy("http://www.pythonchallenge.com/pc/phonebook.php")
print xml_request.system.listMethods()
- The result is:
['phone', 'system.listMethods', 'system.methodHelp', 'system.methodSignature', 'system.multicall', 'system.getCapabilities']
- "PHONE" !! CALL THE FUNCTION!! And then you will get an error message "Incorrect parameters passed to method." Clearly, we should call somebody here.
- If you try to call an arbitrary name, it will respond "He is not the evil." Then who is the evil? I really had no idea until I googled this riddle for some help. The evil name is revealed in the last level!!
- When I tried to see http://www.pythonchallenge.com/pc/return/evil4.jpg, it showed nothing but a little blank square. The problem is the browser used. If the link is opened by IE or Edge, a message showed up.(Bert is evil! go back!) Let's call Bert.
print xml_request.phone("Bert")
- The answer is:"555-ITALY"(just have to enter "italy")

沒有留言:

張貼留言