DLL Injection with CreateRemoteThread

Поділитися
Вставка
  • Опубліковано 26 вер 2024
  • Using the CreateRemoteThread API to inject a DLL to a target process

КОМЕНТАРІ • 31

  • @nikos4677
    @nikos4677 6 місяців тому +2

    Dude you explained some things I didnt know and ot really helped thanks. Most youtubers ignore some important details and itsannoying

  • @logicchild
    @logicchild Рік тому +3

    Great as usual :), I created similar injector but in C#, the important thing here is that you need to create two versions of injector; a x64 one to inject x64 processes, and a x86 one to inject x86 processes.

  • @crr0ww
    @crr0ww Рік тому +5

    I learned a lot from this! Thank you, you're a legend :)

    • @gitgudsec
      @gitgudsec 5 місяців тому

      aint he just?

  • @apaatutu9709
    @apaatutu9709 Рік тому +1

    Thanks a lot, Great help to me.

  • @kaolungservice
    @kaolungservice Рік тому +1

    thanks for sharing ,good man .

  • @nazmdar
    @nazmdar Місяць тому

    Thanks for your nice explanation.
    Does this technic work even if "Address space layout randomization" is enabled? Does the address of "LoadLibraryA" the same in virtual address space of all processes?

  • @itf_ph3r0x41
    @itf_ph3r0x41 Рік тому +1

    Hey Pavel, great video to show some basics, thats often underrated.
    If you wouldn't mind, could you help me out with a little problem that I am facing right now?
    I want to get a better understanding of the entire usermode concept in windows, I also bought the wininternals books and partially read them.
    So my problem is, that I want to perform accurate handle enumeration.
    There is a usermode process that is creating a lot of short lived handles to scan memory regions of my process, but I cant find these handles by using NtQuerySystemInformation using the SystemHandleInformation class.
    On the other hand, I know that the other process is also doing a usermode handle enumeration to detect any opened handles to the process.
    So my question is, are there other ways to enumerate handles of a process in usermode? NtQuerySystemInformation gives us a list of all system handles, and each scan takes multiple seconds to traverse through, which could be a reason why short lived handles are not found...
    I really don't want to inject into the other process though and hook stuff, the goal was to perform a good handle enumeration externally.
    I hope you can give me a hint maybe :)
    But for now - Спасибо за всё,
    Я огромный Фан!

    • @zodiacon
      @zodiacon  Рік тому +2

      NtQuerySystemInformation is the way to go. There is no better way from user mode. Short-lived handles are just that - enumeration has nothing to do with that. It captures what exists at enumeration time. With a kernel driver, you could intercept opening handles to processes, for example.

    • @itf_ph3r0x41
      @itf_ph3r0x41 Рік тому +1

      @@zodiacon Alright, so I guess that detecting short lived handles from usermode is a thing of time luck then. Would multithreaded scanning increase the probability of detecting these handles?

    • @zodiacon
      @zodiacon  Рік тому +2

      Not really, there is internal locking happening anyway.

  • @logicchild
    @logicchild Рік тому +2

    Could you please create a tutorial for a mini driver to inject this dll into any user-mode process when it starts 🙏

    • @zodiacon
      @zodiacon  Рік тому +2

      There are such examples on Github... for now, I'll stick with simpler things :)

    • @marq4375
      @marq4375 Рік тому +1

      Hey Pavel big fan! I have some of your books and also your pentester academy windows series. Glad to see you on UA-cam. If you make a Patreon I'd be interested in donating! Thanks again, you're a master at this !

    • @zodiacon
      @zodiacon  Рік тому +1

      Happy to receive support! patreon.com/zodiacon

    • @tomifilep1
      @tomifilep1 16 днів тому

      i bet u want a make a cs go cheatoos xd

  • @tomifilep1
    @tomifilep1 16 днів тому

    and what happened if nothing happened i mean the code compiled without error when I'm try to inject nothing do no error print nothing all anti virus is off!! any idea ? ?? ?

    • @zodiacon
      @zodiacon  16 днів тому +1

      Make sure you inject a 64 bit DLL into a 64-bit process or 32-bit DLL into a 32-bit process.
      Other than that, you can use Process Monitor to see if the DLL is loaded, if the thread is created, etc.

    • @tomifilep1
      @tomifilep1 15 днів тому +1

      @@zodiacon yhea thanks i solve it . i try with other injector and the injector tell you are dumb u want to inject 32 bit into a 64 bit :D

  • @batphamduong9700
    @batphamduong9700 5 місяців тому

    Hi Pavel, Thanks for tutorials...But all your tutorial is injected to already running process.. How about Create new process and inject in to it?
    My current problem is create new progress (Ex Notepad) and inject to it..but sometime it work...sometime it dont...I dont know why...just assume dll injected when nodepad process not full loaded

    • @zodiacon
      @zodiacon  5 місяців тому

      Usually injecting into a new process is much easier, because you have an all powerful handle to it (no need to call OpenProcess which may fail). If you create the process suspended and try to inject to it, it is likely to fail, because the process only has NtDll loaded into it.

    • @batphamduong9700
      @batphamduong9700 5 місяців тому

      @@zodiacon so what is solution ?

    • @zodiacon
      @zodiacon  5 місяців тому

      There is no "one, single" solution... do some research, try things out...

  • @fee171
    @fee171 Рік тому +1

    Hey bro if I subscribe to patreon, can you compile an injector for me?

    • @zodiacon
      @zodiacon  Рік тому

      No... that's not the purpose of this channel.
      I'm sure you can find plenty elsewhere.

    • @zodiacon
      @zodiacon  Рік тому

      The source code is provided at github.com/zodiacon/youtubecode

  • @CoolGamer6525
    @CoolGamer6525 2 місяці тому

    hi, is it possible to convert a dll to .exe trainer?

    • @zodiacon
      @zodiacon  2 місяці тому

      Depends on what you mean by "convert". You can remove the DLL bit from the PE header, but the entry point will DllMain, and it's not what is expected from an EXE, so likely to crash.