Advertisement
dopeFox

xat.biz bot

Dec 18th, 2014
930
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.53 KB | None | 0 0
  1. import sys
  2. import time
  3. import socket
  4. import urllib2
  5. ############################################################################
  6. #Linux xat bot (for windows as well..)
  7. #Coded by Dudley / Kondra
  8. #Command line source: python bot.py -c CHAT ID -n NAME -a AVATAR -h HOMEPAGE
  9. ############################################################################
  10. def getBetweenHTML(strSource, strStart,strEnd):
  11.     start = strSource.find(strStart) + len(strStart)
  12.     end = strSource.find(strEnd,start)
  13.     return strSource[start:end]
  14. def Message(Text):
  15.     import platform
  16.     User = platform.node()
  17.     RootLine = User + ":~$" + " "
  18.     print(RootLine + Text)
  19.     return True
  20. def GetID(iXat):
  21.     try:
  22.         global ID, K1, K2
  23.         Webpage, Auser3 = 'http://'+iXat+'/web_gear/chat/auser3.php', urllib2.build_opener()
  24.         Auser3.addheaders = [('Referer', 'http://www.google.com/search?q=')]
  25.         Auser3 = Auser3.open(Webpage).read()
  26.         ID,K1,K2  = Auser3.split('&')[1].split('=')[1].strip('_'), Auser3.split('&')[2].split('=')[1], Auser3.split('&')[3].split('=')[1]
  27.     except:
  28.         Message("Failed.")
  29.         time.sleep(100)
  30. def Send(Sock,Packet,Buffer):
  31.     Sock.send(Packet + "\0")
  32.     Data = Sock.recv(Buffer)
  33.     if Packet.find('<y r="'+Chat+'" v="0" u="'+ID+'" />') != -1:
  34.         from xml.etree.ElementTree import fromstring
  35.         global Attribute
  36.         Attribute = fromstring(Data.strip(chr(0))).attrib
  37.     Message(Data)
  38.     return True
  39. def SendMessage(Sock,Text):
  40.     Sock.send(Text)
  41. def Bypass():
  42.     global YM1, YM2, YM3
  43.     YS, YC, YI = int(Attribute['ys']), int(Attribute['yc']), int(Attribute['yi'])
  44.     YM1, YM2, YM3 = str(int(2 << (YI % 30)) % YC + YI), str(int(pow(2, int(Attribute['ys']) % 32))), str(int(pow(2, int(Attribute['ys']) % 32)))
  45. def Bot(Chat, Nick, Avatar, Homepage):
  46.     GetID("xat.biz")
  47.     Bot_Sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  48.     Bot_Sock.connect(('37.187.46.85', 1204))
  49.     Send(Bot_Sock, '<y r="'+Chat+'" v="0" u="'+ID+'" />', 1024)
  50.     Bypass()
  51.     Bot_Sock.send('<j2 cb="'+str(time.time())+'" Y="2" ym1="'+str(YM1)+'" ym2="'+str(YM2)+'" ym3="'+str(YM3)+'" y="'+Attribute['yi']+'" k="'+K1+'" p="0" c="'+Chat+'" f="0" u="'+ID+'" n="'+Nick+'" a="'+Avatar+'" h="'+Homepage+'" v="0" />\0')
  52.     time.sleep(1)
  53.     try:
  54.         import platform
  55.         User2 = platform.node()
  56.         SendMessage(Bot_Sock,'<m u="'+ID+'" t="[Linux Bot@' + User2 + '] :~$ I Have Connected." />\0')
  57.     except:pass
  58.     while 1:
  59.         Data = Bot_Sock.recv(4096)
  60.         print(Data)
  61. if sys.argv[1].find('-c') != -1:
  62.     Chat = sys.argv[2]
  63. else:
  64.     print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
  65. if sys.argv[3].find('-n') != -1:
  66.     Nick = sys.argv[4]
  67. else:
  68.     print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
  69. if sys.argv[5].find('-a') != -1:
  70.     Avatar = sys.argv[6]
  71. else:
  72.     print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
  73. if sys.argv[7].find('-h') != -1:
  74.     Homepage = sys.argv[8]
  75. else:
  76.     print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
  77. print("\n")
  78. print('\033[1;35m\033[0m \033[1;31mLinux\033[0m \033[1;32mpython\033[0m \033[1;33mxat\033[0m \033[1;36mbot\033[0m')
  79. Bot(Chat, Nick, Avatar, Homepage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement