Git Product home page Git Product logo

cdpsvcdllhijacking's Introduction

CDPSvc DLL Hijacking - From LOCAL SERVICE to SYSTEM

Description

For more information please visit this blog post.

/!\ This technique works only if the target machine has less than 3.5GB of RAM! Otherwise each service runs in a separate process and the Token Kidnapping technique is therefore useless.

How to compile

  1. Open Visual Studio and create a new C++ Console Application project.
  2. Replace the content of the main source file with the content of cdpsgshims.cpp.
  3. Select Release and x86/x64 depending on the architecture of the target machine.
  4. Open Project > Properties (and make sure the selected platform - Win32/x64 - is correct)
    • General > Configuration Type -> Dynamic Library (.dll)
    • C/C++ > Code Generation > Runtime Library -> Multithread (/MT)
  5. Build solution

Usage

  1. Rename the output file as cdpsgshims.dll.
  2. Copy it into a PATH directory where you have Write access.
  3. Reboot (or stop/start CDPSvc as an administrator).
  4. Use a tool such as nc.exe to connect to the local port 1337.
C:\TOOLS\>nc64.exe 127.0.0.1 1337
[*] Searching for a SYSTEM token...
[+] SYSTEM token found.
[+] CreateProcessAsUser() OK
Microsoft Windows [version 10.0.18362.476]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Windows\system32>whoami
nt auhtority\system

/!\ At this point, I'd suggest to stop the service, delete the DLL and restart the service. Otherwise you won't be able to delete the file. Your shell won't die because it runs in a separate process.

cdpsvcdllhijacking's People

Contributors

fengjixuchui avatar itm4n 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.