Stuxnet README

README проекта с github.com/Sadpainy/Stuxnet. Одним файлом markdown: README.md.

Repository Premise

Thank you like this repository. Its value lies in freeing people from having to read dull, scattered reports that run to thousands of pages, which consume a huge amount of time and energy. This repository is highly readable; it does not blindly chase the original version but is more oriented toward general readers.

NSA Mossad CIA IDF USA Siemens

This repository contains a strictly educational and research-oriented reconstruction of the infamous Stuxnet worm. It is the product of countless hours of reverse engineering work conducted by the global security research community on the original binary samples discovered in 2010.

The Code Quality Passing, Coverage Successful, Clean Code Verified. But build is unstable stage.

Warning: This code is provided solely for academic study, malware analysis training, and defensive research. The authors and contributors do not condone illegal or unethical activities.

It is not intended to be used for any malicious purposes, nor is it a deployable piece of malware.

Table of Contents

- Status

# Status

- Build: Unstable

- Clean Code: Verified

- Code Quality: Tests Passing

- Coverage: Excellent

The Most Recent Update

Time: 2026-10-17 06:00

Added a version that's closer to the original in detail, plus a clean version. both built entirely from the known clues. The file is named Reboot.zip and the password is Stuxnet.

If you don't think the reconstruction version is good...

Overview

Stuxnet is widely recognized as the first known cyber-weapon designed to cause physical destruction to industrial control systems (ICS). It specifically targeted Siemens Step 7 software and S7-300/400 PLCs, ultimately manipulating frequency converter drives to damage centrifuge rotors.

This repository is a reconstructed source code derived from the decompiled binaries. It preserves the original logic and attack vectors while structuring the codebase for readability and analysis.

Target: Siemens SIMATIC WinCC, Step 7, and S7 PLCs.

Propagation: USB drives (LNK exploits), Network shares (Print Spooler), Peer-to-Peer (P2P).

Payload: Modification of PLC block logic (OB1/OB35) to alter motor frequencies.

Stealth: Advanced Rootkit capabilities (MRxCls.sys, MRxNet.sys) for file, process, and registry hiding.

Core Components

The repository is organized by the primary modules identified during the analysis of the original malware.




- Module: Step7 Hook Library - Filename: s7aaapix.dll - Description: Intercepts AUT (Automation Tool) API calls within the Step 7 engineering environment.




- Module: Payload (Attack) - Filename: s7plcmain - Description: The core logic responsible for the "Frequency Tampering" attack that damages the centrifuges.


Technical Architecture

The following describes the high-level execution flow of the Stuxnet framework.

  1. Environment Reconnaissance: The worm checks for the presence of specific Siemens software (WinCC, Step 7) and specific target PLCs (S7-315, S7-417).

  2. DLL Injection: It intercepts the s7blk_write function call.

  3. Code Injection: When a user downloads a project to the PLC, the malicious code is appended to the OB1/OB35 blocks.

  4. Physical Impact: The PLC executes the manipulated code, causing the connected variable frequency drives (VFDs) to spin at abnormal frequencies (high/low), resulting in mechanical damage.

Important: This codebase is designed for static analysis and debugging in a controlled virtual environment. It is not intended for live deployment on any critical infrastructure.

Build Environment: Microsoft Visual Studio 2019/2022 (Windows) or mingw-w64.

Target OS: Windows XP / Windows 7 (for driver compatibility).

Driver Kit:Windows Driver Kit (WDK) 7600 (if compiling kernel drivers).

Building the User-Mode Modules

Clone the repository

git clone https://github.com/Sadpainy/Stuxnet.git
cd Stuxnet

Build the main dropper

cd Main
nmake /f Makefile.win

Build the S7 hook library

cd ../s7otbxdx
cl /LD s7otbxdx.dll.c user32.lib ws2_32.lib

Usage

This code is intended for:

Malware Analysis: Understanding the specific code logic used in advanced persistent threats (APTs).

Defensive Research: Developing detection signatures for ICS security tools (e.g., YARA rules, Snort signatures).

Academic Study: Examining the intersection of cybersecurity and critical infrastructure protection.

Analysis Setup

  1. Isolate Environment: Use a virtual machine (VMWare/VirtualBox) with Host-Only networking enabled. Disable internet connectivity.

  2. Load Modules: Analyze the .dll and .sys files using tools such as IDA Pro, Ghidra, or x64dbg.

  3. Monitor Activity: Use Process Monitor (ProcMon), Process Hacker, and Wireshark to observe the behavior.

