2007/06/15
whois
by
菊地時夫
—
posted at
2007-06-15 07:56
last modified
2007-06-15 07:56
whois.py 試作
#!/usr/bin/env python # whois.py ... simulate whois command import sys import socket CRLF = '\r\n' topserver = ('whois.arin.net', 43) def whois(server, query): s = socket.socket() s.connect(server) s.send(query + CRLF) r = '' while True: data = s.recv(1024) if not data: break r += data return r if __name__ == '__main__': query = sys.argv[1] r = whois(topserver, query) print r
FreeBSDのwhois をそっくり実装できるといいなぁ。
参考:Pythonオンラインマニュアル, RFC の他、ASPN など。
- Category(s)
- なんでも
- The URL to Trackback this entry is:
- http://sango.lab.tkikuchi.net/Members/tkikuchi/30e130e2/whois/tbping
- LOL
- ¦
- Main
- ¦
- DDoS で「みかじめ料」