Skip to content

Instantly share code, notes, and snippets.

@dionyziz
Last active February 24, 2017 21:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dionyziz/5bf3857f2687a357536d44724b8a8879 to your computer and use it in GitHub Desktop.
Save dionyziz/5bf3857f2687a357536d44724b8a8879 to your computer and use it in GitHub Desktop.
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'))
interceptor.bind(recv_wrapper)
f = urllib2.urlopen('https://ruptureit.com/test2.php?reflection=xxx')
plaintext = f.read()
print('Plaintext data: %s' % plaintext)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment