GithubHelp home page GithubHelp logo

t-wcs / ransompy-covid19 Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 5.0 133.9 MB

Ransomware example on Python, created during containment for educational purposes

Python 80.92% HTML 9.44% Inno Setup 9.64%
malware ransomware-prevention ransomware-detection meterpreter backdooring backdoors-created

ransompy-covid19's Introduction

RansomPy COVID-19

Ransowmare based on Python 3 [3.7.9 version] created during containment...

The code is constantly improving, this for educational purposes to learn how a Ransomware works. I am in no way responsible for what you will do with this code.


Program Operation

The code is buildable in several stages but is essentially intended to encrypt the files in a Windows system and is compiled with Cx_Freeze which allows to import all the Ransomware libraries.

Using Cx_Freeze is relatively simple, you can consult the official documentation at this address:

https://cx-freeze.readthedocs.io/en/latest/

You can also run the code without compiling it, it will be necessary that the target has Python installed on the system, however it is preferable to compile it for automation after creating an SFX package with Winrar, Inno Setup or a Windows installation package (MSI).

Details

It requires administrator rights to start properly, and if you don't have the rights, it will be restarted automatically by making a privilege request.

If the program does not connect to the server to obtain the encryption key for the files, then it generates the key and sends it by e-mail relay.

Then the ransomware goes to work and encrypts all the home directories of the system from "\Users".

It also removes some environment variables in the registry, before taking possession of some executables in "system32" such as "SmartScreen" which allows checking the editor before running a program on the system, "explorer" which allows displaying the desktop environment, as well as "taskmgr.exe" the task manager, and then removes these processes.

It is also going to block access to windows defender and disable it from the registry, which will allow the restart of the computer to download a backdoor hosted on a remote site.

The ransomware will also insert in the registry, the start of its main encryption function at each system reboot by calling an independent executable. In the event of a reboot, it generates a new key but it does not encrypt the files it has already encrypted previously, by logic and to save time.

It also encrypts permanently in the directories in case of a reboot of the machine.

Auto-exec with WinRAR

  1. Select the folder contains the code and libraries
  2. Rename the folder to "setup"
  3. Right Click and "Add to archive"
  4. Select "Create SFX Archive"
  5. In the "Advanced tab" click on "SFX Options"
  6. Select "Create in the current folder"
  7. Copy "Powershell Start-Process setup/main.exe -Verb RunAs" in the "Launch after installation" section.
  8. In the "Advanced tab" on "SFX Options" check the box "Request Administrative Rights" (Very important, it allows you to run ransomware as an administrator)
  9. Click OK
  10. Send the "SFX Archive" to the victim.

The advantage of this method of building an archive is that I do not need to request privileges in the code and it also makes it possible to contain all the libraries in a single executable file.

Beware sometimes antivirus programs like Windows Defender can detect a simple SFX archive which is actually a false positive.

Installer with Inno Setup

You can consult the official documentation at https://jrsoftware.org/.

The purpose of inno setup is to create an installer by adding some parameters such as the destination folder or a personalized icon.

Execution script on the Server

For use the script : python ServerKey.py --host <ip_adress> --port <port_number>

Improvements to come

The program will encrypt much faster with the use of threads.

The program will be able to search and exploit a network communication to propagate itself.

ransompy-covid19's People

Contributors

t-wcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ransompy-covid19's Issues

Video / User Manual

Hi there,

Is there any video, or user manual that I can refer to run this example? I am finding related projects to showcase in a demonstration :)

Build with a new version of Cx Freeze

The latest version of Cx Freeze with Python 3.9 return one error when the code is executed on the target machine, it seems to come from the directory which contains the library for the python program which is encrypted.

Windows startup with GUI Counter

It's appears is a incorrectly values into db.txt to the " PerfLogs\gui_counter " directory, who permetly normaly to set update the counter time

Error message :
File "gui_counter", line 60, in
ValueError: invalid literal for int() with base 10:
"\x00\x00\x00\x00\x00\x00\x00\x00\x00"

Picture :
Bug_Gui_After_Restart_Windows

Into db.txt (after restart the system):
Into_db_txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.