RepositoryCUSUnited States
JG

jgamblin/Mirai-Source-Code

Leaked Mirai Source Code for Research/IoC Development Purposes

9.6kstars
3.5kforks
0issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: security-research

#1 Repository of the week

1
TINIX TRENDING·Topic: botnet

#1 Repository of the week

1
TINIX TRENDING·Topic: mirai

#1 Repository of the week

Mirai Source Code


🔧 Requirements

Before building and running this code, ensure you have the following installed on a Linux host:

  • gcc - GNU Compiler Collection
  • golang - Go programming language
  • electric-fence - Memory debugging library
  • mysql-server - MySQL database server
  • mysql-client - MySQL database client
  • build-essential - Essential build tools
  • crossbuild-essential-armel - Cross-compilation tools for ARM

Additional Resources:

  • For detailed setup instructions and background information, refer to the original leak post in ForumPost.txt or view the formatted version at ForumPost.md.

⚠️ CRITICAL DISCLAIMER
This repository contains the leaked source code of the Mirai botnet, originally created to infect IoT devices and launch large-scale DDoS attacks. This code is provided strictly for cybersecurity research, reverse engineering, malware analysis, and detection development purposes only.

⚠️ WARNING: Do not use this code to attack or scan any real devices or networks. Unauthorized use is illegal and violates GitHub policy.

🛡️ SECURITY NOTICE: The zip file for this repo is being identified by some AV programs as malware. Please take caution.


📋 Table of Contents


📌 About Mirai

Mirai is a malware botnet that infects Internet of Things (IoT) devices using default or weak login credentials. Once infected, these devices are controlled by a command-and-control (CnC) server and can be used to launch DDoS attacks.

This repo is a fork of the original leaked source code and includes components such as:

  • The bot (runs on IoT devices)
  • The CnC server
  • The loader (infects devices)
  • Scanning and deployment scripts

📁 Repository Structure

Folder/FileDescription
mirai/Core malware source code (bot + CnC server)
loader/Infects vulnerable devices using telnet brute-force
dlr/Possibly supports payload delivery (optional)
scripts/Scripts for building and managing the malware
ForumPost.txtOriginal forum post by author explaining Mirai
LICENSE.mdLicense as included in original leak (not official)
README.mdYou’re reading it

⚙️ How to Use (FOR LAB RESEARCH ONLY)

You must use isolated VMs or an offline network. Never run this on a real device or public network.

🔧 1. Prerequisites

Install on a Linux host:

sudo apt update
sudo apt install gcc make build-essential git crossbuild-essential-armel -y

🔨 2. Clone the Repository

git clone https://github.com/jgamblin/Mirai-Source-Code.git
cd Mirai-Source-Code

🔨 3. Build the Bot and CnC

./build.sh

This will:

  • Cross-compile the bot for different IoT architectures (MIPS, ARM, etc.)

  • Compile the CnC server for your local machine

You can customize the build script and source code paths if needed.

Create a virtual lab with:

  • 1 Ubuntu VM for CnC and loader

  • 1 or more OpenWRT/Linux VMs simulating IoT devices

Use Host-Only or Internal Networking mode to keep the lab isolated.

🕹 5. Running Components

  • Start the CnC server (mirai/cnc/cnc)

  • Run the loader to infect virtual IoT VMs

  • Observe communication logs, infection, and payload delivery

✅ Learning Use Cases

You can use this source code to:

  • Understand how botnets spread through weak credentials

  • Reverse engineer malware behavior

  • Write intrusion detection rules (YARA, Snort, Suricata)

  • Develop antivirus and botnet defenses

  • Study CnC-to-bot protocol and build simulators

❌ Do NOT Use For

  • Scanning or infecting real IoT devices

  • DDoS attacks

  • Deploying the bot to the public internet

Any such use is illegal and against GitHub policy.

📚 References

👨‍💻 Credits

Original Author: Anna-senpai - Original Mirai botnet source code leak (2016)
Note: The original forum appears to be inactive as of now.

🙏 Acknowledgments

Special thanks to Pushpenderrathore for the improved README structure and comprehensive documentation that makes this educational resource more accessible for cybersecurity research.

Similar Projects

Discover other similar projects and AI models.

Dataset
Vyber07/cyber-security

Cybersecurity AI Knowledge Base — PhD-Level Dataset Overview This is the most comprehensive cybersecurity knowledge base ever assembled for AI training. It covers all domains of cybersecurity at PhD-level depth — from offensive red teaming and bug bounty exploitation to defensive SOC operations, digital forensics, and cutting-edge AI/LLM security. Size: 16 GB | Files: 507 | Domains: 30+ | Sources: 15+ platforms Purpose Train the world's most… See the full description on the dataset page: https://huggingface.co/datasets/Vyber07/cyber-security.

♥0
136.4k
Aug 31, 2026
RepositoryC++
maestron/botnets

This is a collection of #botnet source codes, unorganized. For EDUCATIONAL PURPOSES ONLY

3.4k
Sep 4, 2022
RepositoryYARA
deepfield/public-research

DDoS botnet research and indicators of compromise from Nokia Deepfield ERT

79
Nov 30, 2026
RepositoryC
raysan5/raylib

A simple and easy-to-use library to enjoy videogames programming

35.8k
Nov 25, 2026
RepositoryPython
home-assistant/core

:house_with_garden: Open source home automation that puts local control and privacy first.

92.6k
Nov 27, 2026
RepositoryGo
IceWhaleTech/CasaOS

CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.

37.8k
Nov 17, 2026
RepositoryPython
StevenBlack/hosts

🔒 Consolidating and extending hosts files from several well-curated sources. Optionally pick extensions for porn, social media, and other categories.

31.5k
Nov 30, 2026
RepositoryPython
microsoft/markitdown

Python tool for converting files and office documents to Markdown.

199.5k
Dec 2, 2026
RepositoryC
taosdata/TDengine

High-performance, scalable time-series database designed for Industrial IoT (IIoT) scenarios

25.2k
Nov 30, 2026