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


Python Type.AXFR屬性代碼示例

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


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

示例1: processReply

# 需要導入模塊: import Type [as 別名]
# 或者: from Type import AXFR [as 別名]
def processReply(self):
        self.args['elapsed']=(self.time_finish-self.time_start)*1000
        u = Lib.Munpacker(self.reply)
        r=Lib.DnsResult(u,self.args)
        r.args=self.args
        #self.args=None  # mark this DnsRequest object as used.
        return r
        #### TODO TODO TODO ####
#        if protocol == 'tcp' and qtype == Type.AXFR:
#            while 1:
#                header = f.read(2)
#                if len(header) < 2:
#                    print '========== EOF =========='
#                    break
#                count = Lib.unpack16bit(header)
#                if not count:
#                    print '========== ZERO COUNT =========='
#                    break
#                print '========== NEXT =========='
#                reply = f.read(count)
#                if len(reply) != count:
#                    print '*** Incomplete reply ***'
#                    break
#                u = Lib.Munpacker(reply)
#                Lib.dumpM(u) 
開發者ID:Flolagale,項目名稱:mailin,代碼行數:27,代碼來源:Base.py

示例2: processReply

# 需要導入模塊: import Type [as 別名]
# 或者: from Type import AXFR [as 別名]
def processReply(self):
        import Lib
        self.args['elapsed'] = (self.time_finish - self.time_start) * 1000
        u = Lib.Munpacker(self.reply)
        r = Lib.DnsResult(u, self.args)
        r.args = self.args
        # self.args=None  # mark this DnsRequest object as used.
        return r
        #### TODO TODO TODO ####
#        if protocol == 'tcp' and qtype == Type.AXFR:
#            while 1:
#                header = f.read(2)
#                if len(header) < 2:
#                    print '========== EOF =========='
#                    break
#                count = Lib.unpack16bit(header)
#                if not count:
#                    print '========== ZERO COUNT =========='
#                    break
#                print '========== NEXT =========='
#                reply = f.read(count)
#                if len(reply) != count:
#                    print '*** Incomplete reply ***'
#                    break
#                u = Lib.Munpacker(reply)
#                Lib.dumpM(u) 
開發者ID:Yukinoshita47,項目名稱:Yuki-Chan-The-Auto-Pentest,代碼行數:28,代碼來源:Base.py

示例3: req

# 需要導入模塊: import Type [as 別名]
# 或者: from Type import AXFR [as 別名]
def req(self,*name,**args):
        " needs a refactoring "
        self.argparse(name,args)
        #if not self.args:
        #    raise ArgumentError, 'reinitialize request before reuse'
        protocol = self.args['protocol']
        self.port = self.args['port']
        self.tid = random.randint(0,65535)
        self.timeout = self.args['timeout'];
        opcode = self.args['opcode']
        rd = self.args['rd']
        server=self.args['server']
        if type(self.args['qtype']) == types.StringType:
            try:
                qtype = getattr(Type, string.upper(self.args['qtype']))
            except AttributeError:
                raise ArgumentError, 'unknown query type'
        else:
            qtype=self.args['qtype']
        if not self.args.has_key('name'):
            print self.args
            raise ArgumentError, 'nothing to lookup'
        qname = self.args['name']
        if qtype == Type.AXFR and protocol != 'tcp':
            print 'Query type AXFR, protocol forced to TCP'
            protocol = 'tcp'
        #print 'QTYPE %d(%s)' % (qtype, Type.typestr(qtype))
        m = Lib.Mpacker()
        # jesus. keywords and default args would be good. TODO.
        m.addHeader(self.tid,
              0, opcode, 0, 0, rd, 0, 0, 0,
              1, 0, 0, 0)
        m.addQuestion(qname, qtype, Class.IN)
        self.request = m.getbuf()
        try:
            if protocol == 'udp':
                self.sendUDPRequest(server)
            else:
                self.sendTCPRequest(server)
        except socket.error, reason:
            raise SocketError, reason 
開發者ID:Flolagale,項目名稱:mailin,代碼行數:43,代碼來源:Base.py

示例4: processReply

# 需要導入模塊: import Type [as 別名]
# 或者: from Type import AXFR [as 別名]
def processReply(self):
        import Lib
        self.args['elapsed'] = (self.time_finish - self.time_start) * 1000
        u = Lib.Munpacker(self.reply)
        r = Lib.DnsResult(u, self.args)
        r.args = self.args
        #self.args=None  # mark this DnsRequest object as used.
        return r
        #### TODO TODO TODO ####
#        if protocol == 'tcp' and qtype == Type.AXFR:
#            while 1:
#                header = f.read(2)
#                if len(header) < 2:
#                    print '========== EOF =========='
#                    break
#                count = Lib.unpack16bit(header)
#                if not count:
#                    print '========== ZERO COUNT =========='
#                    break
#                print '========== NEXT =========='
#                reply = f.read(count)
#                if len(reply) != count:
#                    print '*** Incomplete reply ***'
#                    break
#                u = Lib.Munpacker(reply)
#                Lib.dumpM(u) 
開發者ID:blackye,項目名稱:luscan-devel,代碼行數:28,代碼來源:Base.py

示例5: req

# 需要導入模塊: import Type [as 別名]
# 或者: from Type import AXFR [as 別名]
def req(self, *name, **args):
        " needs a refactoring "
        import time, Lib
        self.argparse(name, args)
        #if not self.args:
        #    raise DNSError,'reinitialize request before reuse'
        protocol = self.args['protocol']
        self.port = self.args['port']
        opcode = self.args['opcode']
        rd = self.args['rd']
        server = self.args['server']
        if type(self.args['qtype']) == types.StringType:
            try:
                qtype = getattr(Type, string.upper(self.args['qtype']))
            except AttributeError:
                raise DNSError, 'unknown query type'
        else:
            qtype = self.args['qtype']
        if not self.args.has_key('name'):
            print self.args
            raise DNSError, 'nothing to lookup'
        qname = self.args['name']
        if qtype == Type.AXFR:
            print 'Query type AXFR, protocol forced to TCP'
            protocol = 'tcp'
        #print 'QTYPE %d(%s)' % (qtype, Type.typestr(qtype))
        m = Lib.Mpacker()
        # jesus. keywords and default args would be good. TODO.
        m.addHeader(0,
              0, opcode, 0, 0, rd, 0, 0, 0,
              1, 0, 0, 0)
        m.addQuestion(qname, qtype, Class.IN)
        self.request = m.getbuf()
        try:
            if protocol == 'udp':
                self.sendUDPRequest(server)
            else:
                self.sendTCPRequest(server)
        except socket.error, reason:
            raise DNSError, reason 
開發者ID:blackye,項目名稱:luscan-devel,代碼行數:42,代碼來源:Base.py

示例6: req

# 需要導入模塊: import Type [as 別名]
# 或者: from Type import AXFR [as 別名]
def req(self, *name, **args):
        " needs a refactoring "
        import time
        import Lib
        self.argparse(name, args)
        # if not self.args:
        #    raise DNSError,'reinitialize request before reuse'
        protocol = self.args['protocol']
        self.port = self.args['port']
        opcode = self.args['opcode']
        rd = self.args['rd']
        server = self.args['server']
        if isinstance(self.args['qtype'], types.StringType):
            try:
                qtype = getattr(Type, string.upper(self.args['qtype']))
            except AttributeError:
                raise DNSError('unknown query type')
        else:
            qtype = self.args['qtype']
        if 'name' not in self.args:
            print self.args
            raise DNSError('nothing to lookup')
        qname = self.args['name']
        if qtype == Type.AXFR:
            print 'Query type AXFR, protocol forced to TCP'
            protocol = 'tcp'
        # print 'QTYPE %d(%s)' % (qtype, Type.typestr(qtype))
        m = Lib.Mpacker()
        # jesus. keywords and default args would be good. TODO.
        m.addHeader(0,
                    0, opcode, 0, 0, rd, 0, 0, 0,
                    1, 0, 0, 0)
        m.addQuestion(qname, qtype, Class.IN)
        self.request = m.getbuf()
        try:
            if protocol == 'udp':
                self.sendUDPRequest(server)
            else:
                self.sendTCPRequest(server)
        except socket.error as reason:
            raise DNSError(reason)
        if self.async:
            return None
        else:
            return self.response 
開發者ID:Yukinoshita47,項目名稱:Yuki-Chan-The-Auto-Pentest,代碼行數:47,代碼來源:Base.py


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