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 的重构源代码。Stuxnet 是 2010 年那款破坏西门子工业控制系统的著名蠕虫,作者基于逆向工程研究把它重建出来,用于教学和恶意软件分析。
这是真正的 Stuxnet 二进制文件,还是基于研究的重现?它是重现版本:C 源码取自反编译的二进制样本和公开的威胁情报报告,被重新组织成可读的模块(加载器、S7 钩子库、rootkit 驱动、PLC 载荷),而不是原始泄露的恶意软件。
怎么构建和分析它?克隆仓库,用 Visual Studio 2019/2022 或 mingw-w64 构建用户态模块(投递器、S7 钩子库);内核驱动需要 Windows Driver Kit(WDK)7600。分析应在隔离的虚拟机里进行,用上 IDA Pro、Ghidra、Process Monitor 和 Wireshark 等工具。
除了源码本身还需要什么?你需要面向 Windows XP/Windows 7 的构建目标来保证驱动兼容性,还需要 WDK 7600 来编译内核态 rootkit 驱动(mrxcls.sys、mrxnet.sys)。
在真实机器上运行它安全吗?不安全。作者明确表示它只为在受控虚拟环境中做静态分析和调试而设计,不能部署到任何真实系统上,而且它的范围仅限于旧版 Windows XP/7 驱动兼容性。
它面向哪些人?恶意软件分析师、ICS/SCADA 防御研究人员,以及研究高级持续性威胁和逆向工程的学生,而不是真实工业设备的操作人员。
目标代码运行在哪些平台上?载荷和驱动专门为 Windows XP 和 Windows 7 构建,与原始 Stuxnet 的目标环境一致。
这个恶意软件实际上攻击什么?它攻击西门子 SIMATIC WinCC、Step 7 软件和 S7-300/400 PLC,拦截 s7blkwrite 调用,向 OB1/OB35 块注入代码并操纵变频器驱动,在真实事件中曾造成离心机转子的物理损坏。
它是怎么传播和隐藏自己的?传播途径包括受感染的 U 盘(LNK 漏洞利用)、网络打印后台处理程序共享和对等网络;隐蔽性来自内核 rootkit 驱动(MRxCls.sys、MRxNet.sys),它们利用 SSDT 钩子隐藏文件、进程和注册表键。
仓库把蠕虫拆成了哪些模块?核心组件包括加载器/投递器、针对 Win32k.sys 的提权漏洞利用、拦截 PLC 通信的 S7/Step7 钩子库、两个 rootkit 驱动,以及负责变频篡改攻击的 s7plcmain 载荷。
这次重构的技术细节来自哪里?它建立在公开的威胁情报研究之上,包括 Symantec 的 W32.Stuxnet 报告、卡巴斯基实验室的 Stuxnet 连载、ESET 的分析,以及独立研究人员 Amr Thabet 和 Christian Roggia 的成果。
作者
Sadpainy
大小
5.5 MB
星标
597
更新
提交Nov 11
时长
2个月
提交 · 90 天