Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion from_dict/check_from_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import urllib
import os
import time
import socket

socket.setdefaulttimeout(60)

domain_suffix = '.com'

Expand Down Expand Up @@ -33,7 +36,11 @@ def get_words_from_file(words_file=words_file, init_word_line=0):

def is_ava(domain):
"""判断该域名是否被注册"""
data = urllib.urlopen(api % domain).read()
try:
data = urllib.urlopen(api % domain).read()
except:
return False

ava_pattern = re.compile(r'<original>(.*) : .*</original>')
result = ava_pattern.findall(data)
if '210' in result:
Expand Down
7 changes: 6 additions & 1 deletion reverse/check_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import re
import os
import pickle
import socket

socket.setdefaulttimeout(60)
api = "http://panda.www.net.cn/cgi-bin/check.cgi?area_domain=%s" # api地址
string = "abcdefghigklmnopqrstuvwxyz" # 所有字母
string_len = len(string) # 长度
Expand Down Expand Up @@ -48,7 +50,10 @@ def num_2_string(name, string):

def is_ava(domain):
"""判断该域名是否被注册"""
data = urllib.urlopen(api % domain).read()
try:
data = urllib.urlopen(api % domain).read()
except:
return False
ava_pattern = re.compile(r'<original>(.*) : .*</original>')
perm_pattern = re.compile(r'Forbidden')
result = ava_pattern.findall(data)
Expand Down