コード例 #1
0
ファイル: zoneresolver.py プロジェクト: LucaBongiorni/MITMf
 def __init__(self,zone,glob=False):
     """
         Initialise resolver from zone file. 
         Stores RRs as a list of (label,type,rr) tuples
         If 'glob' is True use glob match against zone file 
     """
     self.zone = [(rr.rname,QTYPE[rr.rtype],rr) for rr in RR.fromZone(zone)]
     self.glob = glob
     self.eq = 'matchGlob' if glob else '__eq__'
コード例 #2
0
 def __init__(self, zone, glob=False):
     """
         Initialise resolver from zone file. 
         Stores RRs as a list of (label,type,rr) tuples
         If 'glob' is True use glob match against zone file 
     """
     self.zone = [(rr.rname, QTYPE[rr.rtype], rr)
                  for rr in RR.fromZone(zone)]
     self.glob = glob
     self.eq = 'matchGlob' if glob else '__eq__'
コード例 #3
0
ファイル: shellresolver.py プロジェクト: Liljhon241/MITMf
 def resolve(self,request,handler):
     reply = request.reply()
     qname = request.q.qname
     cmd = self.routes.get(qname)
     if cmd:
         output = getoutput(cmd).encode()
         reply.add_answer(RR(qname,QTYPE.TXT,ttl=self.ttl,
                             rdata=TXT(output[:254])))
     else:
         reply.header.rcode = RCODE.NXDOMAIN
     return reply
コード例 #4
0
ファイル: intercept.py プロジェクト: LucaBongiorni/MITMf
 def __init__(self,address,port,ttl,intercept,skip,nxdomain):
     """
         address/port    - upstream server
         ttl             - default ttl for intercept records
         intercept       - list of wildcard RRs to respond to (zone format)
         skip            - list of wildcard labels to skip 
         nxdomain        - list of wildcard labels to retudn NXDOMAIN
     """
     self.address = address
     self.port = port
     self.ttl = parse_time(ttl)
     self.skip = skip
     self.nxdomain = nxdomain
     self.zone = []
     for i in intercept:
         if i == '-':
             i = sys.stdin.read()
         for rr in RR.fromZone(i,ttl=self.ttl):
             self.zone.append((rr.rname,QTYPE[rr.rtype],rr))
コード例 #5
0
ファイル: intercept.py プロジェクト: Liljhon241/MITMf
 def __init__(self, address, port, ttl, intercept, skip, nxdomain):
     """
         address/port    - upstream server
         ttl             - default ttl for intercept records
         intercept       - list of wildcard RRs to respond to (zone format)
         skip            - list of wildcard labels to skip 
         nxdomain        - list of wildcard labels to retudn NXDOMAIN
     """
     self.address = address
     self.port = port
     self.ttl = parse_time(ttl)
     self.skip = skip
     self.nxdomain = nxdomain
     self.zone = []
     for i in intercept:
         if i == '-':
             i = sys.stdin.read()
         for rr in RR.fromZone(i, ttl=self.ttl):
             self.zone.append((rr.rname, QTYPE[rr.rtype], rr))
コード例 #6
0
 def __init__(self,zone):
     # Parse RRs
     self.rrs = RR.fromZone(zone)