Jump to content

What to WHILE ransomware is encrypting?

njmyers3

I'm writing a program in Python that detects when ransomware is encrypting files. So far, it does detect when ransomware is modifying files such as changing their contents, renaming, or deleting them, but it doesn't do anything useful. All it can tell me is the fact that ransomware is detected, but not prevent it. So I was wondering what it should do to prevent the ransomware. Here are some ideas I had:

  • Shutdown the system immediately, may not work depending on privileges of software or current open applications
  • Log out, may not actually stop the ransomware if it's running as a system process
  • I thought about stopping network access but that wouldn't really stop the encryption, just delay the key being sent

As you can see, there's a potential flaw with all of these. What would you recommend I do?

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Either Identify the process to have it stop.

Or you can cause the computer to blue screen. Which I would prefer.

The geek himself.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Theguywhobea said:

Identify the process and stop the process.

It's a good idea but I feel that modern ransomware is designed to combat a regular user just stopping it with task manager. I'd also like to have something that works with all variants of ransomware rather than having a chance of not identifying the process. But thanks for your input :) 

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Being Delirious said:

Either Identify the process to have it stop.

Or you can cause the computer to blue screen. Which I would prefer.

Honestly crashing it isn't a bad idea, not the best, but I'll consider it. Thanks :P 

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, CamTechCorner said:

turn off write privileges to the disk, then no changes can occur.

Good idea, but I'm pretty sure you need administrator privileges to do that, which may not be possible in all scenarios.

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

13 minutes ago, njmyers3 said:

It's a good idea but I feel that modern ransomware is designed to combat a regular user just stopping it with task manager. I'd also like to have something that works with all variants of ransomware rather than having a chance of not identifying the process. But thanks for your input :) 

Would suspending the process be a good stop gap?

Rod 

----------

BSMods.com

Facebook

Youtube

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, njmyers3 said:

Good idea, but I'm pretty sure you need administrator privileges to do that, which may not be possible in all scenarios.

Can you not then start python in admin mode, then the ability to turn off the function should be their.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, CamTechCorner said:

Can you not then start python in admin mode, then the ability to turn off the function should be their.

I can while testing this, but if people with a standard user account use this program it won't work. I want something that will work no matter what.

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, rodrosenberg said:

Would suspending the process be a good stop gap?

Yes, but I don't believe that the program could identify every variant of ransomware, so I would rather do something that is guaranteed to work.

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, njmyers3 said:

I can while testing this, but if people with a standard user account use this program it won't work. I want something that will work no matter what.

then, inputting this admin line at the top would do the same thing as starting the program in admin state. https://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script

or this 

runas /user:mydomain\admin
"mmc.exe %windir%\system32\dsa.msc"
Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, CamTechCorner said:

then, inputting this admin line at the top would do the same thing as starting the program in admin state. https://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script

or this 


runas /user:mydomain\admin
"mmc.exe %windir%\system32\dsa.msc"

I'll look into that. I'm not sure that it'll work for a standard user but I'll check it out.

My main computer:

i7 6700k || GTX 1070 || Asus Z170 RGB || C.M. Hyper 212 EVO || 16GB RAM || 256GB NVMe SSD || 500GB SATA SSD || 12TB total HDD || Define R5 Blackout || 850W PSU

More Details Below :) 

Spoiler

 

CPU: Intel Core i7 6700k                             GPU:  EVGA GTX 1070 FTW                                  |  Motherboard: Asus Z170 Pro Gaming Aura
CPU Cooler: C.M. Hyper 212 EVO             RAM: 16GB Kingston Fury 4x4 DDR4 2400MHz         SSD:  Intel 256GB NVMe SSD & Plextor 500GB SATA SSD

Hard Drive:  WD 2TB Black, 2TB WD Blue, 8TB WD Red     Case:  Fractal Design Define R5 Blackout Edition   PSU:  Be Quiet! Dark Power Pro 11 850W

 

Additional Computer Parts: NZXT Hue for LEDs

Peripherals: Dell U2414H (x2) || Corsair Sabre RGB || Corsair K95 Platinum || Sennheiser 558's || Modmic

 

Pictures of setup:

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

It's likely that any ransomware on the system that's active is running in elevated privileges. And if it's competent, it also probably changed the file permissions on top of it. So if you want to have even a shot at stopping it, anything you run must have elevated privileges or higher.

 

And even then, I'm not hopeful anything short of killing the process or dismounting volumes can stop it. If it's running elevated, the game is over.

Link to comment
Share on other sites

Link to post
Share on other sites

you need to stop it before it executes. stopping it while it is already in full swing is hopeless. 

Sudo make me a sandwich 

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, CamTechCorner said:

turn off write privileges to the disk, then no changes can occur.

Windows defender also has the ability to lock write access to you files.

 

you can't block a root app from writing with permissions alone and you certainly can't block write access to a system drive.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

18 hours ago, njmyers3 said:

I'm writing a program in Python that detects when ransomware is encrypting files. So far, it does detect when ransomware is modifying files such as changing their contents, renaming, or deleting them, but it doesn't do anything useful. All it can tell me is the fact that ransomware is detected, but not prevent it. So I was wondering what it should do to prevent the ransomware. Here are some ideas I had:

  • Shutdown the system immediately, may not work depending on privileges of software or current open applications
  • Log out, may not actually stop the ransomware if it's running as a system process
  • I thought about stopping network access but that wouldn't really stop the encryption, just delay the key being sent

As you can see, there's a potential flaw with all of these. What would you recommend I do?

As far as I know, there is no real time removal of problems. What nearly all of them do is try to prevent a virus from getting into the system in the first place. If a virus does slip past, it is caught in scans: if a definite virus is found, it is marked as needing to be removed, then the computer rebooted and some tricks used to make sure the antivirus loads before anything else. If an indefinite virus is found it either asks the human or does other tests, such as running the program in a virtual machine to determine if it is malicious or not, once marked as malicious it does the same thing as a normal scan. If it can't decide, it notifies the administrator to make a decision about it.

The biggest key to modern antimalware is that it is pretty good at preventing viruses from ever being installed in the first place.

 

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×