usr bin python from socket import from time import from select import

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python
from socket import *
from time import *
from select import *
HOST='69.49.123.241'
sock = socket(AF_INET,SOCK_STREAM)
sock.connect((HOST,110))
sock.send('user *****\npass *****\nlist\nretr 1\n')
sock.setblocking(0)
while 1:
ready_to_read, ready_to_write, in_error = select([sock],[],[],2)
if sock in ready_to_read:
data = sock.recv(1024)
print data
else:
break
sock.close()