forked from lasilva19/domain-verify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdomain-verify.py
More file actions
146 lines (116 loc) · 7.52 KB
/
domain-verify.py
File metadata and controls
146 lines (116 loc) · 7.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Autor: Luciano Silva
import datetime
import commands
import sys
import os
import re
DOMINIO = sys.argv[1]
LISTA = DOMINIO.split(".")
TAMANHO = len(LISTA)
SUFIXO = LISTA[TAMANHO-1]
print SUFIXO
if (SUFIXO == "br"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep ^expires: | cut -c14-17"))
MES = int(commands.getoutput("whois "+DOMINIO+" | grep ^expires: | cut -c18-19"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep ^expires: | cut -c20-21"))
elif (SUFIXO == "com"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registrar Registration Expiration' | cut -c41-44"))
MES = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registrar Registration Expiration' | cut -c46-47"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registrar Registration Expiration' | cut -c49-50"))
elif (SUFIXO == "cl"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Expiration date' | cut -c18-21"))
MES = int(commands.getoutput("whois "+DOMINIO+" | grep 'Expiration date' | cut -c23-24"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Expiration date' | cut -c26-27"))
elif (SUFIXO == "ai"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "app"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "biz"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "bo"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Fecha de vencimiento' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Fecha de vencimiento' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Fecha de vencimiento' | cut -c31-32"))
elif (SUFIXO == "ca"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "club"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "biz"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "co"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "info"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "io"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "me"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "mo"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "mx"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Expiration Date' | cut -c20-23"))
MES = int(commands.getoutput("whois "+DOMINIO+" | grep 'Expiration Date' | cut -c25-26"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Expiration Date' | cut -c28-29"))
elif (SUFIXO == "net"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registrar Registration Expiration Date' | cut -c41-44"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registrar Registration Expiration Date' | cut -c46-47"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registrar Registration Expiration Date' | cut -c49-50"))
elif (SUFIXO == "online"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "org"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "sh"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "travel"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "us"):
ANO = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c23-26"))
MES = int(commands.getoutput("whois "+DOMINIO+"| grep 'Registry Expiry Date' | cut -c28-29"))
DIA = int(commands.getoutput("whois "+DOMINIO+" | grep 'Registry Expiry Date' | cut -c31-32"))
elif (SUFIXO == "as"):
ANO_ATUAL = int(commands.getoutput("date +%Y"))
ANO_VENCIMENTO = ANO_ATUAL+1
ANO = ANO_VENCIMENTO
MES = 1
DIA = 23
EXPIRACAO = datetime.datetime( ANO, MES, DIA)
HOJE = datetime.datetime.today()
RESULTADO = EXPIRACAO - HOJE
DIAS_RESTANTES=RESULTADO.days
print RESULTADO
print EXPIRACAO
print HOJE
print DIAS_RESTANTES
sys.exit()