Guest User

Untitled

a guest
Jun 11th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. import sys
  2. import random
  3. import xmpp
  4.  
  5. password = 'nyak123'
  6. nick = sys.argv[1]
  7. resource = 'nyaaaaa'
  8.  
  9. usernames = open('../usernames').readlines()
  10. servers = open('../servers').readlines()
  11.  
  12. conn = None
  13. while True:
  14. try:
  15. username = random.choice(usernames)[:-1]
  16. server = random.choice(servers)[:-1]
  17. jid_str = username +'@'+ server
  18. print('Registering %s...' %jid_str)
  19.  
  20. jid = xmpp.JID(jid_str)
  21. conn = xmpp.Client(jid.getDomain(), debug=[])
  22. conn.connect()
  23. xmpp.features.register(conn, server,
  24. {'username': jid.getNode(),
  25. 'password': password})
  26. if conn.lastErr: continue
  27. if conn.auth(jid.getNode(), password, resource): break
  28. except:
  29. pass
  30.  
  31. print('Set %s to %s' %(nick, jid_str))
  32. conn.send("<iq to='conference.jabber.ru' type='set' id='myuniqid'>"+\
  33. "<query xmlns='jabber:iq:register'>"+\
  34. "<x xmlns='jabber:x:data' type='submit'>"+\
  35. "<title>Nickname Registration at conference.jabber.ru</title>"+\
  36. "<instructions>Enter nickname you want to register</instructions>"+\
  37. "<field var='nick' type='text-single' label='Nickname'>"+\
  38. "<value>%s</value>" %nick +\
  39. "</field>"+\
  40. "</x>"+\
  41. "</query>"+\
  42. "</iq>")
  43. resp = conn.WaitForResponse('myuniqid')
  44. if not resp: print('FAIL: no responce')
  45. elif unicode(resp).find('<error code="409"') != -1: print('FAIL: 409 error')
  46. elif unicode(resp).find('id="myuniqid" type="result">') != -1: print('SUCCESSFUL')
  47. else: print('FAIL: unknown error')
Add Comment
Please, Sign In to add comment