Advertisement
Guest User

Untitled

a guest
Aug 14th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. #! /usr/bin/env python
  2.  
  3. import requests, sys
  4.  
  5.  
  6.  
  7. def s01v3():
  8. username = sys.argv[1]
  9. password = sys.argv[2]
  10.  
  11. s = requests.session()
  12. url = 'https://www.hackthis.co.uk/auth.php?login'
  13. data = {'username': username,
  14. 'password': password}
  15. s.post(url, data=data)
  16. string = s.get('https://www.hackthis.co.uk/levels/coding/1').content.split('<textarea>')[1].split('</textarea>')[0]
  17.  
  18. data = string.split(', ')
  19. data.sort()
  20.  
  21. a = []
  22.  
  23. for i in data:
  24. a.append(i)
  25.  
  26. flag = ', '.join(a)
  27.  
  28. answer = {'answer': flag}
  29.  
  30. print '''
  31. ___________________
  32. < pr0bl3m s01v3d :> >
  33. -------------------
  34. \ ____________
  35. \ |__________|
  36. / /\\
  37. / / \\
  38. /___________/___/|
  39. | | |
  40. | ==\ /== | |
  41. | O O | \ \ |
  42. | < | \ \|
  43. /| | \ \\
  44. / | \_____/ | / /
  45. / /| | / /|
  46. /||\| | /||\/
  47. -------------|
  48. | | | |
  49. <__/ \__>
  50.  
  51. '''
  52.  
  53. s.close()
  54.  
  55.  
  56. if __name__ == "__main__":
  57. try:
  58. s01v3()
  59. except IndexError:
  60. print 'python s01v3.py \'username\' \'password\''
  61.  
  62. # s01v3(username, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement