CSE 405 & CSE 406 | BUET Department of Computer Science & Engineering
A showcase of applied security principles through hands-on implementations and vulnerability analysis
- π― Overview
- ποΈ Repository Architecture
- π Projects at a Glance
- π Learning Progression
- βοΈ Technology Stack
- π Repository Statistics
- π Key Learning Outcomes
- π Getting Started
β οΈ Disclaimer & Legal Notice- π€ Contributing
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:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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
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
π 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
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
π 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
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
π 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)
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
π 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
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
π 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
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
| 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 |
| 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 |
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)| 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+ |
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
# System Requirements
- Linux/MacOS/Windows (WSL2 recommended)
- Python 3.8+
- Docker & Docker Compose
- GCC Compiler
- GDB Debugger# 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 instructionsEach project contains its own comprehensive README:
- π Assignment-01 README - Cryptography details
- π Assignment-02 README - Authentication system
- π Online-01 README - Binary exploitation
- π Online-02 README - Web vulnerabilities
- π Packet-Sniffer README - Network analysis
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
Users are solely responsible for:
- βοΈ Complying with all applicable laws and regulations
- π Only testing systems they own or have explicit written permission to test
- π 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
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
π Home β’ π Documentation β’ π¬ Issues
π‘οΈ Computer Security Coursework | BUET CSE
Created with β€οΈ for cybersecurity education
Last Updated: May 2026