Giter Club home page Giter Club logo

peb-ppidspoofing_csharp's Introduction

PEB-PPIDspoofing_Csharp

Blog link:

   

  • Create a process with a fake PPID and a fake command line.
  • It a test version, only tested in Win10_x64.
  • The purpose is to bypass Sysmon and parent process detection
  • You are gonna need to change the PPID in the Main function, OR we could add a function(like a funciton call Find_explorer) to find a process's PID as a parent process. (Most of the time, we would choose explorer.exe).
  • I am gonna update the Find_explorer function and fix some bugs soon(DONE).
  • Importance! The Fake command line must be longer than the real one, but also there are some ideas to fix that(I am gonna talk about that in my blog), for now, you just need to remember The fake command line must be longer than the real one
  • It only works with x64, cause the offset different from x86, also maybe I am gonna update that too.
  • I updated the code, now it's gonna find "explorer" pid automaticlly, but also you could change explorer to other process name.
  • I have restructed the code, make it easy for understanding.
  • Feel free to make any issues and advises

Usage

  1. Select a process pid as parent process pid.

    avatar

  2. Set the fake command line and the real command line.

    avatar

    avatar

  3. Launch the assembly through a white list application.

To-Do list

  1. Restructure PEB-PPIDspoofing_Csharp code. - DONE

Update history

  • Find process's pid automaticlly - 20210804
  • Restructure code - 20210821
  • Fixed bugs: Line 175 in ProcessCreator.cs, NtWriteVirtualMemory with wrong args. - 20220105
  • Update blog link for PEB-PPIDspoofing - 20230415

Reference link

  1. https://medium.com/@r3n_hat/parent-pid-spoofing-b0b17317168e
  2. https://www.ired.team/offensive-security/initial-access/phishing-with-ms-office/bypassing-malicious-macro-detections-by-defeating-child-parent-process-relationships
  3. https://www.pinvoke.net
  4. https://blog.nviso.eu/2020/02/04/the-return-of-the-spoof-part-2-command-line-spoofing/
  5. https://blog.xpnsec.com/how-to-argue-like-cobalt-strike/
  6. https://www.ired.team/offensive-security/defense-evasion/masquerading-processes-in-userland-through-_peb
  7. https://blog.christophetd.fr/building-an-office-macro-to-spoof-process-parent-and-command-line/
  8. https://gist.github.com/xpn/1c51c2bfe19d33c169fe0431770f3020#file-argument_spoofing-cpp
  9. https://github.com/christophetd/spoofing-office-macro
  10. https://github.com/FuzzySecurity/Sharp-Suite/tree/master/SwampThing

peb-ppidspoofing_csharp's People

Contributors

kara-4search avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.