Skip to content

disWhat/SimpleChatApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple chatApp as offsec playground

A Python-based text messaging chat application designed as a beginner's playground for offensive security learning. This application demonstrates network communication concepts through detailed OSI layer analysis while providing end-to-end encrypted messaging between clients.

🎯 Purpose

This project serves as an educational tool for beginners in offensive security to understand:

  • Network communication protocols and the OSI model
  • End-to-end encryption implementation and analysis
  • Client-server architecture vulnerabilities
  • Real-time network traffic analysis
  • Process management and system monitoring

⚡ Quick Start

Prerequisites

  • Python 3.7+
  • Required packages: psutil>=5.9.0

Installation & Launch

# Clone the repository
git clone https://github.com/disWhat/SimpleChatApp.git
cd chatApp

# Install dependencies
pip install -r requirements.txt

# Start the complete application (server + 2 clients)
python main.py

This will automatically:

  • Start a TCP server on port 8888
  • Launch two client GUI windows
  • Begin real-time OSI layer analysis
  • Enable end-to-end encryption by default

🛠️ Features

Core Components

  • TCP Server: Routes messages between clients (port 8888)
  • GUI Clients: Dracula-themed interface with chat and analysis tabs
  • OSI Analysis: Real-time tracking through all 7 network layers
  • E2E Encryption: XOR + Base64 encryption with toggle controls
  • System Monitoring: CPU, memory, and network statistics via psutil

Security Features

  • End-to-end encryption (server cannot decrypt messages)
  • Encryption status synchronization between clients
  • Real-time encryption analysis in OSI layer display
  • Process isolation and cleanup mechanisms

📊 Educational Value

For Offensive Security Beginners

  • Network Analysis: Understand how messages flow through OSI layers
  • Encryption Understanding: Learn basic encryption/decryption concepts
  • Process Management: See how applications manage system resources
  • Traffic Analysis: Real-time monitoring of network communications
  • Vulnerability Research: Analyze client-server communication patterns

Analysis Capabilities

  • Layer-by-layer packet analysis simulation
  • Encryption algorithm detection and analysis
  • System resource monitoring during communications
  • Network interface statistics tracking
  • Process and connection management

🚀 Usage Examples

Individual Components

# Start server only
python app/server.py

# Start individual client
python app/client.py ClientName

Testing & Analysis

# Test encryption functionality
python tests/test_encryption.py

# Test live encryption with server
python tests/test_live_encryption.py

# Test encryption status features
python tests/test_encryption_status.py

Debugging & Monitoring

# Kill all chat processes
pkill -f "python.*server.py"
pkill -f "python.*client.py"

# Check port usage
lsof -i :8888

# Monitor system processes
ps aux | grep python

🔧 Technical Architecture

Client1 ←→ Server ←→ Client2
   ↓         ↓         ↓
Analysis  Analysis  Analysis
   ↓         ↓         ↓
 Logs/   Console    Logs/
  • Communication: Point-to-point messaging through TCP server
  • Encryption: Shared key XOR encryption with Base64 encoding
  • Analysis: Real-time OSI layer tracking with detailed logging
  • GUI: Tabbed interface with chat and analysis views

📁 Project Structure

chatApp/
├── main.py                 # Application entry point
├── app/
│   ├── server.py          # TCP server implementation
│   └── client.py          # GUI client with analysis
├── utils/
│   ├── analyze.py         # OSI layer analysis engine
│   └── decryptedMsg.py    # End-to-end encryption
├── tests/                 # Test scripts for all components
├── logs/                  # Auto-generated analysis logs
└── requirements.txt       # Dependencies

🛡️ Security Considerations

This is an educational tool for learning purposes:

  • Uses basic XOR encryption (not production-grade)
  • No authentication or authorization mechanisms
  • Designed for local network testing only
  • Process cleanup may require manual intervention

📚 Learning Objectives

After working with this application, beginners should understand:

  1. How network protocols work at different OSI layers
  2. Basic encryption/decryption concepts and implementation
  3. Client-server communication patterns
  4. Network traffic analysis techniques
  5. System resource monitoring and process management

🤝 Contributing

This project is designed for educational purposes. Feel free to:

  • Extend the analysis capabilities
  • Add new encryption algorithms
  • Improve the GUI interface
  • Create additional test scenarios
  • Document security findings

⚠️ Disclaimer

This application is intended for educational purposes only. Use responsibly and only on networks you own or have explicit permission to test.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages