free::zombieJoined: December 6, 2005Status: OfflinePosts: 930Rep:
[xchat IRC plugin] QuakeNet Q challenge-response auth Sat Jul 22, 2006 1:39:56 AM#19278Perm Link
for no particular reason, I decided to go on QuakeNet IRC today and was immediately fascinated by Q
anyway, I wrote a little python xchat plugin that supports Q's Challenge-response auth, a feature which FreeNode's NickServ has not. This way, your password is not sent over the network plain text.
Code
# to autoload, put into the xchat directory, for example as ~/.xchat2/qauth.py
# commands:
# /QAUTH <password> auth to Q via challenge-response on QuakeNet
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation
#
# have fun !
def qauth_cb(word, word_eol, udata):
if len(word) < 2:
print 'You must give a password.'
elif 'quakenet' not in xchat.get_info('server').lower():
print 'You do not seam to be on QuakeNet.'
else:
global pw
pw = word[1]
xchat.command('MSG Q@CServe.quakenet.org CHALLENGE')
return xchat.EAT_ALL
def notice_cb(word, word_eol, udata):
if word[0] == ':Q!TheQBot@CServe.quakenet.org' and word[3] == ":CHALLENGE":
if word[4] != "MD5":
print "Q wants me to use the unknown hashing algorithm %s."
print "You may want to update qauth.py."
else:
global pw
xchat.command('MSG Q@CServe.quakenet.org CHALLENGEAUTH %s %s'
% (word[2], md5(pw+' '+word[5]).hexdigest()))
pw = ''
xchat.hook_command('QAUTH', qauth_cb,
help='/QAUTH <passwd> auth to Q via challenge-response on QuakeNet')
xchat.hook_server('NOTICE', notice_cb)