Skip to content

Jashwanth33/RAT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Remote Access Tool (Educational)

Python Security License

EDUCATIONAL PURPOSE ONLY - Simplified Remote Access Tool for learning about network security and client-server architecture.

Architecture Overview

`mermaid graph TB subgraph "Server (Controller)" ServerMain[Server Main] CommandCenter[Command Center] ConnectionMgr[Connection Manager] DataProcessor[Data Processor] end

subgraph "Client (Target)"
    ClientMain[Client Main]
    SystemInfo[System Info Module]
    Screenshot[Screenshot Module]
    KeyLogger[Keylogger Module]
    FileMgr[File Manager]
end

subgraph "Communication"
    Socket[TCP Socket]
    Encryption[Encryption Layer]
    Protocol[Custom Protocol]
end

ServerMain --> CommandCenter
ServerMain --> ConnectionMgr
ConnectionMgr --> Socket
Socket --> Encryption
Encryption --> Protocol
Protocol --> Socket
Socket --> ClientMain
ClientMain --> SystemInfo
ClientMain --> Screenshot
ClientMain --> KeyLogger
ClientMain --> FileMgr
SystemInfo --> DataProcessor
Screenshot --> DataProcessor

`

Client-Server Communication Flow

`mermaid sequenceDiagram participant C as Client participant S as Server

S->>C: Connection Request
C-->>S: Connection Established
S->>C: Get System Info
C-->>S: System Information
S->>C: Take Screenshot
C-->>S: Screenshot Data
S->>C: Start Keylogger
C-->>S: Keylogger Started
S->>C: Get Keystrokes
C-->>S: Keystroke Data
S->>C: Upload File
C-->>S: File Received
S->>C: Execute Command
C-->>S: Command Output
S->>C: Disconnect
C-->>S: Connection Closed

`

Command Flow

`mermaid flowchart TD A[User Command] --> B{Command Type}

B -->|System Info| C[Gather System Data]
B -->|Screenshot| D[Capture Screen]
B -->|Keylogger| E[Start/Stop Logger]
B -->|File Ops| F[File Operations]
B -->|Shell| G[Execute Shell Commands]

C --> H[Serialize Data]
D --> H
E --> H
F --> H
G --> H

H --> I[Encrypt Data]
I --> J[Send to Server]
J --> K[Server Receives]
K --> L[Decrypt Data]
L --> M[Display Results]

`

Project Structure

RAT/ │ ├── server/ │ ├── server.py # Main server application │ ├── client_handler.py # Handle client connections │ ├── command_center.py # Command interface │ ├── connection_manager.py # Manage active connections │ ├── data_processor.py # Process received data │ ├── encryption.py # Encryption utilities │ ├── logger.py # Server logging │ └── config.py # Server configuration │ ├── client/ │ ├── client.py # Main client application │ ├── system_info.py # Gather system information │ ├── screenshot.py # Screenshot capture │ ├── keylogger.py # Keylogging module │ ├── file_manager.py # File operations │ ├── shell.py # Shell command execution │ ├── persistence.py # Persistence mechanisms │ ├── encryption.py # Client-side encryption │ ├── connection.py # Server connection │ └── config.py # Client configuration │ ├── shared/ │ ├── protocol.py # Communication protocol │ ├── encryption_utils.py # Shared encryption │ ├── data_structures.py # Data structures │ └── constants.py # Shared constants │ ├── utils/ │ ├── logger.py # Logging utilities │ ├── helpers.py # Helper functions │ └── validators.py # Input validation │ ├── docs/ │ ├── ARCHITECTURE.md # Architecture documentation │ ├── PROTOCOL.md # Protocol specification │ ├── INSTALLATION.md # Installation guide │ └── EDUCATIONAL_NOTES.md # Educational notes │ ├── tests/ │ ├── test_server.py │ ├── test_client.py │ ├── test_protocol.py │ └── test_encryption.py │ ├── configs/ │ ├── server_config.yaml │ └── client_config.yaml │ ├── requirements.txt └── README.md

Features

Module Function Description
System Info get_system_info() OS, CPU, RAM, IP info
Screenshot capture_screen() Take screenshots
Keylogger start_keylogger() Log keystrokes
File Manager upload/download() File transfer
Shell execute_command() Run shell commands
Persistence install_persistence() Maintain access

Communication Protocol

` Message Format: ┌─────────┬─────────┬─────────┬─────────┐ │ Header │ Command │ Length │ Payload │ │ (4 bytes)│ (1 byte)│ (4 bytes)│ (N bytes)│ └─────────┴─────────┴─────────┴─────────┘

Commands: 0x01 - GET_SYSTEM_INFO 0x02 - TAKE_SCREENSHOT 0x03 - START_KEYLOGGER 0x04 - STOP_KEYLOGGER 0x05 - GET_KEYSTROKES 0x06 - UPLOAD_FILE 0x07 - DOWNLOAD_FILE 0x08 - EXECUTE_COMMAND 0x09 - DISCONNECT `

Installation

`�ash

Clone repository

git clone https://github.com/Jashwanth33/RAT.git cd RAT

Install dependencies

pip install -r requirements.txt

Start server

python server/server.py

Start client (on target machine)

python client/client.py --server <server_ip> `

Disclaimer

This tool is for EDUCATIONAL PURPOSES ONLY.

  • This is a simplified version for learning about network security
  • Unauthorized access to computer systems is illegal
  • Always obtain explicit permission before testing
  • The author is not responsible for misuse
  • Use only in controlled lab environments

Learning Objectives

  1. Understanding client-server architecture
  2. Network socket programming
  3. Data serialization and encryption
  4. System information gathering
  5. Process and thread management

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT License - Educational Use Only

Author

Jashwanth - GitHub

About

This is a simplified example for educational purposes only. In a real-world scenario, such tools are often much more complex and include various features for evading detection, encrypting communications, and more.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors