-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel_13.py
More file actions
28 lines (22 loc) · 811 Bytes
/
level_13.py
File metadata and controls
28 lines (22 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/env python
# coding=utf-8
# http://huge:file@www.pythonchallenge.com/pc/return/disproportional.html
# Phone that (remote) evil.
import re
import xmlrpc.client
from ftplib import print_line
PREFIX = "http://huge:file@www.pythonchallenge.com/pc/return/"
url = PREFIX + '../phonebook.php'
def solve(url):
print("Looking up Bert(Evil):")
phonebook = xmlrpc.client.ServerProxy(url)
# This line will raise an exception if you're within the Great Firewall (GFW).
response = phonebook.phone('Bert')
whom = re.findall(r'[A-Z]+', response)[0].lower()
print_line(whom)
return whom
if __name__ == "__main__":
answer = solve(url)
# 555-ITALY
print(PREFIX + answer + '.html')
# http://huge:file@www.pythonchallenge.com/pc/return/italy.html