what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

TTLeak.py

TTLeak.py
Posted Dec 8, 2004
Authored by hackademy, nono2357 | Site thehackademy.net

This tool can, under some conditions, calculate the exact time of a dns query made by someone, using TTL information cached on his ISP's nameservers.

SHA-256 | 397ca55e70fd272383102f3bb1e3eef0aecaffde8efee6c48e40cffcb5463c13

TTLeak.py

Change Mirror Download
#!/usr/bin/python
# -*- coding: ISO-8859-15 -*
# TTLeak v0.1 - GPL License - Copyright (C) 2004 by nono2357
# (published in Hackademy Manuel #12, dec-jan 2005)

import re, string, datetime, time, sys, DNS # pydns library

l_dns_fai = {
'free' : ['212.27.32.5','212.27.32.6','212.27.32.176','212.27.39.134','212.27.39.135'],
'wanadoo' : ['193.252.19.10','193.252.19.11','80.12.255.23','80.12.255.152'],
'noos' : ['212.198.2.51', '212.198.0.91'],
'aol' : ['DNS-01.NS.AOL.COM','DNS-02.NS.AOL.COM','DNS-06.NS.AOL.COM','DNS-07.NS.AOL.COM']
}

DNS.ParseResolvConf()

def Error(mesg):
print "ERROR:", mesg
sys.exit(1)

class HostSearch:
def __init__(self, host, zone):
# hostname (no IP)
self.host = host
self.ldns = l_dns_fai[zone]
print "Recherche de %s dans la zone '%s'..." % (host,zone)
def getAuthorityServers(self, domain):
r = DNS.Request(domain,qtype='SOA').req()
if r.header['status'] != 'NOERROR':
Error("Erreur de réponse DNS")
primary,email,serial,refresh,retry,expire,minimum = r.answers[0]['data']
return primary
def getTTLs(self):
lr = []
for dns in self.ldns:
print "Interrogation de %s..." % dns
r = DNS.Request(name=self.host, server=dns, qtype='A')
a = r.req()
for reponse in a.answers:
lr.append((dns,int(reponse['ttl']),int(time.time())))
return lr
def getOriginalTTL(self):
domain = string.join(self.host.split('.')[-2:],".")
aserver = self.getAuthorityServers(domain)
a = DNS.Request(name=self.host, server=aserver, qtype='A').req()
return int(a.answers[0]['ttl'])
def showResults(self):
lr, ot = self.getTTLs(), self.getOriginalTTL()
print "Requêtes dans les dernières %d secondes :" % ot
print "DNS","\t\t","Dernière requête disponible"
print '-'*43
for r in lr:
if r[1]!=ot:
print r[0],"\t",datetime.datetime.fromtimestamp(r[2]-ot+r[1])

if len(sys.argv) != 3:
Error("\nUsage: %s FAI hostname" % sys.argv[0])
else:
HostSearch(sys.argv[2],sys.argv[1]).showResults()
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close