Skip to content

About

client điều khiển máy server, GUI trên web. ĐỒ án thực hành kiến thức websocket

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebRAT - Remote Administration Tool

A modern, full-stack remote administration platform built with .NET 8.0 and React, featuring real-time monitoring, process management, and multimedia streaming capabilities.

⚠️ DISCLAIMER: This software is for educational and authorized security testing purposes only. Unauthorized access to computer systems is illegal. Use responsibly and only on systems you own or have explicit permission to monitor.

🚀 Features

  • Multi-Target: Control multiple targets simultaneously
  • System Info: Real-time system information
  • Process Manager: Real-time process monitoring and termination
  • App Manager: Management of active window applications
  • File Manager: Remote file system browsing, upload, download, and deletion
  • Remote Shell: Interactive CMD and PowerShell execution
  • Audio Surveillance: Dual-channel capturing (Microphone & System Audio)
  • Real-time Streaming:
    • Screen Capture (Optimized JPEG stream)
    • Webcam Streaming (Adaptive resolution/FPS)
  • Recordings: Recordings of screen, webcam, and audio
  • System Power: Remote Shutdown, Restart, Sleep, and Monitor control
  • Keylogger: Live keystroke capturing and history
  • Real-time Communication: SignalR-based low-latency control

📋 Prerequisites

Before you begin, ensure you have the following installed:

  • .NET 8.0 SDK (for Backend & Agent)
  • Node.js 18+ (for Frontend)
  • npm or yarn (comes with Node.js)
  • Git (for cloning the repository)
  • Windows OS (required for Agent components due to AForge and Windows-specific APIs)

Optional:

  • Visual Studio 2022 or VS Code with C# extensions
  • Webcam (for webcam streaming feature)

📦 Installation

1. Clone the Repository

git clone https://github.com/NguyenDuyHao-cheems/Project_Malware_Web.git
cd Project_Malware_Web

2. Backend Setup

cd Backend
dotnet restore
dotnet build

3. Agent Setup

cd ../Agent
dotnet restore
dotnet build

Note: The Agent uses Windows-specific libraries (AForge.Video.DirectShow, System.Drawing.Common) and requires Windows to run.

4. Frontend Setup

cd ../Frontend
npm install

🏃 Running the Application

You need to run all three components simultaneously. Open 3 separate terminal windows:

Terminal 1: Backend (SignalR Hub)

cd Backend
dotnet run

The backend will start on http://localhost:5000

Terminal 2: Agent (Target Machine)

cd Agent
dotnet run

The agent will automatically connect to the backend hub.

Terminal 3: Frontend (Admin Interface)

cd Frontend
npm run dev

The frontend will start on http://localhost:3000

Open your browser and navigate to http://localhost:3000 to access the admin dashboard.

📦 Building for Deployment

To run the Agent on a target machine without installing the .NET SDK, you must publish it as a self-contained executable.

Publish Agent

cd Agent
dotnet publish -c Release -r win-x64 --self-contained -p:PublishSingleFile=true

The executable will be located at: Agent/bin/Release/net8.0/win-x64/publish/Agent.exe

🎮 Quick Deployment Guide

To control another computer (Target):

  1. Host Function (Your PC):

    • Ensure Backend is running (http://<YOUR_IP>:5000)
    • Ensure Frontend is running (http://localhost:3000)
  2. Client Function (Target PC):

    • Copy the published Agent.exe to the target computer.
    • Double-click the Agent.exe to run it.
    • Typing the ip of admin to connect to the backend hub.
  3. Control:

    • Open your dashboard at http://localhost:3000. The new agent should appear in the connection list.

🏗️ Project Structure

Project_Malware_Web/
├── Backend/                    # ASP.NET Core SignalR Hub
│   ├── Controllers/           # API controllers (Security/BlockList)
│   ├── Hubs/                  # SignalR Hub (RatHub.cs)
│   ├── Middleware/            # BlockList middleware
│   ├── Models/                # Data models (MachineInfo, etc.)
│   └── Services/              # Business logic services
├── Agent/                      # .NET Console Application (Target)
│   ├── Services/              # Core services
│   │   ├── CommandExecutor.cs    # Process/App management
│   │   ├── KeyloggerService.cs   # Keyboard hooking
│   │   ├── ScreenService.cs      # Screen capture
│   │   └── WebcamService.cs      # Webcam streaming
│   └── Program.cs             # Main entry + SignalR handlers
└── Frontend/                   # React + Vite SPA
    ├── src/
    │   ├── components/        # React components
    │   │   └── Dashboard.jsx     # Main admin UI
    │   ├── services/          # SignalR client setup
    │   └── App.jsx            # Root component
    └── package.json

🔧 Configuration

Backend Configuration

Edit Backend/appsettings.json if needed:

{
  "Logging": {
    "LogLevel": {
      "Default": "Information"
    }
  },
  "AllowedHosts": "*"
}

Frontend Configuration

The frontend connects to http://localhost:5000/rathub by default. To change this, edit:

Frontend/src/services/signalr.js

const connection = new HubConnectionBuilder()
  .withUrl("http://localhost:5000/rathub")
  .build();

Agent Configuration

The agent connects to http://localhost:5000/rathub by default. To change this, edit:

Agent/Program.cs (line 9)

static string _hubUrl = "http://localhost:5000/rathub";

🎯 Usage Guide

  1. Start all three services (Backend, Agent, Frontend)
  2. Open the admin dashboard at http://localhost:3000
  3. Select a connected agent from the list (your agent should appear automatically)
  4. Navigate between tabs:
    • Controls: Basic controls and keylog viewer
    • Applications: Manage GUI applications
    • Processes: View and manage all processes
    • Streaming: Screen and webcam live feeds

Available Actions:

Process Manager

  • View all processes with PID, Name, and Thread Count
  • Kill any process by PID
  • Refresh process list in real-time
  • Start a new process by name or path
  • Search for a process by name

App Manager

  • List all applications with GUI windows
  • Start new applications (e.g., "notepad", "calc")
  • Kill running applications

Streaming

  • Start/Stop screen capture
  • Start/Stop webcam streaming (requires connected webcam)
  • Listen to System Audio/Microphone

Recordings

  • Start/Stop screen recording
  • Start/Stop webcam recording
  • Start/Stop audio recording

File Manager

  • Browse drives and directories
  • Download files

Remote Shell

  • Execute commands via CMD/PowerShell
  • View real-time output

System Control

  • Shutdown, Restart

🛠️ Troubleshooting

Got a blank Frontend page

Solution: turn off extension uBlock Origin

Port Already in Use

Error: Failed to bind to address http://127.0.0.1:5000: address already in use

Solution: Kill the process using port 5000 or change the port in Backend/Properties/launchSettings.json

Agent Won't Connect

  • Ensure the Backend is running first
  • Check that the _hubUrl in Agent/Program.cs matches your backend URL
  • Verify firewall settings aren't blocking the connection

Webcam Not Working

  • Ensure you have a webcam connected
  • Grant camera permissions when prompted
  • Check that no other application is using the webcam

npm Install Fails

# Clear npm cache
npm cache clean --force
rm -rf node_modules package-lock.json
npm install

📚 Technology Stack

Component Technologies
Backend ASP.NET Core 8.0, SignalR, C#
Agent .NET 8.0, AForge.Video.DirectShow, System.Drawing
Frontend React 18, Vite 5, @microsoft/signalr
Communication SignalR WebSockets
Streaming JPEG compression, Base64 encoding

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is for educational purposes only. Use at your own risk.

⚠️ Legal Notice

This software is designed for:

  • Educational purposes
  • Authorized security testing
  • System administration on systems you own

Unauthorized access to computer systems is illegal. Always obtain proper authorization before deploying or testing this software.

👨‍💻 Author

Nguyen Duy Hao
Bui Dang Kha Tuan
Vo Nguyen Viet Hoang

🙏 Acknowledgments

  • Built with assistance from Antigravity AI
  • Inspired by modern RAT architectures

Star ⭐ this repository if you found it helpful!

About

client điều khiển máy server, GUI trên web. ĐỒ án thực hành kiến thức websocket

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages