Skip to content

AfzalHossan-2005021/Computer-Security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

56 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ›‘οΈ Computer Security: Applied & Practical

Comprehensive Academic Portfolio

CSE 405 & CSE 406 | BUET Department of Computer Science & Engineering

Cryptography β€’ Binary Exploitation β€’ Web Security β€’ Network Analysis

Institution Level Python C Docker License

A showcase of applied security principles through hands-on implementations and vulnerability analysis


πŸ“‘ Table of Contents


🎯 Overview

This repository represents a comprehensive exploration of modern cybersecurity through practical implementation and vulnerability analysis. Completed as part of the CSE 405 & CSE 406 coursework at BUET, it demonstrates proficiency across multiple security domains:

Core Domains Covered

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  COMPUTER SECURITY DOMAINS                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                             β”‚
β”‚  πŸ” CRYPTOGRAPHY           πŸ”“ BINARY EXPLOITATION           β”‚
β”‚  β”œβ”€ AES Implementation      β”œβ”€ Buffer Overflows             β”‚
β”‚  β”œβ”€ ECC Protocols           β”œβ”€ Stack Smashing               β”‚
β”‚  └─ Secure Communication    └─ ROP Gadgets                  β”‚
β”‚                                                             β”‚
β”‚  🌐 WEB APPLICATION SECURITY  πŸ” NETWORK ANALYSIS           β”‚
β”‚  β”œβ”€ SQL Injection          β”œβ”€ Packet Sniffing               β”‚
β”‚  β”œβ”€ Authentication         β”œβ”€ Protocol Analysis             β”‚
β”‚  └─ Biometric Systems      └─ MITM Demonstration            β”‚
β”‚                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—οΈ Repository Architecture

Directory Structure

Computer-Security/
β”‚
β”œβ”€β”€β”€ πŸ“¦ Assignment-01/              [Applied Cryptography]
β”‚    β”œβ”€ _2005021_aes.py            β†’ AES Encryption Implementation
β”‚    β”œβ”€ _2005021_ecc.py            β†’ Elliptic Curve Cryptography
β”‚    β”œβ”€ _2005021_sender.py         β†’ Secure Message Sender
β”‚    β”œβ”€ _2005021_receiver.py       β†’ Secure Message Receiver
β”‚    └─ BitVector-3.5.0/           β†’ Cryptographic Bit Operations
β”‚
β”œβ”€β”€β”€ πŸ“¦ Assignment-02/              [Web Authentication & ML]
β”‚    β”œβ”€ collect.py                 β†’ Behavioral Data Collection
β”‚    β”œβ”€ database.py                β†’ Data Persistence Layer
β”‚    β”œβ”€ train.py                   β†’ ML Model Training
β”‚    β”œβ”€ app.py                     β†’ Authentication Application
β”‚    └─ static/                    β†’ Web Interface Assets
β”‚
β”œβ”€β”€β”€ πŸ“¦ Online-01/                  [Memory Corruption Exploits]
β”‚    β”œβ”€ Online/                    β†’ Buffer Overflow Challenges
β”‚    β”‚  β”œβ”€ A1/, A2/, B1/, B2/     β†’ Vulnerability Scenarios
β”‚    β”‚  └─ exploit.py             β†’ Automated Exploit Generation
β”‚    └─ Practice/                  β†’ Training Challenges
β”‚
β”œβ”€β”€β”€ πŸ“¦ Online-02/                  [Web App Vulnerabilities]
β”‚    β”œβ”€ A1/, B1/                   β†’ SQL Injection Scenarios
β”‚    └─ practice/sqli-labs/        β†’ Interactive Lab Environment
β”‚
└─── πŸ“¦ Packet-Sniffer/             [Network Security Lab]
     β”œβ”€ sniffer.py                 β†’ Packet Capture & Analysis
     β”œβ”€ generate_traffic.py        β†’ Traffic Generation
     β”œβ”€ docker-compose.yml         β†’ Container Orchestration
     └─ Dockerfile.*               β†’ Container Specifications

πŸ“š Projects at a Glance

πŸ” Assignment-01: Applied Cryptography

graph LR
    S["πŸ”’ Sender"] -->|Message + Key| AES["AES Encryption"]
    AES -->|Encrypted Data| CH["Encrypted Channel"]
    CH -->|Ciphertext| R["πŸ”“ Receiver"]
    R -->|Decryption| AES
    
    ECC["Elliptic Curve"] -->|Key Exchange| SEC["Secure Session"]
    SEC -->|Verified Keys| CH
    
    style S fill:#4ecdc4,stroke:#2a9d8f,color:#fff
    style R fill:#4ecdc4,stroke:#2a9d8f,color:#fff
    style AES fill:#ffe66d,stroke:#ffd60a,color:#333
    style ECC fill:#ff6b6b,stroke:#c92a2a,color:#fff
Loading

πŸ“‹ Key Components:

  • βœ… AES-256 Encryption with CBC mode
  • βœ… ECC Key Agreement with ECDH protocol
  • βœ… Secure Communication Channel between sender and receiver
  • βœ… BitVector Library for efficient bit manipulation

πŸ’‘ Learning Focus: Cryptographic algorithms, key management, secure channels

πŸ“ Key Files: _2005021_aes.py, _2005021_ecc.py, _2005021_sender.py, _2005021_receiver.py


πŸ” Assignment-02: Authentication & Behavioral Biometrics

graph TD
    A["User Interaction"] -->|Mouse/Keyboard| B["Behavioral Data"]
    B -->|Time, Speed, Pressure| C["Feature Extraction"]
    C -->|Normalized Data| D["ML Model"]
    D -->|Prediction| E["Authentication Decision"]
    
    style A fill:#4ecdc4,stroke:#2a9d8f,color:#fff
    style B fill:#ffe66d,stroke:#ffd60a,color:#333
    style C fill:#ff6b6b,stroke:#c92a2a,color:#fff
    style D fill:#a8e6cf,stroke:#56c596,color:#333
    style E fill:#ffd60a,stroke:#ffs60a,color:#333
Loading

πŸ“‹ Key Components:

  • βœ… Data Collection pipeline for behavioral metrics
  • βœ… Machine Learning model training (Random Forest/SVM)
  • βœ… Database persistence layer
  • βœ… Web Interface with JavaScript Web Workers
  • βœ… Real-time Prediction engine

πŸ’‘ Learning Focus: Authentication mechanisms, ML application, web backend development

πŸ“ Key Files: collect.py, train.py, database.py, app.py


πŸ’£ Online-01: Binary Exploitation & Memory Corruption

graph LR
    B["Vulnerable<br/>Binary"]
    
    B -->|Input| AOV["Attack Vector"]
    AOV -->|Buffer Overflow| MEM["Memory Layout"]
    MEM -->|Overwrite| RET["Return Address"]
    RET -->|Redirect Flow| SHELL["/bin/sh"]
    
    GDB["GDB Analysis"] -.->|Debug Info| AOV
    
    style B fill:#ff6b6b,stroke:#c92a2a,color:#fff
    style AOV fill:#ffd60a,stroke:#ff870b,color:#333
    style MEM fill:#4ecdc4,stroke:#2a9d8f,color:#fff
    style SHELL fill:#90ee90,stroke:#228b22,color:#333
    style GDB fill:#9370db,stroke:#6a0572,color:#fff
Loading

πŸ“‹ Key Components:

  • βœ… Buffer Overflow exploitation techniques
  • βœ… Stack Smashing and ROP gadgets
  • βœ… GDB Debugging for memory analysis
  • βœ… Python Exploit frameworks
  • βœ… Bypass Techniques (ALSR, DEP, Canaries)

πŸ’‘ Learning Focus: Low-level vulnerabilities, exploitation mechanics, defensive bypassing

πŸ“ Vulnerability Scenarios: A1, A2 (Average difficulty), B1, B2 (Advanced difficulty)


🌐 Online-02: Web Application Vulnerabilities

graph LR
    WEB["Web Application"] -->|User Input| VAL{Validated?}
    VAL -->|No| SQL["SQL Injection"]
    SQL -->|Malicious Query| DB["Database"]
    DB -->|Escape| LEAK["Data Leakage"]
    
    VAL -->|Yes| SAFE["Safe Query"]
    SAFE -->|Parameterized| DB
    DB -->|Protected| OK["βœ… Secure"]
    
    style WEB fill:#4ecdc4,stroke:#2a9d8f,color:#fff
    style SQL fill:#ff6b6b,stroke:#c92a2a,color:#fff
    style LEAK fill:#ffd60a,stroke:#ff870b,color:#333
    style SAFE fill:#90ee90,stroke:#228b22,color:#333
    style OK fill:#90ee90,stroke:#228b22,color:#333
Loading

πŸ“‹ Key Components:

  • βœ… Union-Based SQL Injection
  • βœ… Error-Based SQLi techniques
  • βœ… Blind SQL Injection exploitation
  • βœ… sqli-labs modernized environment
  • βœ… Defensive Measures & secure coding

πŸ’‘ Learning Focus: Web vulnerabilities, database security, OWASP top 10

πŸ“ Tools: DVWA alternatives, MySQL labs, PHP exploitation


πŸ” Packet-Sniffer: Network Security Lab

graph TB
    subgraph Docker["Docker Network"]
        ATK["πŸ”΄ Attacker<br/>(Scapy Sniffer)"]
        VIC["πŸ’» Victim<br/>(Traffic Gen)"]
        HTTP["🌐 HTTP Server"]
        TEL["πŸ“ž Telnet Server"]
    end
    
    VIC -->|HTTP Request| HTTP
    VIC -->|Telnet Auth| TEL
    HTTP -->|Response| ATK
    TEL -->|Response| ATK
    ATK -->|Console Output| DISP["πŸ“Š Packet Display"]
    
    style ATK fill:#ff6b6b,stroke:#c92a2a,color:#fff
    style VIC fill:#4ecdc4,stroke:#2a9d8f,color:#fff
    style HTTP fill:#ffe66d,stroke:#ffd60a,color:#333
    style TEL fill:#a8e6cf,stroke:#56c596,color:#333
    style DISP fill:#9370db,stroke:#6a0572,color:#fff
Loading

πŸ“‹ Key Components:

  • βœ… Containerized Network with Docker Compose
  • βœ… Packet Sniffing with Scapy
  • βœ… Traffic Generation simulation
  • βœ… MITM Demonstration on clear-text protocols
  • βœ… Real-time Analysis console

πŸ’‘ Learning Focus: Network protocols, packet analysis, protocol vulnerabilities

πŸ“ Key Files: sniffer.py, generate_traffic.py, docker-compose.yml


πŸ”„ Learning Progression

The repository is structured to provide a progressive learning path from foundational to advanced security concepts:

Level 1: FOUNDATIONS
β”œβ”€ Cryptographic Algorithms (AES, ECC)
└─ Understanding Encryption

     ↓

Level 2: APPLICATIONS
β”œβ”€ Authentication Systems
β”œβ”€ Web Development Security
└─ Practical Implementation

     ↓

Level 3: VULNERABILITIES
β”œβ”€ Identifying Security Flaws
β”œβ”€ Exploitation Mechanics
└─ Defense Strategies

     ↓

Level 4: ADVANCED ANALYSIS
β”œβ”€ Network-level Attacks
β”œβ”€ Protocol Analysis
└─ MITM Scenarios

βš™οΈ Technology Stack

πŸ–₯️ Programming Languages

Language Purpose Projects
Python 3.x Cryptography, Exploits, Network Analysis All
C Vulnerable Programs, Systems Programming Online-01
JavaScript Web Interface, Data Collection Assignment-02
PHP Web Applications, Database Interaction Online-02
Bash Scripting, Docker Management Packet-Sniffer

πŸ› οΈ Tools & Libraries

Category Tools
Cryptography BitVector, hashlib, PyCryptodome
Network Analysis Scapy, tcpdump, Wireshark
Debugging GDB (GNU Debugger), Python pdb
Web Frameworks Flask, PHP, HTML/CSS/JS
Database MySQL, SQLite
Containerization Docker, Docker Compose
ML/Data scikit-learn, pandas, numpy

🐳 Infrastructure

Containerization:
  - Docker (Isolation & Portability)
  - Docker Compose (Multi-container Orchestration)
  - Custom Dockerfiles (Attacker, Victim, Services)

Networking:
  - Bridge Networks (Communication)
  - Port Mapping (Service Exposure)
  - Volume Mounts (Data Persistence)

πŸ“Š Repository Statistics

Metric Value
Total Projects 5
Python Scripts 15+
C Programs 8+
Dockerfiles 4
Lines of Code 2000+
Cryptographic Implementations 2
Exploitation Techniques 8+
SQL Injection Vectors 6+

πŸŽ“ Key Learning Outcomes

Upon completing this coursework, the following competencies are demonstrated:

CRYPTOGRAPHY                    EXPLOITATION
  β€’ AES Implementation          β€’ Buffer Overflow Detection
  β€’ ECC Key Exchange            β€’ Memory Analysis (GDB)
  β€’ Secure Channels             β€’ Payload Crafting
  β€’ Algorithm Analysis          β€’ Bypass Techniques

NETWORK SECURITY              WEB APPLICATIONS
  β€’ Packet Analysis            β€’ SQL Injection Testing
  β€’ Protocol Sniffing          β€’ Authentication Design
  β€’ MITM Scenarios             β€’ Input Validation
  β€’ Traffic Simulation         β€’ Database Security

πŸš€ Getting Started

Prerequisites

# System Requirements
- Linux/MacOS/Windows (WSL2 recommended)
- Python 3.8+
- Docker & Docker Compose
- GCC Compiler
- GDB Debugger

Quick Setup

# 1. Clone the repository
git clone https://github.com/AfzalHossan-2005021/Computer-Security.git
cd Computer-Security

# 2. Navigate to a project
cd Assignment-01/
# OR
cd Packet-Sniffer/

# 3. Run project-specific setup
# See individual README.md files for detailed instructions

Project-Specific Documentation

Each project contains its own comprehensive README:


⚠️ Disclaimer & Legal Notice

Educational Use Only

CRITICAL NOTICE: This repository contains materials, code, and techniques related to cybersecurity exploitation and vulnerability analysis. All content is strictly for:

βœ… PERMITTED USES:

  • πŸ“š Academic learning and research
  • 🏫 Computer science education
  • πŸ›‘οΈ Understanding defensive security
  • πŸ”¬ Authorized security testing on owned systems

❌ PROHIBITED USES:

  • 🚫 Unauthorized system access
  • 🚫 Data theft or manipulation
  • 🚫 Denial of service attacks
  • 🚫 Any illegal or malicious activities

Legal Compliance

Users are solely responsible for:

  1. βš–οΈ Complying with all applicable laws and regulations
  2. πŸ”’ Only testing systems they own or have explicit written permission to test
  3. πŸ“‹ Understanding and accepting full legal liability for misuse

The authors assume NO LIABILITY for:

  • Unauthorized use of provided materials
  • Damages resulting from code execution
  • Legal consequences from misuse

🀝 Contributing

This is an academic portfolio repository. While contributions are appreciated, please note:

  • πŸ” This is coursework for CSE 405 & 406
  • πŸ“ Modifications should maintain educational integrity
  • πŸŽ“ Please open issues for discrepancies or improvements
  • πŸ“§ Contact for collaboration opportunities

πŸ“Œ Quick Links

🏠 Home β€’ πŸ“š Documentation β€’ πŸ’¬ Issues


πŸ›‘οΈ Computer Security Coursework | BUET CSE

Created with ❀️ for cybersecurity education

Last Updated: May 2026

↑ Back to Top

About

This repository is of practical implementations and exploit demonstrations across five key areas: applied cryptography (AES, ECC), behavioral authentication, memory corruption (buffer overflows), web vulnerabilities (SQL injection), and a Docker-based network security sandbox for traffic analysis and MITM attacks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors