How to use tld - 10 common examples

To help you get started, we’ve selected a few tld examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecstatic-nobel / Analyst-Arsenal / commons.py View on Github external
def score_domain(config, domain, args):
    """ """
    score = 0

    for t in config["tlds"]:
        if domain.endswith(t):
            score += 20

    try:
        res = get_tld(domain, as_object=True, fail_silently=True, fix_protocol=True)

        if res is not None:
            domain = '.'.join([res.subdomain, res.domain])
    except Exception as err:
        message_failed(args, err, domain)
        pass

    score += int(round(entropy.shannon_entropy(domain)*50))

    domain          = unconfuse(domain)
    words_in_domain = re.split(r"\W+", domain)

    if words_in_domain[0] in ["com", "net", "org"]:
        score += 10

    for word in config["keywords"]:
github stratosphereips / whois-similarity-distance / whois_similarity_distance / util / whois_obj.py View on Github external
def __get_top_level_domain__(self):
        try:
            if is_ip(self.domain) or not self.domain or self.domain == '':
                return None
            d = get_tld('http://www.'+self.domain)
            if d.find('www.') >= 0:
                return d.split('www.')[1]
            else:
                return d
        except:
            return None
github VainlyStrain / Vaile / modules / OSINTFootprinting / PassiveRecon / checkuser.py View on Github external
def checkuser(web):

    print(GR+' [*] Loading module...')
    time.sleep(0.6)
    #print(R+'\n    =======================')
    #print(R+'     C H E C K   A L I A S')
    #print(R+'    =======================\n')
    from core.methods.print import posintpas
    posintpas("check alias") 

    print(GR+' [*] Parsing Url...')
    web0 = tld.get_fld(web).split('.', 1)[0]
    print(G+' [+] Alias Set : '+web0+C+color.TR2+C)
    print(O+' [*] Setting services...'+C)
    time.sleep(0.7)
    global services
    services = ['YouTube', 'Hypemachine', 'Yahoo', 'Linkagogo', 'Coolspotters', 'Wikipedia', 'Twitter', 'gdgt', 'BlogMarks', 'LinkedIn', 'Ebay', 'Tumblr', 'Pinterest','yotify', 'Blogger', 'Flickr', 'FortyThreeMarks,Moof', 'HuffingtonPost', 'Wordpress', 'DailyMotion', 'LiveJournal', 'vimeo', 'DeviantArt', 'reddit','StumbleUpon', 'Answers', 'Sourceforge', 'Wikia', 'ArmChairGM', 'Photobucket', 'MySpace', 'Etsy,SlideShare', 'Fiverr', 'scribd', 'Squidoo', 'ImageShack','ThemeForest', 'SoundCloud', 'Tagged', 'Hulu', 'Typepad', 'Hubpages', 'weebly', 'Zimbio', 'github', 'TMZ', 'WikiHow', 'Delicious', 'zillow', 'Jimdo', 'goodreads','Segnalo', 'Netlog', 'Issuu', 'ForumNokia', 'UStream', 'Gamespot', 'MetaCafe', 'askfm', 'hi5', 'JustinTV', 'Blekko', 'Skyrock', 'Cracked', 'foursquare', 'LastFM','posterous', 'steam', 'Opera', 'Dreamstime', 'Fixya', 'UltimateGuitar', 'docstoc', 'FanPop', 'Break', 'tinyurl', 'Kongregate', 'Disqus', 'Armorgames', 'Behance','ChaCha', 'CafeMom', 'Liveleak', 'Topix', 'lonelyplanet', 'Stardoll', 'Instructables', 'Polyvore', 'Proboards', 'Weheartit', 'Diigo', 'Gawker', 'FriendFeed','Videobash', 'Technorati', 'Gravatar', 'Dribbble', 'formspringme', 'myfitnesspal', '500px', 'Newgrounds', 'GrindTV', 'smugmug', 'ibibo', 'ReverbNation', 'Netvibes','Slashdot', 'Fool', 'Plurk', 'zedge', 'Discogs', 'YardBarker', 'Ebaumsworld', 'sparkpeople', 'Sharethis', 'Xmarks', 'Crunchbase', 'FunnyOrDie,Suite101', 'OVGuide','Veoh', 'Yuku', 'Experienceproject', 'Fotolog', 'Hotklix', 'Epinions', 'Hyves', 'Sodahead', 'Stylebistro', 'fark', 'AboutMe', 'Metacritic', 'Toluna', 'Mobypicture','Gather', 'Datpiff', 'mouthshut', 'blogtalkradio', 'Dzone', 'APSense', 'Bigstockphoto', 'n4g', 'Newsvine', 'ColourLovers', 'Icanhazcheezburger', 'Xanga','InsaneJournal', 'redbubble', 'Kaboodle', 'Folkd', 'Bebo', 'Getsatisfaction', 'WebShots', 'threadless', 'Active', 'GetGlue', 'Shockwave', 'Pbase']
    print(C+' [!] Loaded '+str(len(services))+' services...')
    check0x00(web0,web)
github yassineaboukir / sublert / sublert.py View on Github external
def domain_sanity_check(domain): #Verify the domain name sanity
    if domain:
        try:
            domain = get_fld(domain, fix_protocol = True)
            return domain
        except:
            print(colored("[!] Incorrect domain format. Please follow this format: example.com, http(s)://example.com, www.example.com", "red"))
            sys.exit(1)
    else:
        pass
github medialab / ural / ural / lru / stems.py View on Github external
if ':' in auth:
            user, password = auth.split(':', 1)
        else:
            user = auth

    # Parsing domain & port
    netloc = netloc.split(':', 1)

    if len(netloc) == 2:
        port = netloc[1]
        lru.append('t:' + port)

    # Need to process TLD?
    if tld_aware:
        domain_parts, non_zero_i, _ = process_url(
            url=parsed_url,
            fail_silently=True,
            fix_protocol=False,
            search_public=True,
            search_private=True
        )
        tld = '.'.join(domain_parts[non_zero_i:])
        lru.append('h:' + tld)
        for element in reversed(domain_parts[0:non_zero_i]):
            lru.append('h:' + element)

    else:
        for element in reversed(netloc[0].split('.')):
            lru.append('h:' + element)

    # Path
github cornerpirate / iRecon / iRecon.py View on Github external
def run(self):
	
		# sync top level domains with mozilla if the user is root
		if os.geteuid() == 0:
			update_tld_names()
		else:
			print "Not running as root, you are going to need those privs to nmap properly"
			sys.exit(-1)
		
		# try to resolve ip
		if self._isHostname:
			try:
				self._ip = socket.gethostbyname(self._target)
			except:
				print "== Error on resolving IP check that hostname resolves: "
				print sys.exc_info()
				sys.exit(-1)
		else:
			self._ip = self._target
		
		# Iterate through plugins which require a hostname to be passed	
github w-digital-scanner / w13scan / W13SCAN / scanners / PerServer / backup_domain.py View on Github external
def audit(self):
        headers = self.requests.headers
        url = self.requests.url
        p = urlparse(url)
        domain = "{}://{}/".format(p.scheme, p.netloc)

        try:
            payloads = parse_tld(domain, fix_protocol=True, fail_silently=True)
        except AttributeError:
            payloads = None
        if not payloads:
            return

        for payload in payloads:

            for i in ['.rar', '.zip']:
                test_url = domain + payload + i
                r = requests.get(test_url, headers=headers, allow_redirects=False, stream=True)
                try:
                    content = r.raw.read(10)
                except:
                    continue

                if r.status_code == 200 and self._check(content):
github apache / incubator-spot / spot-oa / oa / dns / dns_oa.py View on Github external
def _add_tld_column(self):
        qry_name_col = self._conf['dns_results_fields']['dns_qry_name'] 
        self._dns_scores = [conn + [ get_tld("http://" + str(conn[qry_name_col]), fail_silently=True) if "http://" not in str(conn[qry_name_col]) else get_tld(str(conn[qry_name_col]), fail_silently=True)] for conn in self._dns_scores ] 
github VainlyStrain / Vaile / modules / VlnAnalysis / Severe / fileo / subdom.py View on Github external
sublist.append(a)

    except IOError:
        print(R+' [-] Wordlist not found!')

    global found
    if 'http://' in web:
        web = web.replace('http://','')
    elif 'https://' in web:
        web = web.replace('https://','')
    else:
        pass

    web = 'http://' + web

    tld0 = get_tld(web, as_object=True)

    if len(sublist) > 0:
        for m in sublist:
            furl = str(m) + '.' + str(tld0)
            flist.append(furl)

    if flist:
        time.sleep(0.5)
        print(R+'\n      B R U T E F O R C E R')
        print(R+'     =======================\n')
        print(GR+' [*] Bruteforcing for possible subdomains...')
        for url in flist:
            if 'http://' in url:
                url = url.replace('http://','')
            elif 'https://' in url:
                url = url.replace('https://','')
github osroom / osroom / apps / utils / format / url_format.py View on Github external
def get_domain(url):
    """
    获取url中的全域名
    :param url:
    :return:
    """
    try:
        res = get_tld(url, as_object=True)
    except:
        return False
    return "{}.{}".format(res.subdomain, res.tld)

tld

Extract the top-level domain (TLD) from the URL given.

MPL-1.1 OR GPL-2.0-only OR LG…
Latest version published 2 years ago

Package Health Score

76 / 100
Full package analysis