Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. import requests
  2. from termcolor import colored
  3. def get_password_chapter_a(url, start_file, end_file, secret_letter_loc):
  4.     password_chars_list = list()
  5.     for file_num in range(start_file, end_file + 1):
  6.         file_request_url = url + 'file' + str(file_num) + '.nfo'
  7.         resp = requests.get(file_request_url)
  8.         print((colored(f"FILE #{file_num}\n", 'blue')),
  9.               f"{resp.text}")
  10.         password_chars_list.append(resp.text[secret_letter_loc - 1])
  11.     secret_password = ''.join(password_chars_list)
  12.     return secret_password
  13.     # return sorted(secret_password)
  14.  
  15.  
  16. def main():
  17.     START_FILE = 11
  18.     END_FILE = 34
  19.     SECRET_LETTER_LOC = 100
  20.     URL = "http://webisfun.cyber.org.il/nahman/files/"
  21.     password_a = get_password_chapter_a(URL, START_FILE, END_FILE, SECRET_LETTER_LOC)
  22.     print(colored(password_a, 'green'))
  23.  
  24. if __name__ == '__main__':
  25.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement