Skip to content

Instantly share code, notes, and snippets.



Last active Feb 24, 2017
What would you like to do?
from monkeypatcher import patch
import socket
import urllib2
def recv_wrapper(bufsize, flags=None):
ciphertext = recv_original(bufsize, flags)
print('Captured ciphertext data: %s' % (ciphertext))
return ciphertext
interceptor, recv_original = patch.intercept((socket, 'recv'))
f = urllib2.urlopen('')
plaintext =
print('Plaintext data: %s' % plaintext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment