GithubHelp home page GithubHelp logo

process_injection's Introduction

Process injection

挑了适合攻击背景的进程注入方式

https://i.blackhat.com/USA-19/Thursday/us-19-Kotler-Process-Injection-Techniques-Gotta-Catch-Them-All-wp.pdf

Execute shellcode loader

  1. TLS Code Execute
  2. SEH Code Execute

Search Target Process

  1. SnapShot
  2. QuerySystemInformation

Open Remote Process

  1. OpenProcess
    • NtOpenProcess
  2. DLL注入
    • 注册表
    • 挂钩

Transfer Shellcode across Processes (Write-What-Where)

https://modexp.wordpress.com/2018/07/15/process-injection-sharing-payload/

  1. Classical
    • VirtualAllocEx + WriteProcessMemory
    • NtAllocateVirtualMemory + NtWriteProcessMemory
  2. Dll Hollowing
    • Dll + WriteProcessMemory
  3. Mapping (CreateSection)
    • CreateFileMapping → MapViewOfFile → MapViewOfFile2 + memcpy
    • NtCreateSection → NtMapViewOfSection +memcpy
    • CreateFileMapping → MapViewOfFile → NtMapViewOfSection +memcpy
  4. ROP链 (AtomBombing/ PowerLoaderEx/ Ghost-Writing)
  5. AtomBombing (中间涉及到APC, 多一步注入)
    • GlobalAddAtom + NtQueueApcThread + GlobalGetAtomName
  6. memset/memmove (Thread must be in alertable state)

Trigger Shellcode

https://modexp.wordpress.com/2018/07/12/process-injection-writing-payload/

  1. Thread procedure (CreateRemoteThread)

    • CreateRemoteThread
    • RtlCreateUserThread
    • NtCreateThreadEx
    • ZwCreateThreadEx
  2. Asynchronous Procedure Call (APC/ Early Bird)

    • QueueUserAPC
    • NtQueueApcThread (能调用三个参数)
    • NtQueueApcThreadEx
    • ZwQueueApcThread
    • ZwQueueApcThreadEx
    • RtlQueueApcWow64Thread
  3. Thread Hijack (Ghost Writing)

  4. Kernel Callback Table (切换虚表)

    • SendMessage
  5. ALPC callback (重写虚表)

    • VirtualQueryEx
    • NtDuplicateObject
    • NtConnectPort
    • ReadProcessMemory
  6. DLL

    • Via CreateRemoteThread
    • Windows hook
    • App_init

process_injection's People

Contributors

dgronpa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.