def __init__(self, qqnum, qqpwd): self.socket = RawSocket('113.108.90.53', 8080) if not self.socket.connect(): raise Exception('socket connect error!') #QQ self.qqnum = qqnum self.qqpwd = qqpwd self.vcode = '' self.qqHexstr = Coder.str2hexstr(qqnum) self.pwdMd5 = MD5.md5_hex(qqpwd) self.uin = Coder.qqnum2hexstr(qqnum) self.HEART_INTERVAL = 8*60 #心跳时间间隔 如果在手机QQ上注销/退出帐号后,一般10分钟左右您的QQ号就不会显示在线了 self.server_time = Coder.num2hexstr(int(time.time()), 4) self.alive = False self.verify = False #Android self.seq = 1000 self.appId = Coder.num2hexstr(537042772, 4) self.extBin = Coder.trim('') self.msgCookies = Coder.trim('F9 83 8D 80') self.imei = Coder.str2hexstr('864116195797922') self.ksid = Coder.trim('') self.extBin = Coder.trim('') self.ver = Coder.str2hexstr('|460006202217491|A5.8.0.157158') self.os_type = Coder.str2hexstr('android') self.os_version = Coder.str2hexstr('4.2.2') self.network_type = Coder.str2hexstr('') self.sim_operator_name = Coder.str2hexstr('CMCC') self.apn = Coder.str2hexstr('wifi') self.device = Coder.str2hexstr('Lenovo A820t') self.device_product = Coder.str2hexstr('Lenovo') self.package_name = Coder.str2hexstr('com.tencent.mobileqq') self.wifi_name = Coder.str2hexstr('OOOOOOOOO') #cmd self.loginCmd = Coder.str2hexstr('wtlogin.login') #Keys self.defaultKey = '00'*16 self.randomKey = Coder.genBytesHexstr(16) self.keyId = random.randint(0, len(Keys.pubKeys)-1) self.pubKey = Keys.pubKeys[self.keyId] self.shareKey = Keys.shareKeys[self.keyId] self.pwdKey = Coder.hash_qqpwd_hexstr(qqnum, qqpwd) self.tgtKey = Coder.genBytesHexstr(16) self.sessionKey = '' #debug print 'uin: ', self.uin print 'pwdMd5: ', self.pwdMd5 print 'randomKey: ', self.randomKey print 'pubKey: ', self.pubKey print 'shareKey: ', self.shareKey print 'pwdKey: ', self.pwdKey print 'tgtKey: ', self.tgtKey
def __init__(self, qqnum, qqpwd): self.socket = RawSocket('113.108.90.53', 8080) if not self.socket.connect(): raise Exception('socket connect error!') #QQ self.qqnum = qqnum self.qqpwd = qqpwd self.vcode = '' self.qqHexstr = Coder.str2hexstr(qqnum) self.pwdMd5 = MD5.md5_hex(qqpwd) self.uin = Coder.qqnum2hexstr(qqnum) self.HEART_INTERVAL = 8 * 60 #心跳时间间隔 如果在手机QQ上注销/退出帐号后,一般10分钟左右您的QQ号就不会显示在线了 self.server_time = Coder.num2hexstr(int(time.time()), 4) self.alive = False self.verify = False #Android self.seq = 1000 self.appId = Coder.num2hexstr(537042772, 4) self.extBin = Coder.trim('') self.msgCookies = Coder.trim('F9 83 8D 80') self.imei = Coder.str2hexstr('864116195797922') self.ksid = Coder.trim('') self.extBin = Coder.trim('') self.ver = Coder.str2hexstr('|460006202217491|A5.8.0.157158') self.os_type = Coder.str2hexstr('android') self.os_version = Coder.str2hexstr('4.2.2') self.network_type = Coder.str2hexstr('') self.sim_operator_name = Coder.str2hexstr('CMCC') self.apn = Coder.str2hexstr('wifi') self.device = Coder.str2hexstr('Lenovo A820t') self.device_product = Coder.str2hexstr('Lenovo') self.package_name = Coder.str2hexstr('com.tencent.mobileqq') self.wifi_name = Coder.str2hexstr('OOOOOOOOO') #cmd self.loginCmd = Coder.str2hexstr('wtlogin.login') #Keys self.defaultKey = '00' * 16 self.randomKey = Coder.genBytesHexstr(16) self.keyId = random.randint(0, len(Keys.pubKeys) - 1) self.pubKey = Keys.pubKeys[self.keyId] self.shareKey = Keys.shareKeys[self.keyId] self.pwdKey = Coder.hash_qqpwd_hexstr(qqnum, qqpwd) self.tgtKey = Coder.genBytesHexstr(16) self.sessionKey = '' #debug print 'uin: ', self.uin print 'pwdMd5: ', self.pwdMd5 print 'randomKey: ', self.randomKey print 'pubKey: ', self.pubKey print 'shareKey: ', self.shareKey print 'pwdKey: ', self.pwdKey print 'tgtKey: ', self.tgtKey
def tlvdecode(value): data = value[8:] #去掉头 #TLV18 data = data[8:] data = data[28:] qqnum = data[:8] print qqnum data = data[8:] data = data[8:] #TLV1 value = data[4:] value = value[16:] qqnum = value[:8] value = value[8:] print qqnum value = value[8:] #时间 value = value[12:] print value #TLV106 value1 = value[4:] #01 06 lenstr1 = Coder.hexstr2num(value1[:4]) * 2 str = value1[4:][:lenstr1] print '106加密前', str pwdKey = Coder.hash_qqpwd_hexstr('188075889', 'qw6012827') print 'pwdKey', pwdKey string = TEA.detea_hexstr(str, pwdKey) print '106解密后', string value = string[4:] value = value[8:] value = value[32:] value = value[16:] value = value[10:] pwdmd5 = MD5.md5_hex('qw6012827') print pwdmd5 value = value[32:] tgtKey = value[:32] print 'tgtKey', tgtKey
def __init__(self, qqnum, qqpwd, window): self.window = window # self.ipserver = socket.gethostbyname('msfwifi.3g.qq.com') self.ipserver = '14.215.138.105' self.socket = RawSocket(self.ipserver, 8080) if not self.socket.connect(): raise Exception('socket connect error!') #QQ self.Addvalidation = '你好!' #好友添加验证 self.qqnum = qqnum self.qqpwd = qqpwd self.vcode = '' self.qqHexstr = Coder.str2hexstr(qqnum) self.pwdMd5 = MD5.md5_hex(qqpwd) self.uin = Coder.qqnum2hexstr(qqnum) self.HEART_INTERVAL = 3 * 60 #心跳时间间隔 如果在手机QQ上注销/退出帐号后,一般10分钟左右您的QQ号就不会显示在线了 self.server_time = Coder.num2hexstr(int(time.time()), 4) self.alive = False self.verify = False self.addfriendlist = [] self.friendMsgIDList = [] self.GroupMsgIDList = [] #Android self.seq = 10000 self.appId = Coder.num2hexstr(537042771, 4) self.extBin = Coder.trim('') self.msgCookies = Coder.trim('F9 83 8D 80') self.msgCookies2 = Coder.trim('B6 CC 78 FC') self.imei = Coder.str2hexstr('866413457644252') self.ksid = Coder.trim( '93 AC 68 93 96 D5 7E 5F 94 96 B8 15 36 AA FE 91') self.extBin = Coder.trim('') self.ver = Coder.str2hexstr('5.8.0.157158') self.os_type = Coder.str2hexstr('android') self.os_version = Coder.str2hexstr('4.4.4') self.network_type = Coder.str2hexstr('') self.sim_operator_name = Coder.str2hexstr('CMCC') self.apn = Coder.str2hexstr('wifi') self.device = Coder.str2hexstr('Lenovo A820t') self.device_product = Coder.str2hexstr('Lenovo') self.package_name = Coder.str2hexstr('com.tencent.mobileqq') self.wifi_name = Coder.str2hexstr('OOOOOOOOO') #cmd self.loginCmd = Coder.str2hexstr('wtlogin.login') #Keys self.defaultKey = '00' * 16 self.randomKey = Coder.genBytesHexstr(16) self.keyId = random.randint(0, len(Keys.pubKeys) - 1) self.pubKey = Keys.pubKeys[self.keyId] self.shareKey = Keys.shareKeys[self.keyId] self.pwdKey = Coder.hash_qqpwd_hexstr(qqnum, qqpwd) self.tgtKey = Coder.genBytesHexstr(16) self.sessionKey = '' self.qqkey = '' #debug print 'uin: ', self.uin print 'pwdMd5: ', self.pwdMd5 print 'randomKey: ', self.randomKey print 'pubKey: ', self.pubKey print 'shareKey: ', self.shareKey print 'pwdKey: ', self.pwdKey print 'tgtKey: ', self.tgtKey