Legal and License

This project is licensed under the GNU Affero General Public License v3.0, LICENSE.Stuxnet (Must-Read, Very Important), LICENSE.XOR (Must-Read, Very Important), LICENSE.Detail, Apache License 2.0 and LICENSE.Desktop. See the LICENSE file for details.

No Disclaimer. That's on you to be self-aware.

Acknowledgements

This research and reconstruction would not have been possible without the extensive analysis and threat intelligence provided by global cybersecurity vendors.

Symantec (W32.Stuxnet dossier)

Kaspersky Lab (The Stuxnet saga)

ESET (Stuxnet under the microscope)

Amr Thabet and Christian Roggia (research-virus/stuxnet)

This is an academic reconstruction. Use it to build stronger defenses, not to cause harm.

Thank you like this repository!

Stuxnet (Sadpainy/Stuxnet)

Ищем в базе…

Что это такое?Это восстановленный исходный код Stuxnet — знаменитого червя 2010 года, саботировавшего промышленные системы управления Siemens, — воссозданный автором по материалам реверс-инжиниринга в образовательных целях и для анализа вредоносного ПО.
Это настоящий бинарник Stuxnet или воссоздание по исследованиям?Это воссоздание: исходники на C получены из декомпилированных бинарных образцов и публичных отчётов threat-intel и переработаны в читаемые модули (loader, библиотеки хуков S7, руткит-драйверы, полезная нагрузка для PLC), а не из оригинальной утёкшей малвари.
Как это собрать и проанализировать?Склонируйте репозиторий и соберите модули пользовательского режима (dropper, библиотеку хуков S7) с помощью Visual Studio 2019/2022 или mingw-w64; драйверам ядра нужен Windows Driver Kit (WDK) 7600. Анализировать задумано внутри изолированной VM с инструментами вроде IDA Pro, Ghidra, Process Monitor и Wireshark.
Что нужно помимо самих исходников?Нужна целевая платформа Windows XP/Windows 7 для совместимости драйверов, плюс WDK 7600 для компиляции руткит-драйверов режима ядра (mrxcls.sys, mrxnet.sys).
Безопасно ли запускать это на реальной машине?Нет, автор прямо говорит, что это рассчитано только на статический анализ и отладку в контролируемой виртуальной среде, а не на запуск на каких-либо системах, и ограничено совместимостью с драйверами легаси Windows XP/7.
Для кого это предназначено?Для аналитиков вредоносного ПО, исследователей защиты ICS/SCADA и студентов, изучающих продвинутые постоянные угрозы и реверс-инжиниринг, а не для операторов реального промышленного оборудования.
На каких платформах работает целевой код?Полезная нагрузка и драйверы собраны специально для Windows XP и Windows 7, как в целевой среде оригинального Stuxnet.
Что на самом деле атакует эта малварь?Она нацелена на Siemens SIMATIC WinCC, ПО Step 7 и контроллеры S7-300/400, перехватывая вызов s7blkwrite, чтобы внедрить код в блоки OB1/OB35 и управлять частотными преобразователями, что в реальном инциденте физически повредило роторы центрифуг.
Как он распространяется и скрывается?Распространение — через заражённые USB-накопители (эксплойт LNK), сетевые шары диспетчера печати и peer-to-peer; скрытность обеспечивают руткит-драйверы ядра (MRxCls.sys, MRxNet.sys), прячущие файлы, процессы и ключи реестра с помощью хуков SSDT.
На какие модули репозиторий разбивает червя?Основные компоненты включают Loader/Dropper, эксплойт повышения привилегий для Win32k.sys, библиотеки хуков S7/Step7, перехватывающие обмен с PLC, два руткит-драйвера и полезную нагрузку s7plcmain, отвечающую за атаку на частоту преобразователей.
Откуда воссоздание взяло технические детали?Оно построено на опубликованных threat-intel-исследованиях: досье W32.Stuxnet от Symantec, «саге о Stuxnet» от Лаборатории Касперского, анализе ESET и независимых исследователях Амре Табете и Кристиане Рогге.
Автор
Sadpainy
Размер
5.5 MB
Звёзды
597
Обновлён
КоммитNov 11
Возраст
2 мес
Коммиты · 90 дней