domain_search.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:operative-framework 作者: graniet 项目源码 文件源码
def main(self):
            domain_list = []
            load_name = self.get_options("enterprise")
            print Style.BRIGHT + Fore.BLUE + "Search domain name for "+load_name + Style.RESET_ALL
            start_with = ["www.","http://","https://"]
            end_with   = [".com",".fr",".org",".de",".eu"]
            for line in start_with:
                    for end_line in end_with:
                            domain = line + str(load_name) + end_line
                            try:
                                    return_code = urllib.urlopen(domain).getcode()
                                    return_code = str(return_code)
                                    if return_code != "404":
                                            domain_list.append(domain)
                                            print Fore.GREEN + "- "+Style.RESET_ALL + domain
                            except:
                                    Back.YELLOW + Fore.BLACK + "Can't get return code" + Style.RESET_ALL
        if len(domain_list) > 0:
            for domain in domain_list:
                self.export.append(domain)
        else:
            print Fore.RED + "No domain found" + Style.RESET_ALL
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号