Build Your Offensice Tool: Service Control

Nabeel Mahdi Sayed
1 min readApr 18, 2021

Once you have exploited a system, you will have to employ some kind of methodology to create persistence. One of the methods of persistence is creating a service to execute our binary. The best way to create a service is using Windows command-line utility named SC.EXE but this command is usually heavily monitored and will trigger alarms due to the possibility of malignant use.

To evade detection I have written my own tool to create services. I have written the code in C++ using Win32 APIs. The video below describes the source code of my tool, as well as a detection mechanism to detect usage of my tool.

I have also covered a complete step-by-step process of using my tool in a live environment to use my tool.

Mainly, my tool implements the following functionalities of SC.EXE:

failure

create

delete

query

config

qdescription

start

stop

The Github repository of my tool is given below. Happy Hacking!

--

--