Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   How to find out what process issued a windows service start? (https://forum.exetools.com/showthread.php?t=19491)

DavidXanatos 04-10-2020 18:49

How to find out what process issued a windows service start?
 
Hello,

I would like to find out what process starts a particular windows service (msiserver to be exact).

I mean not in the sense whats is the parent process, this is always services.exe

but which process called some API that resulted in the SCM starting the service.

It seams in win 7 and such there was a Event Log Event created by the SCM for that: https://stackoverflow.com/questions/496632/is-it-possible-to-log-who-started-or-stopped-a-windows-service
but in windows 10 its no longer present. :confused:

Any ideas?

WhoCares 04-10-2020 19:44

hook the RPC server in services.exe?

DavidXanatos 04-10-2020 22:55

Quote:

Originally Posted by WhoCares (Post 119752)
hook the RPC server in services.exe?

Sounds tricky, could you please point me in the direction of a guide or how-to for that task.

chants 04-10-2020 23:14

Process Monitor filtered for OpenServiceA/W as referenced here: https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-openservicea which contains the service name as a string followed by watching for StartServiceA/StartServiceW as reference here: https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-startservicea which only takes a less readable service handle should work for this purpose. Hooking RPC server sounds like a far more complicated route :D. I am surprised some registry settings or such somewhere do not exist to enable this still in Win10.

Rasmus 04-11-2020 06:00

Quote:

Originally Posted by DavidXanatos (Post 119755)
Sounds tricky, could you please point me in the direction of a guide or how-to for that task.

Code:

https://docs.microsoft.com/en-us/windows/win32/rpc/how-rpc-works
A quick example though it is in java-
Code:

https://github.com/km-works/portal-rpc-server-hook
You'd need to do the same for services.exe

WhoCares 04-11-2020 12:35

here is a tutorial with demo source code, but in Chinese
https://bbs.pediy.com/thread-251158.htm

Quote:

Originally Posted by DavidXanatos (Post 119755)
Sounds tricky, could you please point me in the direction of a guide or how-to for that task.


BlackWhite 05-09-2020 14:43

If the service starts automatically on boot, you may try
"autoruns" published by www.sysinternals.com

agoo 05-10-2020 21:34

Quote:

Originally Posted by WhoCares (Post 119764)
here is a tutorial with demo source code, but in Chinese
https://bbs.pediy.com/thread-251158.htm

Any english version of the tutorial?

SinaDiR 05-11-2020 09:51

Quote:

Originally Posted by agoo (Post 120103)
Any english version of the tutorial?

Yes, try Google Chrome or use Google Translate !

LaDidi 05-21-2020 18:46

@DavidXanatos :
Deactivative "MSIserver" and, normally, the process you find will send you a message...


All times are GMT +8. The time now is 10:23.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX