Guest User

Python Challenge #1 Solution

a guest
Jun 14th, 2016
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.49 KB | None | 0 0
  1. #!usr/bin/python
  2. #+------------------------------------------- +
  3. #| A Simple Dashboard | Created by Ahsan Tahir|
  4. #+--------------------------------------------+
  5. # This tool is purely coded by Ahsan Tahir, copying of this tool is prohibited.
  6. # This is a simple offline dashboard, which contains some functions like:
  7. # 1. l33t Name Generator
  8. # 2. XSS Payload Generator
  9. # 3. See Your Account information
  10.  
  11. from colorama import init
  12. from termcolor import colored
  13.  
  14. xssbanner = '''
  15. +-----------------------+
  16. | XSS PAYLOAD GENERATOR |
  17. | BY AHSAN TAHIR |
  18. +-----------------------+
  19. '''
  20. infobanner = '''
  21. +-------------+
  22. | INFORMATION |
  23. +-------------+
  24. '''
  25.  
  26. #DATABASE - Mind it, this is not sql .. lol
  27. usrname = "ahsan"
  28. paswd = "h4x0r"
  29. email = "mrahsan1337@gmail.com"
  30. name = "Ahsan Tahir"
  31. age = str(14)
  32. country = "Pakistan"
  33. city = "Karachi"
  34.  
  35. print("+--------------------------------------------+")
  36. print("| __ __ _ |")
  37. print("| \ \ / / | | |")
  38. print("| \ \ /\ / /__| | ___ ___ _ __ ___ __ |")
  39. print("| \ \/ \/ / _ \ |/ __/ _ \| '_ ` _ \ / _ \|")
  40. print("| \ /\ / __/ | (_| (_) | | | | | | __/|")
  41. print("| \/ \/ \___|_|\___\___/|_| |_| |_|\___||")
  42. print("| |")
  43. print("+------------------------------------------- +")
  44. print("| A Simple Dashboard | Created by Ahsan Tahir|")
  45. print("+--------------------------------------------+")
  46. print("\n")
  47. init()
  48. print("+-----------------------------------+")
  49. print(colored("|PLEASE FIRST LOGIN TO YOUR ACCOUNT|", 'red'))
  50. init()
  51. print("+-----------------------------------+")
  52. def userinput():
  53. userinput1 = raw_input("Please Enter Your Username:\n>")
  54. userinput2 = raw_input("Please Enter Your Password:\n>")
  55. validiate(userinput1,userinput2)
  56. def validiate(username,password):
  57. if username == usrname and paswd == password:
  58. init()
  59. print(colored(" [!] Login Successful! You have been logged in as Ahsan Tahir\n [!] WELCOME TO DASHBOARD\n", 'green'))
  60. else:
  61. print(colored(" [!] Incorrect Username/Password Combination", 'red'))
  62. exit()
  63. init()
  64. userinput()
  65.  
  66. init()
  67. print (colored("[[ L33T NAME GENERATOR ]]", 'cyan'))
  68. init()
  69. name = raw_input("Please enter your name:\n> ")
  70. leetname = name
  71. leetwords = "tseaio"
  72. for letter in name:
  73. if letter in leetwords:
  74. leetname = leetname.replace('a', str(4))
  75. leetname = leetname.replace('e', str(3))
  76. leetname = leetname.replace('i', '!')
  77. leetname = leetname.replace('o', str(0))
  78. leetname = leetname.replace('t', str(7))
  79. leetname = leetname.replace('s', '5')
  80. print("Your leet name: "+str(leetname))
  81. print("You have successfully generated your l33t name, whcih is "+leetname+".")
  82. print ("\n")
  83. option = raw_input(("What you want to do further? \n 1. Try our latest XSS payload generator. \n 2. See your account information. \n 3. Logout without doing anything. \n>"))
  84. if option == str(1):
  85. print (xssbanner)
  86. name = raw_input("Please Enter Your Name:\n>")
  87. init()
  88. print("[+] Your payload: "+colored("<script>alert(/xss-by-%s/);</script>", 'green')) % (name)
  89. elif option == str(2):
  90. print(infobanner)
  91. print(colored("Your Name: ", 'cyan'))+name
  92. print(colored("Your Age: ", 'cyan'))+age
  93. print(colored("Your Username: ", 'cyan'))+usrname
  94. print(colored("Your Email: ", 'cyan'))+email
  95. print(colored("Your Country: ", 'cyan'))+country
  96. print(colored("Your City: ", 'cyan'))+city
  97. elif option == str(3):
  98. init()
  99. print (colored("You have been logged out!", 'red'))
  100. exit()
Add Comment
Please, Sign In to add comment