WEBVTT
Kind: captions
Language: en

00:00:01.040 --> 00:00:05.360
All right, getting a virus sucks. I think&nbsp;
we can all agree on that. But since they're&nbsp;&nbsp;

00:00:05.360 --> 00:00:10.080
so easy to make, I'm going to make one myself&nbsp;
today because why not? So, first I'll need a I&nbsp;&nbsp;

00:00:10.080 --> 00:00:14.960
mean test subject to try my script. For the sake&nbsp;
of this example, I made a virtual machine with&nbsp;&nbsp;

00:00:14.960 --> 00:00:21.600
my beloved VMware. Now, our unsuspecting test&nbsp;
subject needs an executable file to download.&nbsp;&nbsp;

00:00:21.600 --> 00:00:27.280
Most viruses nowadays come in the form of exes&nbsp;
or even PDFs like the ones crypto hackers use&nbsp;&nbsp;

00:00:27.280 --> 00:00:32.000
to break into famous YouTubers channels. But you&nbsp;
thought I wouldn't notice, huh? You thought you&nbsp;&nbsp;

00:00:32.000 --> 00:00:36.800
could hide it from me, but you can't. I know the&nbsp;
real reason why you're here. And to be honest,&nbsp;&nbsp;

00:00:36.800 --> 00:00:42.000
I won't judge. But I don't want you to just copy&nbsp;
and paste whatever I show you. The fact is you're&nbsp;&nbsp;

00:00:42.000 --> 00:00:46.800
here to learn because I ain't raising no damn&nbsp;
skid. I want you to understand what's going&nbsp;&nbsp;

00:00:46.800 --> 00:00:52.080
on so you can do it on your own in the future&nbsp;
and I can be proud just like your father. So,&nbsp;&nbsp;

00:00:52.080 --> 00:00:58.640
for this example, I'll be using a special file&nbsp;
type called a bat file. But what is a bat file?&nbsp;&nbsp;

00:00:58.640 --> 00:01:04.480
BAT stands for batch file, and it's a file type&nbsp;
that stores and runs batches of files. Therefore,&nbsp;&nbsp;

00:01:04.480 --> 00:01:10.400
a batch file. Why did I gain like a Texas accent&nbsp;
all of a sudden? Think about this as an .exe that&nbsp;&nbsp;

00:01:10.400 --> 00:01:16.000
doesn't need compiling. While an .exe requires&nbsp;
programming languages and a compiler to run,&nbsp;&nbsp;

00:01:16.000 --> 00:01:21.840
a batch file only runs on cmd commands. Hear&nbsp;
that? CMD commands. I mean, you can just know&nbsp;&nbsp;

00:01:21.840 --> 00:01:26.720
this is so much easier to use. But in the other&nbsp;
hand, while an .exe is more dangerous because&nbsp;&nbsp;

00:01:26.720 --> 00:01:32.080
of its capabilities, a batch file can do series&nbsp;
image too if done right. To make a batch file,&nbsp;&nbsp;

00:01:32.080 --> 00:01:37.280
you just have to create a new text file and rename&nbsp;
it whatever you want. But make sure you have a bad&nbsp;&nbsp;

00:01:37.280 --> 00:01:42.320
in the end. This lets Windows know, hey, this is&nbsp;
not a text file. This is a batch file. Please stop&nbsp;&nbsp;

00:01:42.320 --> 00:01:47.920
adding bloatware to my computer. Inside this batch&nbsp;
file, we're going to write the following. Oh,&nbsp;&nbsp;

00:01:47.920 --> 00:01:52.640
sorry. I forgot I had to explain. Echo off tells&nbsp;
the command interpreter which is in this case&nbsp;&nbsp;

00:01:52.640 --> 00:01:58.400
cmd do not display each command before running it&nbsp;
please. This way everything looks way cleaner and&nbsp;&nbsp;

00:01:58.400 --> 00:02:04.480
easier to read. Then this just starts any program&nbsp;
in the system. If you wrote start notepad.exe it&nbsp;&nbsp;

00:02:04.480 --> 00:02:09.360
would open a new notepad tab and calculator and&nbsp;
whatnot. But those who pay attention would have&nbsp;&nbsp;

00:02:09.360 --> 00:02:13.920
noticed this two quotation marks. I mean why is&nbsp;
that? This is the name that the window is going&nbsp;&nbsp;

00:02:13.920 --> 00:02:18.800
to have because if you just wrote start website,&nbsp;
Windows would think that website is the title of&nbsp;&nbsp;

