Git Product home page Git Product logo

remoteshutdown's Introduction

RemoteShutdown

Remotely shut Windows down if your Welcome Screen crashes by USB tethering your iPhone with the computer and accessing the RemoteShutdown web app via IP.

IMPORTANT It seems that when Welcome Screen crashes, starting shutdown.exe will not cleanly shut Windows down. The next attempt is to first run logoff.exe to log off the sessions, then run taskkill.exe /f /im lsass.exe to force a restart. However, logoff.exe and taskkill.exe seem to not work non-interactively. The problem is to be resolved later.

Motivation

In earlier versions of Windows (e.g., 8, 8.1 and some versions of 10), when the Welcome Screen crashes (you see blank screen with pointer after flicking up the Lock Screen), you can use RD client to connect to it, which makes the Welcome Screen work again.

However, this workaround seems to stop working in recent versions of Windows 10. When I RDP into the workstation, the RD session is stuck at Welcome Screen, and any UI interaction with it will cause it to be frozen, so you cannot restart your computer (cleanly) by going into the Welcome Screen and choosing Restart from the power options. Moreover, once RD session is established, the workstation console will be stuck at the Lock Screen (you cannot flick it up). However, you can hold the Power button to launch "Slide down to shut down your PC" app. Unfortunately, sliding down won't shut down your PC. My guess is that it tries to shut Windows down without force, so the Welcome Screen is supposed to notify you that some users are still logged in and ask whether you want to forcibly shut Windows down, except it can't because it has crashed. Voila, a deadlock.

It is found that IIS still runs OK even if the Welcome Screen stops responding. I don't know whether this web app will succeed in case Welcome Screen indeed crashes --- I haven't been "lucky" enough to see this phenomenon again. I suppose it should.

Usage

By default, the project deploys to C:\inetpub\wwwroot. You should bind this website to localhost and any unassigned IP (or IP addresses in the range 172.20.10.*). Launch the website, enter the credential (the domain should be left empty if you don't know what it is), choose the action (restart or shutdown) and tap "Invoke".

WARNING If the credential is correct and the user holds sufficient privilege, the system will forcibly shut down or restart. You will have no oppotunity to cancel and return to your desktop to save your works. Be sure to use auto-save programs or save all your works before trying.

Security considerations

The security of this app is not audited. Use at your own risk. Current security measures:

  • The host name must be localhost, 127.0.0.1 or 172.20.10.* (iPhone tethering IP address range).
  • Strict parameter validation:
    • The only allowed parameters are domain, user, password and action.
    • All these parameters are required and be less than 121 UTF-16 units.
    • No parameter can appear twice.
    • user must be non-empty.
    • action must be shutdown or restart.
  • Disallows empty password logon, i.e., even if there's a user with shutdown privilege whose password is empty, you cannot use it to remotely shut Windows down.
  • Controls the frequency of password attempts.
  • Exception details are suppressed if it's not loop-back.

It is advisable but almost impossible to use an HTTPS certificate.

License

The MIT license.

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.