-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemailspoof.py
55 lines (49 loc) · 1.73 KB
/
emailspoof.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
try:
import time
from sys import __stdout__, stdout
from threading import Thread
from subprocess import *
import os
import sys
import subprocess
import threading
import readline
from termcolor import colored
except ImportError:
print("\ncheck for prerequisities ")
def emailspoof_ZT(target):
os.system('clear')
p = './output/mailSpoof/'
try:
os.mkdir(p)
except FileExistsError as exc:
print(exc)
dnsrecon = "~/Tools/dnsrecon/dnsrecon.py"
print(colored("\n--------------------------------------------",
'red', attrs=['bold']))
print(
colored("[+] Start collecting information about target", 'red', attrs=['bold']))
print(colored("--------------------------------------------",
'red', attrs=['bold']))
print(colored("\n[*]\tRunning DNSRECON\n[*]", 'red', attrs=['bold']))
# global fileObject
cmd = [
"python3 "+dnsrecon+" -d "+target+" -a -j output/mailSpoof/zt.json",
"cat output/mailSpoof/zt.json | tee output/mailSpoof/Spoof_zonetransfer.txt"
]
try:
for c in cmd:
proc = subprocess.run(c, shell=True, stderr=STDOUT, stdout=PIPE)
print(c)
if(proc.returncode != 0):
print(colored('Step 1 Failed! Check/Update prerequisitie packages. \nError: ',
'blue', attrs=['bold']) + proc.stderr.rstrip())
return False
else:
subprocess.run(
'rm output/mailSpoof/zt.json', shell=True, stdout=PIPE)
print(colored("[x] Executed", 'blue', attrs=['bold']))
except:
print("Something went wrong! Check prerequisities.\n")
return False
return True