windows session lock script

This commit is contained in:
n1nj4sec 2016-06-01 22:26:10 +02:00
parent 33f4debf2e
commit 684096390d
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# -*- coding: UTF8 -*-
from pupylib.PupyModule import *
__class_name__="PupyMod"
@config(compat="windows", cat="manage", tags=["lock", "screen", "session"])
class PupyMod(PupyModule):
""" Lock the session """
def init_argparse(self):
self.arg_parser = PupyArgumentParser(prog="lock_screen", description=self.__doc__)
def run(self, args):
if self.client.conn.modules['ctypes'].windll.user32.LockWorkStation():
self.success("windows locked")
else:
self.error("couldn't lock the screen")