當前位置: 首頁>>代碼示例>>Python>>正文


Python tsch.MSRPC_UUID_TSCHS屬性代碼示例

本文整理匯總了Python中impacket.dcerpc.v5.tsch.MSRPC_UUID_TSCHS屬性的典型用法代碼示例。如果您正苦於以下問題:Python tsch.MSRPC_UUID_TSCHS屬性的具體用法?Python tsch.MSRPC_UUID_TSCHS怎麽用?Python tsch.MSRPC_UUID_TSCHS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在impacket.dcerpc.v5.tsch的用法示例。


在下文中一共展示了tsch.MSRPC_UUID_TSCHS屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_hSchRpcEnumTasks

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcEnumTasks(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C dir > %%SYSTEMROOT%%\\Temp\\BTO\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        resp = tsch.hSchRpcEnumTasks(dce, '\\')
        resp.dump()

        resp = atsvc.hNetrJobDel(dce2, NULL, jobId, jobId)
        resp.dump() 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:23,代碼來源:test_tsch.py

示例2: test_hSchRpcRun

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcRun(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C dir > %%SYSTEMROOT%%\\Temp\\ANI 2>&1\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        try:
            resp = tsch.hSchRpcRun(dce, '\\At%d\x00' % jobId, ('arg0','arg1'))
            resp.dump()
        except Exception, e:
            print e
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:test_tsch.py

示例3: test_SchRpcGetInstanceInfo

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_SchRpcGetInstanceInfo(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C vssadmin > %%SYSTEMROOT%%\\Temp\\ANI 2>&1\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        try:
            resp = tsch.hSchRpcRun(dce, '\\At%d\x00' % jobId, ('arg0','arg1'))
            resp.dump()
        except Exception, e:
            print e
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:test_tsch.py

示例4: test_hSchRpcGetInstanceInfo

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcGetInstanceInfo(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C vssadmin > %%SYSTEMROOT%%\\Temp\\ANI 2>&1\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        try:
            resp = tsch.hSchRpcRun(dce, '\\At%d\x00' % jobId, ('arg0','arg1'))
            resp.dump()
        except Exception, e:
            print e
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:test_tsch.py

示例5: test_SchRpcStopInstance

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_SchRpcStopInstance(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C vssadmin > %%SYSTEMROOT%%\\Temp\\ANI 2>&1\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        try:
            resp = tsch.hSchRpcRun(dce, '\\At%d\x00' % jobId, ('arg0','arg1'))
            resp.dump()
        except Exception, e:
            print e
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:test_tsch.py

示例6: test_hSchRpcStopInstance

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcStopInstance(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C vssadmin > %%SYSTEMROOT%%\\Temp\\ANI 2>&1\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        try:
            resp = tsch.hSchRpcRun(dce, '\\At%d\x00' % jobId, ('arg0','arg1'))
            resp.dump()
        except Exception, e:
            print e
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:test_tsch.py

示例7: test_hSchRpcStop

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcStop(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)
        dce2, rpctransport = self.connect(self.stringBindingAtSvc, atsvc.MSRPC_UUID_ATSVC)

        atInfo = AT_INFO()
        atInfo['JobTime'] = NULL
        atInfo['DaysOfMonth'] = 0
        atInfo['DaysOfWeek'] = 0
        atInfo['Flags'] = 0
        atInfo['Command'] = '%%COMSPEC%% /C vssadmin > %%SYSTEMROOT%%\\Temp\\ANI 2>&1\x00'

        resp = atsvc.hNetrJobAdd(dce2, NULL, atInfo)
        resp.dump()
        jobId = resp['pJobId']

        try:
            resp = tsch.hSchRpcStop(dce, '\\At%d\x00' % jobId)
            resp.dump()
        except Exception, e:
            # It is actually S_FALSE
            if str(e).find('ERROR_INVALID_FUNCTION') <= 0:
                raise
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:25,代碼來源:test_tsch.py

示例8: test_SchRpcRename

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_SchRpcRename(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        resp = tsch.hSchRpcCreateFolder(dce, '\\Beto')
        resp.dump()

        request = tsch.SchRpcRename()
        request['path'] = '\\Beto\x00'
        request['newName'] = '\\Anita\x00'
        request['flags'] = 0
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception, e:
            if str(e).find('E_NOTIMPL') <= 0:
                raise
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:19,代碼來源:test_tsch.py

示例9: test_SchRpcScheduledRuntimes

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_SchRpcScheduledRuntimes(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)
        request = tsch.SchRpcScheduledRuntimes()
        #request['path'] = '\\BBB\\Beto Task\x00'
        request['path'] = '\\Microsoft\\Windows\\Defrag\\ScheduledDefrag\x00'
        request['start'] = NULL
        request['end'] = NULL
        request['flags'] = 0
        request['cRequested'] = 10
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception, e:
            # It is actually S_FALSE
            if str(e).find('ERROR_INVALID_FUNCTIO') <= 0:
                raise
            e.get_packet().dump()
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:20,代碼來源:test_tsch.py

示例10: test_hSchRpcScheduledRuntimes

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcScheduledRuntimes(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        request = tsch.SchRpcScheduledRuntimes()
        #request['path'] = '\\BBB\\Beto Task\x00'
        request['path'] = '\\Microsoft\\Windows\\Defrag\\ScheduledDefrag\x00'
        request['start'] = NULL
        request['end'] = NULL
        request['flags'] = 0
        request['cRequested'] = 10
        try:
            resp = tsch.hSchRpcScheduledRuntimes(dce, '\\Microsoft\\Windows\\Defrag\\ScheduledDefrag', NULL, NULL, 0, 10)
            resp.dump()
        except Exception, e:
            # It is actually S_FALSE
            if str(e).find('ERROR_INVALID_FUNCTIO') <= 0:
                raise
            e.get_packet().dump()
            pass 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:21,代碼來源:test_tsch.py

示例11: execute

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def execute(self, commands):
        dce = self._rpctransport.get_dce_rpc()

        dce.set_credentials(*self._rpctransport.get_credentials())
        if self._conn.kerberos:
            dce.set_auth_type(RPC_C_AUTHN_GSS_NEGOTIATE)
        dce.connect()
        dce.bind(tsch.MSRPC_UUID_TSCHS)
        xml = self.gen_xml(commands)
        tmpName = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(8))
        self._log.debug("Register random task {}".format(tmpName))
        tsch.hSchRpcRegisterTask(dce, '\\%s' % tmpName, xml, tsch.TASK_CREATE, NULL, tsch.TASK_LOGON_NONE)
        tsch.hSchRpcRun(dce, '\\%s' % tmpName)
        done = False
        while not done:
            resp = tsch.hSchRpcGetLastRunInfo(dce, '\\%s' % tmpName)
            if resp['pLastRuntime']['wYear'] != 0:
                done = True
            else:
                time.sleep(2)

        time.sleep(3)
        tsch.hSchRpcDelete(dce, '\\%s' % tmpName)
        dce.disconnect() 
開發者ID:Hackndo,項目名稱:lsassy,代碼行數:26,代碼來源:taskexe.py

示例12: test_SchRpcRename

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_SchRpcRename(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        resp = tsch.hSchRpcCreateFolder(dce, '\\Beto')
        resp.dump()

        request = tsch.SchRpcRename()
        request['path'] = '\\Beto\x00'
        request['newName'] = '\\Anita\x00'
        request['flags'] = 0
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception as e:
            if str(e).find('E_NOTIMPL') <= 0:
                raise
            pass

        resp = tsch.hSchRpcDelete(dce, '\\Beto')
        resp.dump() 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:22,代碼來源:test_tsch.py

示例13: test_hSchRpcRename

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcRename(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        resp = tsch.hSchRpcCreateFolder(dce, '\\Beto')
        resp.dump()

        try:
            resp = tsch.hSchRpcRename(dce, '\\Beto', '\\Anita')
            resp.dump()
        except Exception as e:
            if str(e).find('E_NOTIMPL') <= 0:
                raise
            pass

        resp = tsch.hSchRpcDelete(dce, '\\Beto')
        resp.dump() 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:18,代碼來源:test_tsch.py

示例14: test_SchRpcScheduledRuntimes

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_SchRpcScheduledRuntimes(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)
        request = tsch.SchRpcScheduledRuntimes()
        #request['path'] = '\\BBB\\Beto Task\x00'
        request['path'] = '\\Microsoft\\Windows\\Defrag\\ScheduledDefrag\x00'
        request['start'] = NULL
        request['end'] = NULL
        request['flags'] = 0
        request['cRequested'] = 10
        try:
            resp = dce.request(request)
            resp.dump()
        except Exception as e:
            # It is actually S_FALSE
            if str(e).find('ERROR_INVALID_FUNCTIO') <= 0 and str(e).find('SCHED_S_TASK_NOT_SCHEDULED') < 0:
                raise
            e.get_packet().dump()
            pass 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:20,代碼來源:test_tsch.py

示例15: test_hSchRpcScheduledRuntimes

# 需要導入模塊: from impacket.dcerpc.v5 import tsch [as 別名]
# 或者: from impacket.dcerpc.v5.tsch import MSRPC_UUID_TSCHS [as 別名]
def test_hSchRpcScheduledRuntimes(self):
        dce, rpctransport = self.connect(self.stringBindingAtSvc, tsch.MSRPC_UUID_TSCHS)

        request = tsch.SchRpcScheduledRuntimes()
        #request['path'] = '\\BBB\\Beto Task\x00'
        request['path'] = '\\Microsoft\\Windows\\Defrag\\ScheduledDefrag\x00'
        request['start'] = NULL
        request['end'] = NULL
        request['flags'] = 0
        request['cRequested'] = 10
        try:
            resp = tsch.hSchRpcScheduledRuntimes(dce, '\\Microsoft\\Windows\\Defrag\\ScheduledDefrag', NULL, NULL, 0, 10)
            resp.dump()
        except Exception as e:
            # It is actually S_FALSE
            if str(e).find('ERROR_INVALID_FUNCTIO') <= 0 and str(e).find('SCHED_S_TASK_NOT_SCHEDULED') < 0:
                raise
            e.get_packet().dump()
            pass 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:21,代碼來源:test_tsch.py


注:本文中的impacket.dcerpc.v5.tsch.MSRPC_UUID_TSCHS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。