コード例 #1
0
    def enum_disks(self, host):
        dce, rpctransport = self.connect(host, 'srvsvc')
        try:
            resp = srvs.hNetrServerDiskEnum(dce, 1)
        except Exception:
            resp = srvs.hNetrServerDiskEnum(dce, 0)

        print_succ("{}:{} Available disks:".format(host, settings.args.port))
        for disk in resp['DiskInfoStruct']['Buffer']:
            for dname in disk.fields.keys():
                if disk[dname] != '\x00':
                    print_att(disk[dname])
コード例 #2
0
ファイル: rpcquery.py プロジェクト: maaaaz/CrackMapExec
    def enum_disks(self, host):
        dce, rpctransport = self.connect(host, 'srvsvc')
        try:
            resp = srvs.hNetrServerDiskEnum(dce, 1)
        except Exception:
            resp = srvs.hNetrServerDiskEnum(dce, 0)

        self.__logger.success("Enumerating disks")
        for disk in resp['DiskInfoStruct']['Buffer']:
            for dname in disk.fields.keys():
                if disk[dname] != '\x00':
                    self.__logger.results(disk[dname])
コード例 #3
0
ファイル: rpcquery.py プロジェクト: 0x554simon/CrackMapExec
    def enum_disks(self, host):
        dce, rpctransport = self.connect(host, 'srvsvc')
        try:
            resp = srvs.hNetrServerDiskEnum(dce, 1)
        except Exception:
            resp = srvs.hNetrServerDiskEnum(dce, 0)

        self.__logger.success("Enumerating disks")
        for disk in resp['DiskInfoStruct']['Buffer']:
            for dname in disk.fields.keys():
                if disk[dname] != '\x00':
                    self.__logger.results(disk[dname])
コード例 #4
0
ファイル: rpcquery.py プロジェクト: OJ/CrackMapExec
    def enum_disks(self, host):
        dce, rpctransport = self.connect(host, 'srvsvc')
        try:
            resp = srvs.hNetrServerDiskEnum(dce, 1)
        except Exception:
            resp = srvs.hNetrServerDiskEnum(dce, 0)

        print_succ("{}:{} Available disks:".format(host, settings.args.port))
        for disk in resp['DiskInfoStruct']['Buffer']:
            for dname in disk.fields.keys():
                if disk[dname] != '\x00':
                    print_att(disk[dname])
コード例 #5
0
ファイル: rpcquery.py プロジェクト: CarlosS7/CrackMapExec
    def enum_disks(self):
        dce, rpctransport = self.connect('srvsvc')

        try:
            resp = srvs.hNetrServerDiskEnum(dce, 1)
        except Exception:
            pass

        try:
            resp = srvs.hNetrServerDiskEnum(dce, 0)
        except Exception:
            return

        self.logger.success("Enumerating disks")
        for disk in resp['DiskInfoStruct']['Buffer']:
            for dname in disk.fields.keys():
                if disk[dname] != '\x00':
                    self.logger.highlight(disk[dname])
コード例 #6
0
    def enum_disks(self):
        dce, rpctransport = self.connect('srvsvc')

        try:
            resp = srvs.hNetrServerDiskEnum(dce, 1)
        except Exception:
            pass

        try:
            resp = srvs.hNetrServerDiskEnum(dce, 0)
        except Exception:
            return

        self.logger.success("Enumerating disks")
        for disk in resp['DiskInfoStruct']['Buffer']:
            for dname in disk.fields.keys():
                if disk[dname] != '\x00':
                    self.logger.highlight(disk[dname])
コード例 #7
0
    def get_localdisks(self):

        resp = srvs.hNetrServerDiskEnum(self._rpc_connection, 0)

        results = list()
        for disk in resp['DiskInfoStruct']['Buffer']:
            if disk['Disk'] != '\x00':
                results.append(rpcobj.Disk(disk))

        return results
コード例 #8
0
ファイル: net.py プロジェクト: the-useless-one/pywerview
    def get_localdisks(self):

        resp = srvs.hNetrServerDiskEnum(self._rpc_connection, 0)

        results = list()
        for disk in resp['DiskInfoStruct']['Buffer']:
            if disk['Disk'] != '\x00':
                results.append(rpcobj.Disk(disk))

        return results
コード例 #9
0
ファイル: test_srvs.py プロジェクト: DarkGreising/impacket
 def test_hNetrServerDiskEnum(self):
     dce, rpctransport = self.connect()
     resp = srvs.hNetrServerDiskEnum(dce, 0)
     resp.dump()
コード例 #10
0
ファイル: test_srvs.py プロジェクト: bincker/impacket
 def test_hNetrServerDiskEnum(self):
     dce, rpctransport = self.connect()
     resp = srvs.hNetrServerDiskEnum(dce, 0)
     resp.dump()