Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Python module for Windows services that runs on Linux



So far this looks the most promising.  For those interested, here's the
test script I wrote and it let's me display the status of all services.

import sys
import os
sys.path.append(os.path.abspath("/usr/bin"))  #path where impacket example
scripts installed
import services #import the /usr/bin/services.py script

username="Administrator"
password="testpass"
address="app001"

class options():
    pass
options = options()
options.action="list"
options.hashes=None

services = services.SVCCTL(username, password, domain, options)
try:
    services.run(address)
except Exception, e:
    print e

Matt

On Mon, Dec 1, 2014 at 5:42 PM, Mike Small <smallm at panix.com> wrote:

> Matt Shields <matt at mattshields.org> writes:
>
> > Anyone know of a python module that will let me query/start/stop a
> Windows
> > service?  The module needs to be able work on a Linux system.  I've
> looked
> > around but it seems all the modules I find require the python app to run
> on
> > a Windows machine.
>
> Never had to do it, but impacket looks promising:
>
>
> https://code.google.com/p/impacket/source/browse/tags/impacket_0_9_12/examples/services.py
>
> Seems the others use the client side SCM and WIN32 API to it rather than
> using the
> wire protocol (http://msdn.microsoft.com/en-us/library/cc245832.aspx)
> manually like this guy does.
>
> --
> Mike Small
> smallm at panix.com
>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org