Giter Club home page Giter Club logo

serviceflipper's Introduction

Powershell serviceflipper script for Spool service

Powershell script to flip the windows spool service on/off to mitigate CVE-2021-34527

Disclaimer

I quickly wrote this to mitigate the PrintNightmare thing, so that a user with admin rights can turn on the service on demand quickly. It is no solution to the problem and to activate it one needs to lower the powershell security, so it is only recommended for users who know what they're doing.

  • Use at your own risk.
  • Remember to reset powershell security after M$ releases a good patch

Prerequisites

  1. In the search bar write "PowerShell"
  2. Right click on the powershell icon and select "Run as Administrator"
  3. Change your powershell executions security to RemoteSigned
   Set-ExecutionPolicy RemoteSigned

Answer Y at the prompt. You can restore this later using either AllSigned or Restricted.

Usage

Every time you run the script it will either kill the spooler if it's on, or start it if it is off.

  1. Copy the script on your desktop
  2. right click and select "Run with PowerShell"
  3. Accept the administrative rights elevation (services can only be managed by admins)
  4. Read the status of the service, push any key to exit the script
  5. Run again to trigger the service on or off

Known issues

Q: I copied the script and tried to run but Windows complains that the script is not signed.

A: Right click on the script, choose "edit", then when PowerShell ISE opens, click on the disk icon to save. At this point Windows should have signed it or added to the trusted ones for your own machine.

Acknowledgements

This is my first powershell script. I took inspiration from:

serviceflipper's People

Contributors

floridop avatar

Watchers

James Cloos avatar  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.