Created
August 28, 2012 17:06
-
-
Save eskerda/3500815 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import urllib | |
| import hashlib | |
| import requests | |
| from shaext import shaext | |
| """ | |
| http://www.vnsecurity.net/2010/03/codegate_challenge15_sha1_padding_attack/ | |
| - shaext.py | |
| - code from sha-padding.py | |
| """ | |
| known_message = "count=2&lat=37.351&user_id=1&long=-119.827&waffle=chicken" | |
| known_signature = "b017049dd1ce7db05aab96bee0b79e35b9e5bbd2" | |
| endpoint = "https://level07-2.stripe-ctf.com/user-jgpxxqxwhd/" | |
| secret_len = 14 | |
| exp_data = "&waffle=liege&user=5&lat=999&lng=999&count=42" | |
| def main(): | |
| padding = shaext(known_message, secret_len, known_signature) | |
| padding.add(exp_data) | |
| (new_msg, new_sig)= padding.final() | |
| sig_msg = "%s|sig:%s" % (new_msg, new_sig) | |
| req = requests.post("%s/%s" % (endpoint, 'orders'), data=sig_msg) | |
| print req.text | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment