The Windows service I used in my previous blog post can also be compiled on Kali (or other Linux distros or OSX) using Mono.
First I install Mono on Kali: sudo apt-get install mono-devel
Then I can use Mono’s C# compiler mcs. Unlike .NET’s C# compiler csc.exe, mcs requires a reference to compile a Windows service:
mcs -reference:System.ServiceProcess.dll service.cs


Article Link: https://blog.didierstevens.com/2017/09/06/compiling-a-windows-service-with-mono-on-kali/