00:02:18.800 --> 00:02:24.800
the new window and not the URL because Windows&nbsp;
is stupid. Then we have echo which as opposed&nbsp;&nbsp;

00:02:24.800 --> 00:02:29.360
to echo off shows a message in the command&nbsp;
prompt. And finally, this waits for you to&nbsp;&nbsp;

00:02:29.360 --> 00:02:34.160
press any key to stop the program. I mean pretty&nbsp;
easy structure, right? And keep in mind there are&nbsp;&nbsp;

00:02:34.160 --> 00:02:38.880
plenty more useful commands you can use like for&nbsp;
example ram to make a comment inside the code,&nbsp;&nbsp;

00:02:38.880 --> 00:02:44.000
copy to copy files, and Dell which stands for&nbsp;
delete. And oh boy, let me tell you, you do not&nbsp;&nbsp;

00:02:44.000 --> 00:02:49.040
want to run this on your computer. Believe me. Now&nbsp;
here we have a basic script that opens a browser&nbsp;&nbsp;

00:02:49.040 --> 00:02:53.600
tab on our virtual machine. And in this case, I&nbsp;
made it so it will prompt the user to subscribe to&nbsp;&nbsp;

00:02:53.600 --> 00:02:58.880
my channel. But there are more things we can add&nbsp;
to this monstrosity to make it even more annoying.&nbsp;&nbsp;

00:02:58.880 --> 00:03:03.920
Like for example, I don't know, adding a for&nbsp;
loop so it opens five notepad tabs instead of&nbsp;&nbsp;

00:03:03.920 --> 00:03:08.240
one Chrome tab. To do this, we can add this&nbsp;
line of code into the script and watch the&nbsp;&nbsp;

00:03:08.240 --> 00:03:13.120
magic happen. And who says we can't be gentlemen&nbsp;
and let my virtual machine know it's been hacked&nbsp;&nbsp;

00:03:13.120 --> 00:03:18.000
in a polite way? But in a more serious note, no&nbsp;
virus is going to tell you you've been hacked. So,&nbsp;&nbsp;

00:03:18.000 --> 00:03:23.600
how do antiviruses just know what file is a virus&nbsp;
and whatnot? See, the thing about anti virus tools&nbsp;&nbsp;

00:03:23.600 --> 00:03:28.400
is that they compare the files you download&nbsp;
against a huge database of no malicious code&nbsp;&nbsp;

00:03:28.400 --> 00:03:33.680
patterns. So, if our bad file, for example, had&nbsp;
the same exact text as a known piece of malware,&nbsp;&nbsp;

00:03:33.680 --> 00:03:38.560
it will be flagged as a virus and removed from&nbsp;
our computer. But even in the off chance the code&nbsp;&nbsp;

00:03:38.560 --> 00:03:44.400
isn't in the in this database, the anti virus will&nbsp;
look at the behavior pattern of the virus. So,&nbsp;&nbsp;

00:03:44.400 --> 00:03:49.600
if for example a program tried to delete system&nbsp;
files or disable security tools, the antivirus&nbsp;&nbsp;

00:03:49.600 --> 00:03:54.960
would go like, "Get out of here. You ain't fooling&nbsp;
anyone." But the thing about these detections is&nbsp;&nbsp;

00:03:54.960 --> 00:04:00.400
that they aren't flawless and sometimes harmless&nbsp;
scripts can get flagged. And talking about false&nbsp;&nbsp;

00:04:00.400 --> 00:04:04.640
positives, we can actually trigger one in&nbsp;
our virtual machine with this abomination&nbsp;&nbsp;

00:04:04.640 --> 00:04:09.040
right here. You don't have to understand it to&nbsp;
know what it does, but in case you're curious,&nbsp;&nbsp;

00:04:09.040 --> 00:04:14.640
Achar contains the harmless test string recognized&nbsp;
by the antivirus. Basically, these guys are so&nbsp;&nbsp;

00:04:14.640 --> 00:04:19.280
awesome that they developed a harmless test&nbsp;
file to safely check whether your anti virus&nbsp;&nbsp;

00:04:19.280 --> 00:04:24.400
is working. And finally, if done right, Defender&nbsp;
will detect it if the file was created. Oh, and&nbsp;&nbsp;

00:04:24.400 --> 00:04:29.840
keep in mind I did this 100% at a virtual machine&nbsp;
because I was not going to do this in my host

