BugScanTeam / DNSLog

DNSLog 是一款监控 DNS 解析记录和 HTTP 访问记录的工具。
1.42k stars 462 forks source link

修正readme社区连接,修复zoneresolver.py中一处正则匹配问题 #4

Closed howmp closed 8 years ago

howmp commented 8 years ago
    def log_request(self, handler, request):
        domain = request.q.qname.__str__()
        if domain.endswith(settings.DNS_DOMAIN + '.'):
            udomain = re.search(
                r'\.?([^\.]+)\.%s\.' % settings.DNS_DOMAIN, domain)
            if udomain:
                user = User.objects.filter(udomain__exact=udomain.group(1))
                if user:
                    dnslog = DNSLog(
                        user=user[0], host=domain, type=QTYPE[request.q.qtype])
                    dnslog.save()

正则无法匹配xxxxx.dnslog.link,因为之前的正则是\.([^\.]+)\.dnslog.link\.