Discussione Malware Crypter C# con errore

  • Autore discussione Utente cancellato 275412
  • Data d'inizio
U

Utente cancellato 275412

Ultima modifica da un moderatore:
Ciao sto scrivendo un crypter C# in base64 (è solo un test e poi se funziona uso AES), solo che ha un errore perche io ho generato meterpreter windows da kali wsl e ora quando provo ad aprirla con il crypter mi da sempre errore, ho provato ad aprirla con type e mi dice che non lo può aprire perché è una backdoor, questo è il codice
C#:
using System;
using System.IO;
using System.Text;

namespace Crypter
{
    class Program
    {
        static void Main(string[] args)
        {
            Crypter crypter = new Crypter(@"Crypter\example.exe");
            crypter.Encrypt();
        }
    }
    class Crypter
    {
        public string filename;
        public Crypter(string _filename)
        {
            if (!File.Exists(_filename))
            {
                Console.WriteLine($"[-] The file {_filename} doesn't exist");
                Environment.Exit(1);
            }
            filename = _filename;
        }
        public void Encrypt()
        {
            Console.WriteLine("[*] I crypting the file...");
            byte[] buffer = File.ReadAllBytes(filename);
            string encrypted= Convert.ToBase64String(buffer);
            byte[] bytes = Encoding.ASCII.GetBytes(encrypted);
            File.WriteAllBytes(filename,bytes);
            Console.WriteLine("[+] The file has been crypted!");
        }

    }
}

qualcuno può dirmi l'errore? scusate se faccio molte domande nel forum.
Messaggio unito automaticamente:

Aggiungo che appena ho creato la backdoor l'antivirus di windows ha dato subito alert quindi il sistema la rileva come virus.
Messaggio unito automaticamente:

Ora sono riuscito a farlo funzionare, ma sempre un errore ci è:


e il codice è questo:
C#:
using System;
using System.IO;
using System.Text;

namespace Crypter
{
    class Program
    {
        static void Main(string[] args)
        {
            Crypter crypter = new Crypter(@"/home/kali/example.exe");
            crypter.Encrypt();
        }
    }
    class Crypter
    {
        public string filename;
        public Crypter(string _filename)
        {
            if (!File.Exists(_filename))
            {
                Console.WriteLine($"[-] The file {_filename} doesn't exist");
                Environment.Exit(1);
            }
            filename = _filename;
        }
        public void Encrypt()
        {
            Console.WriteLine("[*] I crypting the file...");
            byte[] buffer = File.ReadAllBytes(filename);
            string encrypted= Convert.ToBase64String(buffer);
            byte[] bytes = Encoding.ASCII.GetBytes(encrypted);
            File.WriteAllBytes(filename,bytes);
            Console.WriteLine("[+] The file has been crypted!");
        }

    }
}
 
Ok ma il problema è come cripto i byte[], ho già scritto il runPE ma anche se uso System.Security.Cryptography.Aes non riesce a criptare i byte[] ho seguito le guide di stackoverflow e nei siti di mictosoft e altri siti tutorial trovati su internet e non ho trovato un modo per criptare i byte[]