Python Malicious Activities Simulation Program Repository [Malware Simulation Project]
This week, we will introduce the malware activities repository project we developed for cyber security Education, Competition, Training, Testing and Research.
Project Design Purpose: This repository provides a collection of Python programs that simulate a wide range of malicious activities and malware behaviors. These simulations cover common attack vectors, including compromised credentials, penetration, phishing, brute force attacks, distributed denial-of-service (DDoS), remote control operations, trojans, man-in-the-middle (MITM) attacks, insider threats, and more. The repository is designed for the following purposes:
Important: The program and script in this repository can only be used for education, training and research, please don't apply it on cyber attack.
# Created: 2023/07/30
# Version: v_0.1.2
# Copyright: Copyright (c) 2023 LiuYuancheng
# License: MIT License
Introduction
In cybersecurity research, working with actual malware can be risky, as some malicious programs may unintentionally damage systems. To address this challenge, this project aims to create a repository of scripts and programs that simulate various malicious activities without the associated risks. Key attack vectors include compromised credentials, phishing, brute force attacks, denial of service, trojans, man-in-the-middle attacks, and insider threats. The malicious actions span file theft, web shell attacks, phishing email generation, DDoS, backdoor installation, ARP spoofing, malware injection, and more, providing a comprehensive toolset for simulating and studying cyberattacks.
The repository will provide five types of attack modules, offering a safe environment for research, education, and testing:
Most of the malware simulations are written in Python and C, with some requiring integration with external attack tools. The repository covers a broad range of attack vectors and malicious actions, making it a versatile resource for cybersecurity education, competition, research, and testing.
Malicious Activities Simulation Program
In this section we will introduce the detail of each Malicious Activities Simulation Program. To check the detail code and document, please refer to the link at the end of each simulation program. The simulation program includes:
Backdoor Trojan Simulation Program
The Backdoor Trojan Simulation is designed to mimic the behavior of a real backdoor trojan to create a vulnerable point / interface on your system, providing a practical demonstration of how such malware operates in a controlled environment. The system work flow diagram is shown below:
This system consists of three main components that work together to simulate a full-fledged backdoor attack scenario:
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/backdoorTrojan
DoS Attack Simulation Program
The Distributed Denial-of-Service (DDoS) Attack Simulation is designed to emulate large-scale DDoS attacks in a controlled environment, showcasing how malicious actors can disrupt network services by overwhelming a target with a flood of traffic. DDoS attacks are one of the most common and straightforward methods used by hackers to incapacitate services such as websites, servers, or entire networks. This simulation aims to replicate such attacks by generating massive numbers of concurrent network requests to a targeted service, current the attack simulation covers 10 type of different protocols: SSH, HTTP(s), NTP, FTP, TCP, UDP, SMB, Modbus-TCP, SMTP and POP3. The system work flow diagram is shown below:
The DDoS attack simulation system consists of three main components:
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/ddosAttacker
ARP Spoofing Attack Simulation Program
The ARP Spoofing Attack Simulation is designed to emulate network-level attacks by manipulating the Address Resolution Protocol (ARP), which is essential for translating IP addresses to MAC addresses in a local network. This program leverages the popular tool Ettercap to execute ARP spoofing attacks, enabling attackers to intercept, block, or manipulate network traffic. By integrating this ARP spoofing simulation into a larger Command and Control (C2) Emulation system, the program offers a versatile tool for testing network vulnerabilities and defense mechanisms. The system work flow diagram is shown below:
The ARP Spoofing Attacker extends the functionality of the standard C2 malware simulation module by incorporating a custom Ettercap Wrapper. This wrapper enables precise control over network traffic through ARP poisoning, targeting routers, switches, or other devices in specific network subnets. This allows the attacker to either drop specific packets, block entire traffic streams, or perform more advanced attacks like Man-in-the-Middle (MitM).
By simulating ARP spoofing attacks in this controlled environment, the system provides valuable insights into the risks posed by such attacks and allows security teams to test their mitigation strategies against common network-based threats.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/ettercapWrapper
Malware Protection Watchdog Program
The Malware Watchdog Program is designed to provide robust protection for malware or attack programs during cyber exercises, particularly for red team operations. One of the common challenges faced by attackers in these exercises is the ability of the blue team to swiftly stop malicious processes or delete files, rendering the attack ineffective. This project aims to counter those defensive measures by creating a watchdog that continuously monitors and ensures the uninterrupted operation of target programs. The system work flow diagram is shown below:
Key features of the Malware Watchdog Program include:
This program is particularly useful for Red Teaming in Cyber Exercises, Service Program Protection, and Malware Action Detection Research. By binding the watchdog to a single program or chaining multiple programs together, users can create a self-protecting ecosystem where the programs automatically protect each other from being terminated or deleted.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/processWatchDog
Phishing Email Simulation Program
The Phishing Email Simulation Program is designed to mimic real-world phishing attacks by using AI-generated content to craft convincing emails, spam message that lure victims into engaging with malicious links or attachments. The program automates the entire process, from generating realistic email content to embedding hidden malicious links or archives within the message, and then sending it to the victim using a valid email service. This simulation provides a powerful tool for testing email-based attack vectors in cybersecurity exercises or training environments. The system work flow diagram is shown below:
领英推荐
Key Features:
This simulation is ideal for Cybersecurity Training, Phishing Awareness Campaigns, and Red Team Exercises, allowing organizations to test their defenses and improve awareness of phishing attacks.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/phishingEmailSender
Modbus FDI/FCI Attack Simulation Program
The Modbus FDI/FCI Attack Simulation Program is designed to emulate cyberattacks on Operational Technology (OT) systems, specifically targeting devices using the Modbus-TCP protocol such as Programmable Logic Controllers (PLCs). This simulation focuses on two primary types of attacks: False Data Injection (FDI) and False Command Injection (FCI), both of which can disrupt industrial control systems and critical infrastructure. By integrating this program into a larger Command and Control (C2) Emulation system, it enables red teams to test and explore vulnerabilities in OT environments. The system work flow diagram is shown below:
Key Features:
By simulating both FDI and FCI attacks, this program provides a powerful tool for testing the resilience of OT systems, making it useful for cybersecurity training, red team exercises, and industrial control system research. The insights gained from these simulations can help identify weaknesses in OT systems and develop stronger security defenses to mitigate real-world threats.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/falseCmdInjector
Red Team Command and Control (C2) Simulation Program
The Red Team Command and Control (RTC2) Simulation Program is a comprehensive solution designed to emulate a command and control (C2) server for use in cyber exercises and training scenarios. The RTC2 server acts as the central hub for red team members, enabling them to coordinate and manage compromised machines, issue remote commands, and orchestrate a wide range of simulated malicious activities. This system enhances the realism of cyber exercises by mimicking real-world C2 servers used in botnet operations and remote control attacks, allowing red teams to test and challenge blue team defenses in a controlled environment. The system work flow diagram is shown below:
Key Features:
By providing dynamic monitoring, scheduling, and control over malicious action programs, the RTC2 Simulation Program delivers a powerful tool for cyber exercises, red team operations, and training environments, helping organizations improve their cyber defense readiness and resilience against real-world threats.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/c2Emulator
Flask Web Shell Simulation Program
The Flask Web Shell Simulation Program is designed to simulate the behavior of a web shell in a controlled environment. A web shell is a malicious script that provides attackers with remote access to a server via a web interface, often enabling unauthorized control of the system. By simulating these actions within a Flask-based web application, this program helps red teams and cybersecurity professionals replicate real-world scenarios, testing and evaluating the security measures in place to defend against such attacks.
Key Features:
This simulation provides a valuable tool for training and testing the defenses against web shell attacks in a safe environment. By replicating real-world tactics, it enhances the preparedness of cybersecurity teams to detect, mitigate, and respond to such threats effectively.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/flaskWebShell
Python Pickle Bomb Building Program
The Python Pickle Bomb Building Program is designed to simulate and demonstrate the risks associated with insecure deserialization using Python’s pickle module. In real-world scenarios, pickle bombs are a form of exploit where malicious payloads are serialized and deserialized, allowing attackers to execute arbitrary code on a target system. This program showcases how attackers can craft harmful pickle objects and the devastating consequences they can have if improperly handled. The system work flow diagram is shown below:
Key Features:
This program serves as an educational tool for understanding the dangers of insecure deserialization in Python and equips cybersecurity professionals with the knowledge needed to detect and prevent such attacks. By simulating real-world pickle bomb scenarios, it highlights the importance of secure coding practices in handling serialized data.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/pickleBomb
Malicious Code Obfuscation Program
The Malicious Code Obfuscation Program is a comprehensive tool designed to protect sensitive Python source code by transforming it into unreadable, yet executable, obfuscated data. The primary objective of this program is to safeguard intellectual property and prevent unauthorized access to proprietary algorithms or sensitive code segments. By leveraging advanced obfuscation techniques, this tool enhances code security, making reverse engineering and code analysis significantly more difficult. The system work flow diagram is shown below:
Key Features:
This obfuscation tool provides a powerful solution for developers looking to protect their Python applications from unauthorized access and code manipulation, offering a balance between security and usability.
Detailed project document link : https://github.com/LiuYuancheng/Python_Malwares_Repo/tree/main/src/pyObfuscator
Thanks for spending time to check the article detail, if you have any question and suggestion or find any program bug, please feel free to message me. Many thanks if you can give some comments and share any of the improvement advice so we can make our work better ~