Created
January 23, 2013 14:40
-
-
Save W3ird-N3rd/4606776 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
#!/usr/bin/env python | |
# This script is public domain | |
import socket | |
import re | |
import sys | |
if len(sys.argv) < 3: | |
print("Usage: {} <username> <password>".format(sys.argv[0])) | |
sys.exit(1) | |
r = re.compile("(\d+) bytes", re.I) | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
f = s.makefile() | |
s.connect(("news.ziggo.nl", 119)) | |
f.readline() | |
s.send("AUTHINFO USER {}\r\n".format(sys.argv[1])) | |
f.readline() | |
s.send("AUTHINFO PASS {}\r\n".format(sys.argv[2])) | |
msg = f.readline() | |
s.send("QUIT\r\n") | |
f.readline() | |
s.close() | |
m = r.findall(msg) | |
if m: | |
print(m[0]) | |
else: | |
print(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment