Created
December 30, 2012 20:07
-
-
Save richmidwinter/4414813 to your computer and use it in GitHub Desktop.
A fake POP3 server in python which prints authentication details.
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
#!/usr/bin/env python | |
import socket | |
c = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
c.bind(('192.168.1.100',110)) | |
c.listen(1) | |
while 1: | |
csock, caddr = c.accept() | |
cfile = csock.makefile('rw', 0) | |
print "Connection accepted." | |
cfile.write("+OK POP3 PROXY server ready mail.server.com\r\n") | |
line = cfile.readline().strip() | |
print "USER: " + line | |
cfile.write("+OK Password required\r\n") | |
line = cfile.readline().strip() | |
print "PASS: " + line |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment