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


Python rrp.hBaseRegSetValue方法代碼示例

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


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

示例1: wdigest_enable

# 需要導入模塊: from impacket.dcerpc.v5 import rrp [as 別名]
# 或者: from impacket.dcerpc.v5.rrp import hBaseRegSetValue [as 別名]
def wdigest_enable(self, context, smbconnection):
        remoteOps = RemoteOperations(smbconnection, False)
        remoteOps.enableRegistry()

        if remoteOps._RemoteOperations__rrp:
            ans = rrp.hOpenLocalMachine(remoteOps._RemoteOperations__rrp)
            regHandle = ans['phKey']

            ans = rrp.hBaseRegOpenKey(remoteOps._RemoteOperations__rrp, regHandle, 'SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\WDigest')
            keyHandle = ans['phkResult']

            rrp.hBaseRegSetValue(remoteOps._RemoteOperations__rrp, keyHandle, 'UseLogonCredential\x00',  rrp.REG_DWORD, 1)

            rtype, data = rrp.hBaseRegQueryValue(remoteOps._RemoteOperations__rrp, keyHandle, 'UseLogonCredential\x00')

            if int(data) == 1:
                context.log.success('UseLogonCredential registry key created successfully')

        try:
            remoteOps.finish()
        except:
            pass 
開發者ID:byt3bl33d3r,項目名稱:CrackMapExec,代碼行數:24,代碼來源:wdigest.py

示例2: rdp_enable

# 需要導入模塊: from impacket.dcerpc.v5 import rrp [as 別名]
# 或者: from impacket.dcerpc.v5.rrp import hBaseRegSetValue [as 別名]
def rdp_enable(self, context, smbconnection):
        remoteOps = RemoteOperations(smbconnection, False)
        remoteOps.enableRegistry()

        if remoteOps._RemoteOperations__rrp:
            ans = rrp.hOpenLocalMachine(remoteOps._RemoteOperations__rrp)
            regHandle = ans['phKey']

            ans = rrp.hBaseRegOpenKey(remoteOps._RemoteOperations__rrp, regHandle, 'SYSTEM\\CurrentControlSet\\Control\\Terminal Server')
            keyHandle = ans['phkResult']

            rrp.hBaseRegSetValue(remoteOps._RemoteOperations__rrp, keyHandle, 'fDenyTSConnections\x00',  rrp.REG_DWORD, 0)

            rtype, data = rrp.hBaseRegQueryValue(remoteOps._RemoteOperations__rrp, keyHandle, 'fDenyTSConnections\x00')

            if int(data) == 0:
                context.log.success('RDP enabled successfully')

        try:
            remoteOps.finish()
        except:
            pass 
開發者ID:byt3bl33d3r,項目名稱:CrackMapExec,代碼行數:24,代碼來源:rdp.py

示例3: rdp_disable

# 需要導入模塊: from impacket.dcerpc.v5 import rrp [as 別名]
# 或者: from impacket.dcerpc.v5.rrp import hBaseRegSetValue [as 別名]
def rdp_disable(self, context, smbconnection):
        remoteOps = RemoteOperations(smbconnection, False)
        remoteOps.enableRegistry()

        if remoteOps._RemoteOperations__rrp:
            ans = rrp.hOpenLocalMachine(remoteOps._RemoteOperations__rrp)
            regHandle = ans['phKey']

            ans = rrp.hBaseRegOpenKey(remoteOps._RemoteOperations__rrp, regHandle, 'SYSTEM\\CurrentControlSet\\Control\\Terminal Server')
            keyHandle = ans['phkResult']

            rrp.hBaseRegSetValue(remoteOps._RemoteOperations__rrp, keyHandle, 'fDenyTSConnections\x00',  rrp.REG_DWORD, 1)

            rtype, data = rrp.hBaseRegQueryValue(remoteOps._RemoteOperations__rrp, keyHandle, 'fDenyTSConnections\x00')

            if int(data) == 1:
                context.log.success('RDP disabled successfully')

        try:
            remoteOps.finish()
        except:
            pass 
開發者ID:byt3bl33d3r,項目名稱:CrackMapExec,代碼行數:24,代碼來源:rdp.py

示例4: test_hBaseRegCreateKey_hBaseRegSetValue_hBaseRegDeleteKey

# 需要導入模塊: from impacket.dcerpc.v5 import rrp [as 別名]
# 或者: from impacket.dcerpc.v5.rrp import hBaseRegSetValue [as 別名]
def test_hBaseRegCreateKey_hBaseRegSetValue_hBaseRegDeleteKey(self):
        dce, rpctransport, phKey = self.connect()
        resp = rrp.hOpenClassesRoot(dce)
        resp.dump()
        regHandle = resp['phKey']

        resp = rrp.hBaseRegCreateKey(dce, regHandle, 'BETO\x00')
        resp.dump()
        phKey = resp['phkResult']

        try: 
            resp = rrp.hBaseRegSetValue(dce, phKey, 'BETO2\x00',  rrp.REG_SZ, 'HOLA COMO TE VA\x00')
            resp.dump()
        except Exception as e:
            print(e)

        type, data = rrp.hBaseRegQueryValue(dce, phKey, 'BETO2\x00')
        #print data

        resp = rrp.hBaseRegDeleteValue(dce, phKey, 'BETO2\x00')
        resp.dump()

        resp = rrp.hBaseRegDeleteKey(dce, regHandle, 'BETO\x00')
        resp.dump()
        self.assertTrue( 'HOLA COMO TE VA\x00' == data ) 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:27,代碼來源:test_rrp.py

示例5: test_hBaseRegCreateKey_hBaseRegSetValue_hBaseRegDeleteKey

# 需要導入模塊: from impacket.dcerpc.v5 import rrp [as 別名]
# 或者: from impacket.dcerpc.v5.rrp import hBaseRegSetValue [as 別名]
def test_hBaseRegCreateKey_hBaseRegSetValue_hBaseRegDeleteKey(self):
        dce, rpctransport, phKey = self.connect()
        resp = rrp.hOpenClassesRoot(dce)
        resp.dump()
        regHandle = resp['phKey']

        resp = rrp.hBaseRegCreateKey(dce, regHandle, 'BETO\x00')
        resp.dump()
        phKey = resp['phkResult']

        try: 
            resp = rrp.hBaseRegSetValue(dce, phKey, 'BETO2\x00',  rrp.REG_SZ, 'HOLA COMO TE VA\x00')
            resp.dump()
        except Exception, e:
            print e 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:17,代碼來源:test_rrp.py


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