-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBeacon.py
101 lines (84 loc) · 4.18 KB
/
Beacon.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
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
# Date Completed - Sept - 11 - 2018
# Date Modified : 2 nov 2018
# Changelogs :
# Added Registration feature.
# Fixed some bugs
import socket
import os
from threading import Thread
try:
import colorama
except ImportError:
os.system("py -m pip install colorama")
from colorama import Fore, Style
import platform
import datetime, smtplib
import core
def __main__():
"""Registration"""
def clear_screen():
"""Clear the screen only"""
if os.name == 'nt':
os.system('cls')
else:
os.system('clear')
print(Fore.YELLOW+"Starting Script ... "+Style.RESET_ALL)
def registration_process():
def send_mail(message):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.ehlo()
try:
server.login(user_email, user_password)
except smtplib.SMTPAuthenticationError as login_incorrect:
print("[ - ] Login Information Incorrect. Re-run.", login_incorrect)
exit(1)
try:
server.sendmail(user_email, __author_email__, message)
except Exception as email_error:
print("[ - ] Email Sending Error, Re - run : ", email_error)
exit(1)
print("[ + ] Email Sent!")
print("------------------------------------------------------------------------")
print("| User Registration Process, Do not quit please.")
print("| Registeration Process will ask you for your GMAIL Credentials.")
print("| No Malacious intentions (See Code). Email will be sent with your Account to Author as part of Registration")
print("| Email message will be sent to developer just notifiyng that a new Person has Registered.")
print("| Information Taken is : Platform Name, Date & Time & Email. (Any doubts, See Code.)")
print("| " + platform.platform() + "| | ", datetime.datetime.now(), " | | ", "Your Gmail. |")
print("------------------------------------------------------------------------")
print("[ ------------- Process may take time. Please be patient ------------- ]")
user_name = input("[ ! ] Enter your USERNAME : ")
user_email = input("[ ! ] Enter GMAIL : ")
user_password = input("[ ! ] Enter Password : ")
__author_email__ = "fahad.mustafa0012@gmail.com"
ostime = datetime.datetime.now()
ostime = str(ostime)
msg = "Hey, My EMAIL is " + user_email + " & I just Registered in Beacon with " + platform.platform() + " !\n Time is " + ostime
info = open("user-info", "w+")
info.write("--] Email : " + user_email)
info.write("\n--] USERNAME : " + user_name)
info.close()
extra_msg = input("[ ? ] Would you like to send any Message to Developer? (Y/n): ")
if(extra_msg == "Y".lower().strip()):
extra = input("[ ! ] Enter Message : ")
send_mail(msg)
send_mail(extra)
else:
print("Okay, Skip.")
send_mail(msg)
print("[ + ] You are Registered!")
input("[ + ] Press Any key to Exit. Restart the Program to use Beacon.")
try:
clear_screen()
user_file = open("user-info", "r")
print(Fore.LIGHTCYAN_EX+"All things [OK]"+Style.RESET_ALL)
core.__main__()
except FileNotFoundError:
clear_screen()
print(Fore.YELLOW+"Starting Script ... "+Style.RESET_ALL)
print("[ * ] Starting Registration..")
registration_process()
if __name__ == "__main__":
__main__()