Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import time
- import socket
- import urllib2
- ############################################################################
- #Linux xat bot (for windows as well..)
- #Coded by Dudley / Kondra
- #Command line source: python bot.py -c CHAT ID -n NAME -a AVATAR -h HOMEPAGE
- ############################################################################
- def getBetweenHTML(strSource, strStart,strEnd):
- start = strSource.find(strStart) + len(strStart)
- end = strSource.find(strEnd,start)
- return strSource[start:end]
- def Message(Text):
- import platform
- User = platform.node()
- RootLine = User + ":~$" + " "
- print(RootLine + Text)
- return True
- def GetID(iXat):
- try:
- global ID, K1, K2
- Webpage, Auser3 = 'http://'+iXat+'/web_gear/chat/auser3.php', urllib2.build_opener()
- Auser3.addheaders = [('Referer', 'http://www.google.com/search?q=')]
- Auser3 = Auser3.open(Webpage).read()
- ID,K1,K2 = Auser3.split('&')[1].split('=')[1].strip('_'), Auser3.split('&')[2].split('=')[1], Auser3.split('&')[3].split('=')[1]
- except:
- Message("Failed.")
- time.sleep(100)
- def Send(Sock,Packet,Buffer):
- Sock.send(Packet + "\0")
- Data = Sock.recv(Buffer)
- if Packet.find('<y r="'+Chat+'" v="0" u="'+ID+'" />') != -1:
- from xml.etree.ElementTree import fromstring
- global Attribute
- Attribute = fromstring(Data.strip(chr(0))).attrib
- Message(Data)
- return True
- def SendMessage(Sock,Text):
- Sock.send(Text)
- def Bypass():
- global YM1, YM2, YM3
- YS, YC, YI = int(Attribute['ys']), int(Attribute['yc']), int(Attribute['yi'])
- 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)))
- def Bot(Chat, Nick, Avatar, Homepage):
- GetID("xat.biz")
- Bot_Sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- Bot_Sock.connect(('37.187.46.85', 1204))
- Send(Bot_Sock, '<y r="'+Chat+'" v="0" u="'+ID+'" />', 1024)
- Bypass()
- 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')
- time.sleep(1)
- try:
- import platform
- User2 = platform.node()
- SendMessage(Bot_Sock,'<m u="'+ID+'" t="[Linux Bot@' + User2 + '] :~$ I Have Connected." />\0')
- except:pass
- while 1:
- Data = Bot_Sock.recv(4096)
- print(Data)
- if sys.argv[1].find('-c') != -1:
- Chat = sys.argv[2]
- else:
- print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
- if sys.argv[3].find('-n') != -1:
- Nick = sys.argv[4]
- else:
- print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
- if sys.argv[5].find('-a') != -1:
- Avatar = sys.argv[6]
- else:
- print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
- if sys.argv[7].find('-h') != -1:
- Homepage = sys.argv[8]
- else:
- print("@> Command line error. Please use the following layout: 'python bot.py -c [CHAT NAME] -n [BOT NAME] -a [BOT AVATAR] -h [BOT HOMEPAGE]'")
- print("\n")
- 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')
- Bot(Chat, Nick, Avatar, Homepage)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement