Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
c04d07a
feat(29-01): declare token API contracts in TK-BOF/bofdefs.h and root…
TGJLS May 23, 2026
25f8b9b
feat(29-01): write 6 silent BOF stubs with arg scaffolding
TGJLS May 23, 2026
633b4ff
feat(29-01): wire TK-BOF Makefile and add TK-BOF to root SUBDIRS
TGJLS May 23, 2026
87b2db4
docs(29-01): complete TK-BOF build skeleton plan
TGJLS May 23, 2026
35f036a
chore: merge executor worktree (worktree-agent-a84340820aa537f24)
TGJLS May 23, 2026
3530bb2
fix(29): CR-01 fix include order and chain-include shared bofdefs
TGJLS May 23, 2026
6020de1
fix(29): WR-01 change token_handle from DWORD to HANDLE in rm.c and u…
TGJLS May 23, 2026
b40036f
fix(29): WR-02 declare MSVCRT$memset in _include/bofdefs.h
TGJLS May 23, 2026
dccf5fe
docs(29): mark REVIEW.md as fixed after applying all 3 findings
TGJLS May 23, 2026
145596a
docs(30): capture phase context
TGJLS May 23, 2026
c834f74
docs(state): record phase 30 context session
TGJLS May 23, 2026
7323baf
feat(30-01): create TK-BOF/tkerror.h with TkErrorMessage helper
TGJLS May 23, 2026
3d5826a
feat(30-01): create TK-BOF/tkerror.h with TkErrorMessage helper
TGJLS May 23, 2026
8638487
feat(30-01): implement TK-BOF/steal/steal.c token acquisition chain
TGJLS May 23, 2026
fa4025b
docs(30-01): complete tkerror.h + steal.c plan
TGJLS May 23, 2026
3f7d9c9
chore: merge executor worktree (worktree-agent-a5fd8379fe66d9cb2)
TGJLS May 23, 2026
1a733df
feat(30-02): implement TK-BOF/use/use.c — ImpersonateLoggedOnUser by …
TGJLS May 23, 2026
1888e18
feat(30-02): implement TK-BOF/rm/rm.c — NtClose with raw NTSTATUS hex…
TGJLS May 23, 2026
a895e65
feat(30-02): implement TK-BOF/revert/revert.c — RevertToSelf with no …
TGJLS May 23, 2026
a55fe05
docs(30-02): complete use/rm/revert plan — TK-02 TK-04 TK-05 satisfied
TGJLS May 23, 2026
27d643a
chore: merge executor worktree (worktree-agent-a85e3feefda156059)
TGJLS May 23, 2026
1939df6
fix(30): WR-01 use %llx/(unsigned long long) for handle printf on Min…
TGJLS May 23, 2026
858ffa0
docs(31): capture phase context
TGJLS May 24, 2026
02aa6a5
docs(state): record phase 31 context session
TGJLS May 24, 2026
126202a
docs(31): create phase plan — tk make + tk privget (2 plans, 2 waves)
TGJLS May 24, 2026
ec89d76
feat(31-01): add OpenThreadToken, GetCurrentThread, GetCurrentProcess…
TGJLS May 24, 2026
99f05cc
feat(31-01): implement make.c — LogonUserA credential token creation BOF
TGJLS May 24, 2026
f6eadef
docs(31-01): complete tk-make plan — bofdefs.h declarations + make.c …
TGJLS May 24, 2026
06d6de5
chore: merge executor worktree (worktree-agent-a555ee2c7ba3839f8)
TGJLS May 24, 2026
eb2ab7b
docs(phase-31): update tracking after wave 1
TGJLS May 24, 2026
bf8e231
feat(31-02): implement privget BOF — OpenThreadToken/OpenProcessToken…
TGJLS May 24, 2026
bd73eed
docs(31-02): complete privget plan — TK-06 implemented, all 12 target…
TGJLS May 24, 2026
0b2ff93
chore: merge executor worktree (worktree-agent-a954f7d4e0985bcc2)
TGJLS May 24, 2026
44584a4
docs(phase-31): update tracking after wave 2
TGJLS May 24, 2026
a62a693
docs(31): add code review report
TGJLS May 24, 2026
c38c5bd
fix(31): address code review findings — CR-01, WR-01, WR-02, IN-01
TGJLS May 24, 2026
4e7548a
test(31): persist human verification items as UAT
TGJLS May 24, 2026
e6687af
docs(31): mark REVIEW.md fixed — all 4 findings resolved in c38c5bd
TGJLS May 24, 2026
d53436c
docs(32): create phase plan — 3 plans across 2 waves
TGJLS May 24, 2026
e292486
docs(32): record planning complete in STATE.md
TGJLS May 24, 2026
59d4159
Merge remote-tracking branch 'origin/main'
TGJLS May 24, 2026
b65eefc
feat(32-01): replace ADVAPI32$LogonUserA with LogonUserW in bofdefs.h
TGJLS May 24, 2026
0f972a5
feat(32-01): convert make.c to LogonUserW with WCHAR* args
TGJLS May 24, 2026
65dfe16
docs(32-01): create SUMMARY.md — merge + LogonUserW conversion complete
TGJLS May 24, 2026
faba094
feat(32-02): create TK-BOF/tk.axs registering all 6 subcommands beaco…
TGJLS May 24, 2026
ffc58ce
feat(32-02): add TK-BOF/tk.axs script_load to bof-collection.axs
TGJLS May 24, 2026
6a6d07b
docs(32-03): create TK-BOF/README.md with handle lifecycle and per-co…
TGJLS May 24, 2026
15b5fa2
docs(32-03): add TK-BOF section to root README.md and extend Kharon c…
TGJLS May 24, 2026
318b609
docs(32-03): complete TK-BOF documentation plan — SUMMARY.md
TGJLS May 24, 2026
4b06cf1
docs(32-02): create SUMMARY.md — tk.axs wiring complete
TGJLS May 24, 2026
8a51e34
chore: merge executor worktree (worktree-agent-a0002372404b02dee, pla…
TGJLS May 24, 2026
a6479b0
chore: merge executor worktree (worktree-agent-ad3f13692e4934b29, pla…
TGJLS May 24, 2026
d0df251
docs(32): update tracking after wave 2 — all 3 plans complete
TGJLS May 24, 2026
568f97c
docs(32): add code review report
TGJLS May 24, 2026
213203c
docs(32): add VERIFICATION.md — gaps_found (TK-09 table + Kharon in T…
TGJLS May 24, 2026
5d93603
docs(32-03): add command table and Kharon credit to TK-BOF/README.md
TGJLS May 24, 2026
c819c02
docs(32): mark VERIFICATION.md complete — all 7 must-haves satisfied
TGJLS May 24, 2026
22bb238
fix(32): CR-01 add TK-BOF deployment and verification steps to CI wor…
TGJLS May 25, 2026
4c28e87
fix(32): WR-01 fix ADVAPI32 qualifier and remove duplicate declaratio…
TGJLS May 25, 2026
da010c4
fix(32): WR-02 add comment explaining beacon-only registration in tk.axs
TGJLS May 25, 2026
e3a7954
fix(32): revert WINADVAPI to WINBASEAPI in TK-BOF/bofdefs.h
TGJLS May 25, 2026
8bded70
docs(33): capture phase context
TGJLS May 25, 2026
2bde3a2
docs(state): record phase 33 context session
TGJLS May 25, 2026
4a082f2
docs(33): create phase plan
TGJLS May 25, 2026
1f11a3c
feat(33-01): add Create tk_test user PowerShell step to test.yaml (D-07)
TGJLS May 25, 2026
0a75d87
feat(33-01): append TK-BOF block to tasks.yaml (TK-11, D-01 through D…
TGJLS May 25, 2026
3e65268
docs(phase-33): update tracking after wave 1
TGJLS May 25, 2026
bb9540c
fix(33): relax local password policy before New-LocalUser tk_test
TGJLS May 25, 2026
9a36d50
fix(33): register tk commands for gopher and kharon agent types
TGJLS May 25, 2026
76b0dc7
fix(33): parse hex token handles and move TK-BOF tests to front
TGJLS May 25, 2026
9f77bca
fix(33): restore trailing space in copy-wildcard-no-match expected ou…
TGJLS May 26, 2026
1326403
chore: remove .planning from tk-bof branch
TGJLS May 26, 2026
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
44 changes: 44 additions & 0 deletions .github/ci/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,50 @@

tasks:

# ── TK-BOF ──

# tk-spawn-fixture (D-01, D-02)
- cmdline: 'ps run --command "ping -n 999 127.0.0.1"'
expected_regex: "Process started: PID \\d+"
capture:
tk_pid: "Process started: PID (\\d+)"

# tk-steal-immediate (D-03)
- cmdline: "tk steal {{tk_pid}}"
expected_regex: "\\[\\+\\] Handle: 0x[0-9a-fA-F]+"
not_expected: "error"

# tk-revert-after-steal (D-03)
- cmdline: "tk revert"
expected: "[+] Reverted to process token."

# tk-steal-noapply (D-04)
- cmdline: "tk steal {{tk_pid}} --no-apply"
expected_regex: "\\[\\+\\] Handle: 0x[0-9a-fA-F]+ \\(impersonation not applied\\)"
capture:
tk_handle: "Handle: (0x[0-9a-fA-F]+)"

# tk-use (D-04)
- cmdline: "tk use {{tk_handle}}"
expected_regex: "\\[\\+\\] Impersonating handle 0x[0-9a-fA-F]+"

# tk-rm (D-04)
- cmdline: "tk rm {{tk_handle}}"
expected_regex: "\\[\\+\\] Handle 0x[0-9a-fA-F]+ closed\\."

# tk-make (D-08)
- cmdline: "tk make --username tk_test --password Tk_Test_Pass1!"
expected_regex: "\\[\\+\\] Handle: 0x[0-9a-fA-F]+"
not_expected: "error"

# tk-revert-after-make (D-09)
- cmdline: "tk revert"
expected: "[+] Reverted to process token."

# tk-privget (D-10)
- cmdline: "tk privget"
not_expected: "error"

# ── TYPE ──

# type-happy-path
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@ jobs:
Set-LocalUser $env:CI_USER -Password $pass
}

- name: Create tk_test user
shell: powershell
run: |
# Relax local password policy so the hardcoded test credential is accepted
# on runners with non-default minimum-length or complexity settings.
$cfgPath = "$env:TEMP\secpol.cfg"
secedit /export /cfg $cfgPath /quiet
(Get-Content $cfgPath) `
-replace 'PasswordComplexity\s*=\s*1', 'PasswordComplexity = 0' `
-replace 'MinimumPasswordLength\s*=\s*\d+', 'MinimumPasswordLength = 0' |
Set-Content $cfgPath
secedit /configure /db "$env:windir\security\local.sdb" /cfg $cfgPath /areas SECURITYPOLICY /quiet
Remove-Item $cfgPath -Force -ErrorAction SilentlyContinue
$pass = ConvertTo-SecureString 'Tk_Test_Pass1!' -AsPlainText -Force
if (-not (Get-LocalUser tk_test -ErrorAction SilentlyContinue)) {
New-LocalUser tk_test -Password $pass -PasswordNeverExpires
} else {
Set-LocalUser tk_test -Password $pass
}

- name: Start OpenSSH Server with password auth
shell: powershell
run: |
Expand Down Expand Up @@ -267,6 +287,9 @@ jobs:
mkdir -p /tmp/adaptixc2/dist/BOF-Collection/PS-BOF/_bin
cp /workspace/PS-BOF/_bin/*.o /tmp/adaptixc2/dist/BOF-Collection/PS-BOF/_bin/
cp /workspace/PS-BOF/ps.axs /tmp/adaptixc2/dist/BOF-Collection/PS-BOF/
mkdir -p /tmp/adaptixc2/dist/BOF-Collection/TK-BOF/_bin
cp /workspace/TK-BOF/_bin/*.o /tmp/adaptixc2/dist/BOF-Collection/TK-BOF/_bin/
cp /workspace/TK-BOF/tk.axs /tmp/adaptixc2/dist/BOF-Collection/TK-BOF/
cp /workspace/bof-collection.axs /tmp/adaptixc2/dist/BOF-Collection/

# ── Build verification ───────────────────────────────────────
Expand All @@ -283,6 +306,12 @@ jobs:
count=$(ls /tmp/adaptixc2/dist/BOF-Collection/PS-BOF/_bin/*.x64.o | wc -l)
[ "$count" -eq 6 ] && echo "✓ All 6 PS-BOF x64 objects deployed to container" || \
{ echo "✗ Expected 6 PS-BOF x64 objects in container bin, got $count"; exit 1; }
count=$(ls /workspace/TK-BOF/_bin/*.x64.o | wc -l)
[ "$count" -eq 6 ] && echo "✓ All 6 TK-BOF x64 objects compiled" || \
{ echo "✗ Expected 6 TK-BOF x64 objects, got $count"; exit 1; }
count=$(ls /tmp/adaptixc2/dist/BOF-Collection/TK-BOF/_bin/*.x64.o | wc -l)
[ "$count" -eq 6 ] && echo "✓ All 6 TK-BOF x64 objects deployed to container" || \
{ echo "✗ Expected 6 TK-BOF x64 objects in container bin, got $count"; exit 1; }
echo "=== Build verification passed ==="

uv tool install --reinstall "git+https://github.com/TheGr3atJosh/Testing-Kit@c53a47d"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS := FS-BOF Exit-BOF PS-BOF
SUBDIRS := FS-BOF Exit-BOF TK-BOF PS-BOF

.PHONY: all $(SUBDIRS) clean docker-build

Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,20 @@ Process management: ps list, ps kill, ps run, ps grep, ps suspend, ps resume. [M
|ps suspend|`ps suspend <PID>`|Suspend a process|
|ps resume|`ps resume <PID>`|Resume a suspended process|

## TK-BOF

Token management: steal, use, make, rm, revert, privget. [More details](TK-BOF/README.md)

|Commands|Usage|Notes|
|--------|-----|-----|
|steal|`tk steal <pid>`|Duplicate a process token; optionally skip impersonation with `--no-apply`|
|use|`tk use <token_handle>`|Impersonate a previously obtained token handle|
|make|`tk make <username> <password>`|Create a token via LogonUserW; supports `--domain`, `--logon-type`, `--no-apply`|
|rm|`tk rm <token_handle>`|Close a token handle and free the kernel object|
|revert|`tk revert`|Drop impersonation and revert to process token|
|privget|`tk privget`|Enable all privileges on the current token|

## Credits

- [Extension-Kit](https://github.com/Adaptix-Framework/Extension-Kit): Project structure and README
- [Kharon](https://github.com/entropy-z/Kharon): PS-BOF command implementations
- [Kharon](https://github.com/entropy-z/Kharon): PS-BOF and TK-BOF command implementations
25 changes: 25 additions & 0 deletions TK-BOF/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CC64 = x86_64-w64-mingw32-gcc
CC86 = i686-w64-mingw32-gcc
STRIP64 = x86_64-w64-mingw32-strip --strip-unneeded
STRIP86 = i686-w64-mingw32-strip --strip-unneeded
CFLAGS = -I . -I ../_include -w -Wno-incompatible-pointer-types -Os -DBOF -c

all: bof

bof: clean
@(mkdir _bin 2>/dev/null) && echo 'creating _bin directory' || echo '_bin directory exists'
@($(CC64) $(CFLAGS) steal/steal.c -o _bin/steal.x64.o && $(STRIP64) _bin/steal.x64.o) && echo '[+] steal x64' || echo '[!] steal x64'
@($(CC86) $(CFLAGS) steal/steal.c -o _bin/steal.x32.o && $(STRIP86) _bin/steal.x32.o) && echo '[+] steal x32' || echo '[!] steal x32'
@($(CC64) $(CFLAGS) use/use.c -o _bin/use.x64.o && $(STRIP64) _bin/use.x64.o) && echo '[+] use x64' || echo '[!] use x64'
@($(CC86) $(CFLAGS) use/use.c -o _bin/use.x32.o && $(STRIP86) _bin/use.x32.o) && echo '[+] use x32' || echo '[!] use x32'
@($(CC64) $(CFLAGS) make/make.c -o _bin/make.x64.o && $(STRIP64) _bin/make.x64.o) && echo '[+] make x64' || echo '[!] make x64'
@($(CC86) $(CFLAGS) make/make.c -o _bin/make.x32.o && $(STRIP86) _bin/make.x32.o) && echo '[+] make x32' || echo '[!] make x32'
@($(CC64) $(CFLAGS) rm/rm.c -o _bin/rm.x64.o && $(STRIP64) _bin/rm.x64.o) && echo '[+] rm x64' || echo '[!] rm x64'
@($(CC86) $(CFLAGS) rm/rm.c -o _bin/rm.x32.o && $(STRIP86) _bin/rm.x32.o) && echo '[+] rm x32' || echo '[!] rm x32'
@($(CC64) $(CFLAGS) revert/revert.c -o _bin/revert.x64.o && $(STRIP64) _bin/revert.x64.o) && echo '[+] revert x64' || echo '[!] revert x64'
@($(CC86) $(CFLAGS) revert/revert.c -o _bin/revert.x32.o && $(STRIP86) _bin/revert.x32.o) && echo '[+] revert x32' || echo '[!] revert x32'
@($(CC64) $(CFLAGS) privget/privget.c -o _bin/privget.x64.o && $(STRIP64) _bin/privget.x64.o) && echo '[+] privget x64' || echo '[!] privget x64'
@($(CC86) $(CFLAGS) privget/privget.c -o _bin/privget.x32.o && $(STRIP86) _bin/privget.x32.o) && echo '[+] privget x32' || echo '[!] privget x32'

clean:
@(rm -rf _bin)
72 changes: 72 additions & 0 deletions TK-BOF/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# TK-BOF

Token management: steal, use, make, rm, revert, privget

|Commands|Usage|Notes|
|--------|-----|-----|
|steal|`tk steal <pid>`|Duplicate a process token; optionally skip impersonation with `--no-apply`|
|use|`tk use <token_handle>`|Impersonate a previously obtained token handle|
|make|`tk make <username> <password>`|Create a token via LogonUserW; supports `--domain`, `--logon-type`, `--no-apply`|
|rm|`tk rm <token_handle>`|Close a token handle and free the kernel object|
|revert|`tk revert`|Drop impersonation and revert to process token|
|privget|`tk privget`|Enable all privileges on the current token|

## Handle Lifecycle

tk rm <handle> closes the kernel object — the handle is gone and cannot be reused. tk revert drops impersonation but keeps handles alive — the token can be re-activated with tk use. Always tk rm handles you no longer need to avoid leaking kernel objects in the beacon process.

## steal

Duplicate a process token by PID via OpenProcessToken + DuplicateTokenEx. Impersonation is applied immediately via ImpersonateLoggedOnUser unless --no-apply is passed. The duplicated handle is printed for later reuse with `tk use`.

```
tk steal <pid>
tk steal <pid> --no-apply
```

## use

Impersonate a previously obtained token handle via ImpersonateLoggedOnUser.

```
tk use <token_handle>
```

## make

Create a token from plaintext credentials via LogonUserW. Impersonation is applied immediately unless --no-apply is passed. The token handle is printed for later reuse with `tk use`.

```
tk make <username> <password>
tk make <username> <password> --domain <domain>
tk make <username> <password> --logon-type <type>
tk make <username> <password> --no-apply
```

## rm

Close a token handle and free the kernel object. The handle is gone after this call and cannot be reused with `tk use`.

```
tk rm <token_handle>
```

## revert

Drop impersonation and revert to the process token. Open token handles are not closed; they remain valid and can be reused with `tk use`.

```
tk revert
```

## privget

Enable all privileges on the current token by iterating the token's privilege set and calling AdjustTokenPrivileges.

```
tk privget
```

## Credits

- [Kharon](https://github.com/entropy-z/Kharon): TK-BOF command implementations
40 changes: 40 additions & 0 deletions TK-BOF/bofdefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#pragma once
#include "../_include/bofdefs.h"
#include <windows.h>
#include <winternl.h>

// =============================================================================
// ADVAPI32 — token acquisition
// =============================================================================
WINBASEAPI BOOL WINAPI ADVAPI32$DuplicateTokenEx(HANDLE hExistingToken, DWORD dwDesiredAccess, LPSECURITY_ATTRIBUTES lpTokenAttributes, SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, TOKEN_TYPE TokenType, PHANDLE phNewToken);

// =============================================================================
// ADVAPI32 — impersonation
// =============================================================================
WINBASEAPI BOOL WINAPI ADVAPI32$ImpersonateLoggedOnUser(HANDLE hToken);
WINBASEAPI BOOL WINAPI ADVAPI32$RevertToSelf(VOID);

// =============================================================================
// ADVAPI32 — credential-based token creation
// =============================================================================
WINBASEAPI BOOL WINAPI ADVAPI32$LogonUserW(LPCWSTR lpszUsername, LPCWSTR lpszDomain, LPCWSTR lpszPassword, DWORD dwLogonType, DWORD dwLogonProvider, PHANDLE phToken);

// =============================================================================
// ADVAPI32 — token introspection and modification
// =============================================================================
WINBASEAPI BOOL WINAPI ADVAPI32$GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength);

// =============================================================================
// ADVAPI32 — thread token
// =============================================================================
WINBASEAPI BOOL WINAPI ADVAPI32$OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, PHANDLE TokenHandle);

// =============================================================================
// KERNEL32 — pseudo-handles
// =============================================================================
WINBASEAPI HANDLE WINAPI KERNEL32$GetCurrentThread(VOID);

// =============================================================================
// NTDLL — handle close (rm BOF uses NtClose to close token handle)
// =============================================================================
WINBASEAPI NTSTATUS NTAPI NTDLL$NtClose(HANDLE Handle);
58 changes: 58 additions & 0 deletions TK-BOF/make/make.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include <windows.h>
#include "beacon.h"
#include "bofdefs.h"
#include "../tkerror.h"

VOID go(IN PCHAR Buffer, IN ULONG Length)
{
datap parser;
WCHAR *username = NULL;
WCHAR *password = NULL;
WCHAR *domain = NULL;
BOOL no_apply = FALSE;
int logon_type = 0;
HANDLE hToken = NULL;
DWORD dwError = 0;
char errMsg[256];

BeaconDataParse(&parser, Buffer, Length);
username = (WCHAR*) BeaconDataExtract(&parser, NULL);
password = (WCHAR*) BeaconDataExtract(&parser, NULL);
domain = (WCHAR*) BeaconDataExtract(&parser, NULL);
no_apply = (BOOL) BeaconDataInt(&parser);
logon_type = (int) BeaconDataInt(&parser);

if (!username || !password)
{
BeaconPrintf(CALLBACK_ERROR, "[-] make: missing username or password argument\n");
return;
}

if (logon_type == 0) logon_type = 9;
const WCHAR *dom = (domain && domain[0]) ? domain : L".";

if (!ADVAPI32$LogonUserW(username, dom, password, (DWORD)logon_type, LOGON32_PROVIDER_DEFAULT, &hToken))
{
dwError = KERNEL32$GetLastError();
TkErrorMessage(dwError, errMsg, sizeof(errMsg));
BeaconPrintf(CALLBACK_ERROR, "[-] make: LogonUserW failed: %s\n", errMsg);
return;
}

if (!no_apply)
{
if (!ADVAPI32$ImpersonateLoggedOnUser(hToken))
{
dwError = KERNEL32$GetLastError();
TkErrorMessage(dwError, errMsg, sizeof(errMsg));
BeaconPrintf(CALLBACK_ERROR, "[-] make: ImpersonateLoggedOnUser failed: %s\n", errMsg);
NTDLL$NtClose(hToken);
return;
}
BeaconPrintf(CALLBACK_OUTPUT, "[+] Handle: 0x%llx\n", (unsigned long long) hToken);
}
else
{
BeaconPrintf(CALLBACK_OUTPUT, "[+] Handle: 0x%llx (impersonation not applied)\n", (unsigned long long) hToken);
}
}
Loading
Loading