TangledWinExec icon indicating copy to clipboard operation
TangledWinExec copied to clipboard

Question

Open KRAFMA opened this issue 3 years ago • 25 comments

Hello why you not implemented the : InitializeProcThreadAttributeList UpdateProcThreadAttribute on the TransactedHollowing ?

Cause the actual parent id work but i know a better , is cause Ntcreateprocess ? need createprocess ?

KRAFMA avatar Oct 03 '22 21:10 KRAFMA

My PE Injection PoCs use NtCreateProcessEx which allows PPID for 4th parameter, ao InitializeProcThreadAttributeList API and UpdateProcThreadAttribute API are not required.

https://github.com/daem0nc0re/TangledWinExec/blob/1298c5b140120386e67deb3584011c19dc58fbc2/TransactedHollowing/TransactedHollowing/Interop/NativeMethods.cs#L116

Additionally, I do so because I want to use only Nt APIs for PoC whenever possible.

daem0nc0re avatar Oct 03 '22 22:10 daem0nc0re

Yes but is for implement block dll : BLOCK_NON_MICROSOFT_BINARIES_ALWAYS_ON

KRAFMA avatar Oct 04 '22 01:10 KRAFMA

Thanks for sharing your opinion. Essentially, the purpose of this repository is not to provide attack tools, but to provide PoCs for research or investigation about process execution techniques. If the current implementation is inconvenient to investigate the technique, please give me specific examples so I can consider changing it.

daem0nc0re avatar Oct 04 '22 07:10 daem0nc0re

i try some solution for Ntcreate and check the integrity process before spoof the ppid for have more target , i update you later btw Any your poc can load .net file ? or only for native file ?

KRAFMA avatar Oct 09 '22 11:10 KRAFMA

Thanks for your support.

Any your poc can load .net file ? or only for native file ?

I have not tried with .NET file yet. I've been busy lately and won't have time for a while, sorry.

daem0nc0re avatar Oct 09 '22 12:10 daem0nc0re

.net seem not work but i'm sure can fix btw : https://twitter.com/_RastaMouse/status/1524761507782873088 https://offensivedefence.co.uk/posts/ntcreateuserprocess/ is c++ and atm i use this and his amazing : https://i.gyazo.com/32d08b93537801c64b256693ff16ee81.png

KRAFMA avatar Oct 10 '22 17:10 KRAFMA

Thanks for sharing! I will try to address this issue next week or the week after.

daem0nc0re avatar Oct 10 '22 23:10 daem0nc0re

I like your poc so i want try improve a bit :) Good luck

KRAFMA avatar Oct 11 '22 10:10 KRAFMA

I'm happy to hear that! I will try as soon as possible 💪

daem0nc0re avatar Oct 12 '22 00:10 daem0nc0re

I started from .NET binary issue and added .NET binary support to PE file parser of TransactedHollowing PoC. But NtCreateProcessEx and NtMapViewOfSection returns NTSTATUS 0x4000000E : {Machine Type Mismatch} for .NET binary. Do you have any idea?

daem0nc0re avatar Oct 17 '22 08:10 daem0nc0re

<3 love you going test

KRAFMA avatar Oct 17 '22 11:10 KRAFMA

I started from .NET binary issue and added .NET binary support to PE file parser of TransactedHollowing PoC. But NtCreateProcessEx and NtMapViewOfSection returns NTSTATUS 0x4000000E : {Machine Type Mismatch} for .NET binary. Do you have any idea?

Not very but i can investigate

KRAFMA avatar Oct 17 '22 11:10 KRAFMA

OK. I will continue to investigate the .NET issue, but will work on the PPID first.

daem0nc0re avatar Oct 17 '22 11:10 daem0nc0re

Added the feature you requested to my TransactedHollowing PoC. Check this commit.

daem0nc0re avatar Oct 24 '22 05:10 daem0nc0re

Added the feature you requested to my TransactedHollowing PoC. Check this commit.

Love your work !!! good job i have tested some solutions for try add net support but nothings new from my part

KRAFMA avatar Oct 24 '22 14:10 KRAFMA

Little issue , if i choose block dll but the ppid is 0 we can got a error like this (sorry french pc)

1f112ee408e5afa03c5df1e5cf5e96ed

KRAFMA avatar Oct 29 '22 19:10 KRAFMA

Simply fixed if you add int ppid = 0 in your parameter for method call :CreateTransactedHollowingProcess and CreateInitialProcess

KRAFMA avatar Oct 29 '22 20:10 KRAFMA

I cannot reproduce your issue and found no issue in the code. It seems that you tried to execute GUI required PE image. My NtCreateUserProcess implementation is minimal so does not support GUI required PE image.

daem0nc0re avatar Oct 30 '22 01:10 daem0nc0re

Is the block dll make this , cause a process try open the transacted process injected i think

KRAFMA avatar Oct 30 '22 08:10 KRAFMA

Hey how are you ? can you check transacted on win 7 , seem the block dll not work or not implemented on win 7 so the new transacted crash but not the old , maybe just check os like this return (string)Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue("ProductName"); If i put false on the block dll the NtCreateUserProcess crash on the processparameter

KRAFMA avatar Nov 22 '22 07:11 KRAFMA

Hi. Currently, my interest lies in other projects and not interested in Windows 7 things so much. So it will take some time, but will deal with it in due time.

daem0nc0re avatar Nov 25 '22 07:11 daem0nc0re

Hello how are you ? i'm back to work and i'm find this : https://github.com/Shrfnt77/DynamicSyscalls/tree/main/Examples/ProcessHollowing

Is a simply processhollow very light and work for .net payload with NtApi (ppid spoof and PROCESS_CREATION_MITIGATION_POLICY) but only for x64 Maybe this can help you for find how add or fix your poc's for support .net payload

KRAFMA avatar Feb 26 '23 08:02 KRAFMA

Thanks for sharing! I am busy these days and will check when it comes (maybe after April).

daem0nc0re avatar Feb 28 '23 06:02 daem0nc0re

I can try reduce a maximum for more simply if you need/want And put normal api vs syscall

KRAFMA avatar Feb 28 '23 09:02 KRAFMA

How i can contact you please ? I trying twitter but seem your dm not opened

KRAFMA avatar Mar 17 '23 10:03 KRAFMA