PE Injection/Impersonation:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <wincrypt.h> | |
#include <stdio.h> | |
#pragma comment(lib, "advapi32.lib") | |
#define AES_KEY_SIZE 16 | |
#define IN_CHUNK_SIZE (AES_KEY_SIZE * 10) // a buffer must be a multiple of the key size | |
#define OUT_CHUNK_SIZE (IN_CHUNK_SIZE * 2) // an output buffer (for encryption) must be twice as big | |
//params: <input file> <output file> <is decrypt mode> <key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <iostream> | |
#include "ntdll_undoc.h" | |
PPEB get_default_peb() | |
{ | |
#if defined(_WIN64) | |
return (PPEB)__readgsqword(0x60); | |
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run] | |
@="Rundll32.exe SHELL32.DLL,ShellExec_RunDLL \"C:\\ProgramData\\test.exe\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <Windows.h> | |
// based on: https://www.evilsocket.net/2014/02/11/on-windows-syscall-mechanism-and-syscall-numbers-extraction-methods/ | |
// author: @evilsocket | |
// modified by: @hasherezade | |
#define IS_ADDRESS_BETWEEN( left, right, address ) ( (address) >= (left) && (address) < (right) ) | |
PIMAGE_SECTION_HEADER SectionByRVA( PIMAGE_SECTION_HEADER pSections, DWORD dwSections, DWORD rva ) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <iostream> | |
#include "ntddk.h" | |
bool enum_processes() | |
{ | |
ULONG retLen = 0; | |
// check length: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uu$$$$$$$$$$$uu | |
uu$$$$$$$$$$$$$$$$$uu | |
u$$$$$$$$$$$$$$$$$$$$$u | |
u$$$$$$$$$$$$$$$$$$$$$$$u | |
u$$$$$$$$$$$$$$$$$$$$$$$$$u | |
u$$$$$$* *$$$* *$$$$$$u | |
*$$$$* u$u $$$$* | |
$$$u u$u u$$$ | |
$$$u u$$$u u$$$ | |
*$$$$uu$$$ $$$uu$$$$* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <Windows.h> | |
//here we don't want to use any functions imported form extenal modules | |
typedef struct _LDR_MODULE { | |
LIST_ENTRY InLoadOrderModuleList;// +0x00 | |
LIST_ENTRY InMemoryOrderModuleList;// +0x08 | |
LIST_ENTRY InInitializationOrderModuleList;// +0x10 | |
void* BaseAddress; // +0x18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
"""Simple HTTP Server. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" | |
__version__ = "0.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"syscall" | |
"unsafe" | |
) | |
var ( | |
peSieveDll = syscall.NewLazyDLL("pe-sieve64.dll") |
NewerOlder