-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding the services
command
#1557
Conversation
…ling services on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of things to change related to hardcoded strings and a test I'm not sure we need.
We don't want to shell out for this kind of things. There's already the |
That is what I meant 🙂. Good catch 😁 |
…ngService to StartServiceByName, removing unnecessary test
@rkervella Hopefully the latest commit addresses the issues you identified 🙂 |
This PR adds the
services
command that gives the operator the ability to interrogate and control (start, stop) services on Windows.There are four new commands, described below. All of the commands can be run against the local machine (the implant) or a remote machine by specifying its hostname with the
-H
flag.services
: Get information about the services on the system. On small width terminals, you get the service name, display name, and status. On wide width terminals, you get the same information plus startup type (manual, disabled, automatic), path to the service binary, and the account that the service runs under.services info <service_name>
: Gives more detailed information about a specific service, including the information from the wide terminal view plus a description of the service.services start <service_name>
: If you have the appropriate permissions, you can start a service on the machine or a remote machine.services stop <service_name>
: With the appropriate permissions, you can stop a service on the machine or a remote machine.I would like to open this command up to other platforms in the future. On Linux, that would require interacting with the
systemd
API or shelling out on SysV-style init systems (have to look into that more). On macOS, that would likely require interacting withlaunchd
.