-
Notifications
You must be signed in to change notification settings - Fork 71
/
knock.py
70 lines (65 loc) · 2.39 KB
/
knock.py
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
#!/usr/bin/python
# -*- coding: iso-8859-15 -*-
# Copyright 2017 Knock Mail.
# Written by: * Alisson Moretto - 4w4k3
# https://github.com/4w4k3/KnockMail
# Licensed under the BSD-3-Clause
from os import system
from sys import stdout, exit
from validate_email import validate_email
results = []
system('clear')
BLUE, RED, WHITE, YELLOW, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;32m', '\033[0m'
def search():
inputfil = raw_input("Type the path of file containing a list of emails: ")
with open(inputfil) as inputfile:
for line in inputfile:
results.append(line.strip())
count = 0
for i in results:
is_valid = validate_email(i,verify=True)
count += 1
if str(is_valid).upper() == "TRUE":
stdout.write(GREEN + "[*] FOUND - [" + i + "] "+ BLUE + "{line " + str(count) + "}\n" + END)
else:
stdout.write(RED + "[!] NOTFD - [" + i + "]" + BLUE + " {line " + str(count) + "}\n" + END)
def single():
ema = raw_input("Type the email to search: ")
is_valid = validate_email(ema,verify=True)
if str(is_valid).upper() == "TRUE":
stdout.write(GREEN + "[*] FOUND - [" + ema + "]\n" + END)
else:
stdout.write(RED + "[!] NOTFD - [" + ema + "]\n" + END)
stdout.write(WHITE + '''
By: @4w4k3
https://github.com/4w4k3
[- -]''' + RED + '''
_| _| _|
_| _| _|_|_| _|_| _|_|_| _| _|
_|_| _| _| _| _| _| _|_|
_| _| _| _| _| _| _| _| _|
_| _| _| _| _|_| _|_|_| _| _|
mail''' + END + '''
[ ]''' + RED + ' Knock Knock Mail ' + END + '''[ ]
v1.0
[- -]
''')
print '''
-Usage- Select an option:
{0}[{1}1{0}]{1} Perform a search of emails from specified file.
{0}[{1}2{0}]{1} Single search for specified email.
{0}[{1}U{0}]{1} Update.
{0}[{1}E{0}]{1} Exit.
'''.format(RED, END)
while True:
try:
ask = raw_input("KKM > ").format(RED, END)
if ask.upper() == "1":
search()
if ask.upper() == "2":
single()
if ask.upper() == "E":
exit(0)
except:
print "\nThank you for use Knock Mail."
exit(0)