Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: C/C++ Build

on:
push:
pull_request:
workflow_dispatch:

jobs:
build-linux:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os-image:
- ubuntu:latest
- kalilinux/kali-rolling
- archlinux:latest

container:
image: ${{ matrix.os-image }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Build Dependencies
run: |
if command -v apt-get &> /dev/null; then
apt-get update
apt-get install -y \
build-essential \
g++-mingw-w64-x86-64-posix \
gcc-mingw-w64-x86-64-posix \
mingw-w64-tools \
gcc-mingw-w64-i686 \
g++-mingw-w64-i686 \
python3
elif command -v pacman &> /dev/null; then
pacman -Sy --noconfirm base-devel mingw-w64-gcc
fi

- name: Run Make
run: make


build-macos:
runs-on: macos-14

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Extra Dependencies
run: |
brew update || true
brew install mingw-w64

- name: Run Make
run: make


docker-verify:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Verify Docker Build
run: make docker-build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Creds-BOF/nanodump/dist/
.DS_Store
**/.DS_Store

.planning
.claude

*.o
*.swp
*.exe
Expand Down
1 change: 1 addition & 0 deletions Creds-BOF/cookie-monster/cookie-monster-bof.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <windows.h>
#include <objbase.h>
#include <stdint.h>
#include <ctype.h>
#include <stdio.h>
Expand Down
17 changes: 8 additions & 9 deletions Creds-BOF/nanodump/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ SSP_OPTIONS := -DPASS_PARAMS_VIA_NAMED_PIPES=1
nanodump:
@(mkdir dist 2>/dev/null) && echo 'creating dist' || echo 'dist exists'

@$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x64.exe $(OPTIONS) -DNANO -DEXE
@$(STRIP_x64) --strip-all dist/$(BOFNAME).x64.exe

@$(CC_x86) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x86.exe $(OPTIONS) -DNANO -DEXE
@$(STRIP_x86) --strip-all dist/$(BOFNAME).x86.exe

@$(CC_x64) -c source/entry.c -o dist/$(BOFNAME).x64.o $(OPTIONS) -DNANO -DBOF
@$(STRIP_x64) --strip-unneeded dist/$(BOFNAME).x64.o && echo '[+] nanodump x64' || echo '[!] nanodump x64'

@$(CC_x86) -c source/entry.c -o dist/$(BOFNAME).x86.o $(OPTIONS) -DNANO -DBOF
@$(STRIP_x86) --strip-unneeded dist/$(BOFNAME).x86.o && echo '[+] nanodump x86' || echo '[!] nanodump x86'

@$(GCC) source/bin2c.c -o dist/bin2c -static -s -Os
@$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x64.exe $(OPTIONS) -DNANO -DEXE
@$(STRIP_x64) --strip-all dist/$(BOFNAME).x64.exe && echo '[+] nanodump exe x64' || echo '[!] nanodump exe x64'

@$(CC_x86) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x86.exe $(OPTIONS) -DNANO -DEXE
@$(STRIP_x86) --strip-all dist/$(BOFNAME).x86.exe && echo '[+] nanodump exe x86' || echo '[!] nanodump exe x86'

@$(GCC) source/bin2c.c -o dist/bin2c -Os

@$(CC_x64) source/utils.c source/handle.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/dinvoke.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ssp.x64.dll $(OPTIONS) $(SSP_OPTIONS) -DNANO -DSSP -DDDL -shared
@$(STRIP_x64) --strip-all dist/$(BOFNAME)_ssp.x64.dll && echo '[+] nanodump_ssp Dll x64' || echo '[!] nanodump_ssp Dll x64'
Expand Down Expand Up @@ -75,8 +75,7 @@ nanodump:
@$(CC_x64) -c source/ppl/ppl.c -o dist/$(BOFNAME)_ppl_medic.x64.o $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DBOF -DPPL_MEDIC
@$(STRIP_x64) --strip-unneeded dist/$(BOFNAME)_ppl_medic.x64.o && echo '[+] nanodump_ppl_medic x64' || echo '[!] nanodump_ppl_medic x64'

@$(GCC) source/restore_signature.c -o scripts/restore_signature -static -s -Os
@$(STRIP_x64) --strip-all scripts/restore_signature
@$(GCC) source/restore_signature.c -o scripts/restore_signature -Os

clean:
@rm -f dist/*
10 changes: 10 additions & 0 deletions Creds-BOF/nanodump/include/ppl/ppl_medic.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#include "token_priv.h"
#include "dinvoke.h"
#include "handle.h"
#ifdef PPL_MEDIC
#ifndef CINTERFACE
#define CINTERFACE
#endif
#include <objbase.h>
#include <unknwn.h>
#include <oaidl.h>
#endif

#define TH32CS_SNAPTHREAD 0x00000004

Expand All @@ -27,8 +35,10 @@ typedef ULONGLONG(WINAPI* GetTickCount64_t) ();
typedef SC_HANDLE(WINAPI* OpenSCManagerW_t)(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess);
typedef SC_HANDLE(WINAPI* OpenServiceW_t)(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess);
typedef BOOL(WINAPI* CloseServiceHandle_t)(SC_HANDLE hSCObject);
#ifdef PPL_MEDIC
typedef HRESULT(WINAPI* LoadTypeLib_t)(LPCOLESTR szFile, ITypeLib **pptlib);
typedef HRESULT(WINAPI* CreateTypeLib2_t)(SYSKIND syskind, LPCOLESTR szFile, ICreateTypeLib2 **ppctlib);
#endif
typedef BSTR(WINAPI* SysAllocString_t)(const OLECHAR *psz);
typedef VOID(WINAPI* SysFreeString_t)(BSTR bstrString);
typedef HANDLE(WINAPI* CreateToolhelp32Snapshot_t)(DWORD dwFlags, DWORD th32ProcessID);
Expand Down
9 changes: 9 additions & 0 deletions Creds-BOF/nanodump/include/ppl/ppl_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

#include <windows.h>
#include <winternl.h>
#ifdef PPL_MEDIC
#ifndef CINTERFACE
#define CINTERFACE
#endif
#include <objbase.h>
#include <unknwn.h>
#endif

#include "utils.h"
#include "dinvoke.h"
Expand Down Expand Up @@ -131,8 +138,10 @@ BOOL get_registry_string_value(
IN LPCWSTR ValueName,
OUT LPWSTR* ValueData);

#ifdef PPL_MEDIC
VOID safe_release(
IN IUnknown** Interface);
#endif

BOOL generate_temp_path(
OUT LPWSTR* Buffer);
Expand Down
3 changes: 3 additions & 0 deletions Creds-BOF/nanodump/source/dinvoke.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "dinvoke.h"
#ifndef BOF
#include <stdlib.h>
#endif

// used by spoof_callstack
PVOID find_dll_by_pointer(
Expand Down
3 changes: 3 additions & 0 deletions Creds-BOF/nanodump/source/entry.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "entry.h"
#ifndef BOF
#include <stdlib.h>
#endif

#ifdef BOF
#include "nanodump.c"
Expand Down
3 changes: 3 additions & 0 deletions Creds-BOF/nanodump/source/ppl/ppl_dump.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "ppl/ppl_dump.h"
#ifndef BOF
#include <stdlib.h>
#endif

BOOL run_ppl_dump_exploit(
IN unsigned char nanodump_ppl_dump_dll[],
Expand Down
2 changes: 2 additions & 0 deletions Creds-BOF/nanodump/source/ppl/ppl_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ VOID safe_free(
}
}

#ifdef PPL_MEDIC
VOID safe_release(
IN IUnknown** Interface)
{
Expand All @@ -632,6 +633,7 @@ VOID safe_release(
*Interface = NULL;
}
}
#endif

BOOL get_type_lib_reg_value_path(
OUT LPWSTR* TypeLibRegValuePath)
Expand Down
3 changes: 3 additions & 0 deletions Creds-BOF/nanodump/source/ssp/ssp.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "ssp/ssp.h"
#include "ssp/ssp_utils.h"
#ifndef BOF
#include <stdlib.h>
#endif

DWORD WINAPI load_ssp(LPVOID Parameter)
{
Expand Down
3 changes: 3 additions & 0 deletions Creds-BOF/nanodump/source/ssp/ssp_utils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "ssp/ssp_utils.h"
#include "utils.h"
#include "pipe.h"
#ifndef BOF
#include <stdlib.h>
#endif

BOOL generate_random_dll_path(
OUT LPSTR* random_path)
Expand Down
3 changes: 3 additions & 0 deletions Creds-BOF/nanodump/source/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
#include "dinvoke.h"
#include "syscalls.h"
#include "adaptix.h"
#ifndef BOF
#include <stdlib.h>
#endif

#ifndef SSP

Expand Down
1 change: 1 addition & 0 deletions Elevation-BOF/potato-dcom/DCOMPotato.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <windows.h>
#include <stdio.h>
#include <objbase.h>
#include <ocidl.h>
#include <lm.h>
#include "bofdefs.h"
Expand Down
1 change: 1 addition & 0 deletions Elevation-BOF/uac_sspi/SspiUacBypassBOF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define SECURITY_WIN32

#include <windows.h>
#include <objbase.h>
#include <stdio.h>
#include <security.h>

Expand Down
1 change: 1 addition & 0 deletions Execution-BOF/No-Consolation/include/utils.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#pragma once
#include <limits.h>

#define ARGUMENT_PRESENT(ArgumentPointer) \
((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL)
Expand Down
1 change: 1 addition & 0 deletions Postex-BOF/ScreenshotBOF/entry.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <windows.h>
#include <objbase.h>
#include <stdio.h>
#include <stdlib.h>
#include <gdiplus.h>
Expand Down
1 change: 1 addition & 0 deletions Postex-BOF/firewallrule/addfirewallrule.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <windows.h>
#include <objbase.h>
#include <netfw.h>
#include "firewallrule.h"
#include "beacon.h"
Expand Down
1 change: 1 addition & 0 deletions SAL-BOF/arp/arp.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <windows.h>
#include <objbase.h>
#include <iphlpapi.h>
#include "bofdefs.h"
#include "base.c"
Expand Down
1 change: 1 addition & 0 deletions SAL-BOF/ipconfig/ipconfig.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <windows.h>
#include <objbase.h>
#include <iphlpapi.h>
#include "bofdefs.h"
#include "base.c"
Expand Down
1 change: 1 addition & 0 deletions SAL-BOF/netstat/netstat.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <windows.h>
#include <objbase.h>
#include <winbase.h>
#include <iphlpapi.h>
#include "bofdefs.h"
Expand Down
1 change: 1 addition & 0 deletions SAL-BOF/routeprint/routeprint.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <windows.h>
#include <objbase.h>
#include <iphlpapi.h>
#include "bofdefs.h"
#include "base.c"
Expand Down
1 change: 1 addition & 0 deletions SAR-BOF/EdrEnum-BOF/bofdefs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#pragma intrinsic(memcmp, memcpy,strcpy,strcmp,_stricmp,strlen)
#include <objbase.h>
#include <windows.h>
#include <process.h>
#include <winternl.h>
Expand Down
1 change: 1 addition & 0 deletions _include/bofdefs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once
#pragma intrinsic(memcmp, memcpy,strcpy,strcmp,_stricmp,strlen)
#include <objbase.h>
#include <windows.h>
#include <process.h>
#include <winternl.h>
Expand Down