Share
## https://sploitus.com/exploit?id=8500BAF9-23C5-5C44-8A76-CE7621B96BA9
# MediGuard Remote Monitoring System

A secure medical device monitoring dashboard built with Next.js 12.2 that includes authentication and advanced monitoring features.

## Features

- Secure authentication system
- Protected admin dashboard
- System monitoring interface
- Medical device health checks
- User profile management
- Modern and responsive UI
- Docker support
- Offline mode support
- Automatic service recovery

## About

MediGuard is a simulated healthcare monitoring system designed to remotely track and manage medical equipment. This application showcases a proof-of-concept for a dashboard that could be used in healthcare environments to monitor critical devices like ventilators, infusion pumps, and patient monitors.

## Security Warning

> โš ๏ธ **IMPORTANT**: This application contains an intentionally vulnerable health check feature for educational purposes. In a real medical application, proper security measures would be implemented.

## Prerequisites

- Node.js 16 or later
- Docker (optional)

## Online Setup

1. Clone the repository
2. Install dependencies:
   ```bash
   npm install
   ```

3. Create a `.env.local` file in the root directory with the following content:
   ```
   JWT_SECRET=your-secret-key-here
   ```

4. Run the development server:
   ```bash
   npm run dev
   ```

## Offline Setup

This application can be prepared for use on a machine without internet access. See [OFFLINE.md](OFFLINE.md) for detailed instructions.

Quick steps:
```bash
npm install
npm run prepare-offline
```

Then transfer the entire project directory to the offline machine and run:
```bash
npm run start
```

## Docker Setup

1. Build the Docker image:
   ```bash
   docker build -t mediguard .
   ```

2. Run the container:
   ```bash
   docker run -p 3000:3000 -v /home/local.txt:/home/local.txt mediguard
   ```

## Automated Setup (Ubuntu)

For Ubuntu systems, you can use the provided setup script to install and configure the application as a systemd service:

```bash
sudo ./setup.sh
```

This script will:
1. Install Docker if not already installed
2. Build the Docker image
3. Create a systemd service for automatic startup and recovery
4. Mount `/home/local.txt` from the host into the container

Once installed, the service will:
- Start automatically on system boot
- Restart automatically if it crashes
- Be accessible at http://localhost:3000

To manage the service:
```bash
sudo systemctl status mediguard  # Check status
sudo systemctl stop mediguard    # Stop the service
sudo systemctl start mediguard   # Start the service
sudo systemctl restart mediguard # Restart the service
```

## Cleanup

If you need to completely remove the application and all its components, use the cleanup script:

```bash
sudo ./clean.sh
```

This script will:
1. Stop and remove the systemd service
2. Stop and remove the Docker container
3. Remove the Docker image
4. Clean up any remaining Docker resources

## Usage

1. Access the application at `http://localhost:3000` (will automatically redirect to login)
2. Login with the following credentials:
   - Username: `admin`
   - Password: `SecDksjspxs5s1s!%S%S%&&p`

3. Once logged in, you'll have access to:
   - Dashboard overview
   - Device health checks
   - System monitoring
   - User profile management

## Educational Purpose

This application is designed for educational purposes to demonstrate:
1. Building a secure admin panel
2. Implementing authentication
3. Creating a professional UI for critical systems
4. Demonstrating common security vulnerabilities

## License

MIT