Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import random
- import xmpp
- password = 'nyak123'
- nick = sys.argv[1]
- resource = 'nyaaaaa'
- usernames = open('../usernames').readlines()
- servers = open('../servers').readlines()
- conn = None
- while True:
- try:
- username = random.choice(usernames)[:-1]
- server = random.choice(servers)[:-1]
- jid_str = username +'@'+ server
- print('Registering %s...' %jid_str)
- jid = xmpp.JID(jid_str)
- conn = xmpp.Client(jid.getDomain(), debug=[])
- conn.connect()
- xmpp.features.register(conn, server,
- {'username': jid.getNode(),
- 'password': password})
- if conn.lastErr: continue
- if conn.auth(jid.getNode(), password, resource): break
- except:
- pass
- print('Set %s to %s' %(nick, jid_str))
- conn.send("<iq to='conference.jabber.ru' type='set' id='myuniqid'>"+\
- "<query xmlns='jabber:iq:register'>"+\
- "<x xmlns='jabber:x:data' type='submit'>"+\
- "<title>Nickname Registration at conference.jabber.ru</title>"+\
- "<instructions>Enter nickname you want to register</instructions>"+\
- "<field var='nick' type='text-single' label='Nickname'>"+\
- "<value>%s</value>" %nick +\
- "</field>"+\
- "</x>"+\
- "</query>"+\
- "</iq>")
- resp = conn.WaitForResponse('myuniqid')
- if not resp: print('FAIL: no responce')
- elif unicode(resp).find('<error code="409"') != -1: print('FAIL: 409 error')
- elif unicode(resp).find('id="myuniqid" type="result">') != -1: print('SUCCESSFUL')
- else: print('FAIL: unknown error')
Add Comment
Please, Sign In to add comment