Skip to content

Instantly share code, notes, and snippets.

View joneskoo's full-sized avatar

Joonas Kuorilehto joneskoo

View GitHub Profile
@joneskoo
joneskoo / gist:812505
Created February 5, 2011 15:05
ident-lookup.py
#!/usr/bin/env python
# Ident lookup for incoming connections
# RFC 1413 - Identification Protocol
import socket
def lookup_ident(host, server_port, client_port):
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
s.settimeout(1)
try:
s.connect((host, 113))