password-task.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import os,threading
  2. numb = ['0','1','2','3','4','5','6','7','8','9',
  3. 'a','b','c','d','e','f','g','h',
  4. 'i','j','k','l','m','n','o','p',
  5. 'q','r','s','t','u','v','w','x','y','z']
  6. def calc_pass(first=0,laster=0):
  7. # print('thread start :'+first)
  8. for s in numb:
  9. #passwd.append(fi+s)
  10. for t in numb:
  11. #passwd.append(fi+s+t)
  12. for four in numb:
  13. if os.popen('./server -u 11 -g 10 -p '+s+t+four).readline()!='WRONG PASSWORD!\n':
  14. print(+s+t+four)
  15. break
  16. if __name__ == '__main__':
  17. map(lambda first:threading.Thread(target=calc_pass, args=(0,"0")).start(),numb)
  18. # 最终版本
  19. import os
  20. import threading
  21. numb = ['0','1','2','3','4','5','6','7','8','9',
  22. 'a','b','c','d','e','f','g','h',
  23. 'i','j','k','l','m','n','o','p',
  24. 'q','r','s','t','u','v','w','x','y','z']
  25. def calc_pass(first='0',laster=0):
  26. # print('thread start :'+first)
  27. for s in numb:
  28. #passwd.append(fi+s)
  29. for t in numb:
  30. if os.popen('./server -u 114 -g 18 -p '+first+s+t).readline()!='WRONG PASSWORD!\n':
  31. print(first+s+t)
  32. break
  33. if __name__ == '__main__':
  34. map(lambda first:threading.Thread(target=calc_pass, args=(first,"0")).start(),numb)