‫Instructor: Hi.
‫Within this lecture,
‫we're going to install the server
‫that I have told you about.
‫So, this challenge is actually very realistic,
‫because it involves a server,
‫and the server runs in our local server, in our local host,
‫which means that it's being run on our own computer
‫rather than a cloud's machine.
‫However, it's the same thing,
‫because we are using the connection
‫to get the data and display the data to the user on our app.
‫And in order to install the server,
‫we are going to have two separate lectures,
‫one for Windows and one for Mac,
‫because it's kind of different for each other,
‫and we are going to start with Windows.
‫So make sure you open this link that I have shared with you,
‫and download the whole challenge.
‫Okay?
‫So, this is the first thing that we are going to do.
‫It involves the Python code, the server code,
‫and it also involves the APK that we are going to work on.
‫So, the next thing to do is to install Python
‫in our Windows machine.
‫Windows doesn't come pre-installed,
‫actually, Python doesn't come pre-installed in Windows.
‫Okay?
‫So we're going to have to install it,
‫and then we're going to be able to run this server.
‫So, let's come here to download section,
‫and it will direct us
‫to download the latest version for Windows.
‫And however, that's not the thing that we are looking for,
‫maybe you will see something different over here,
‫like download Python option 3.9, 4.0,
‫it really doesn't matter,
‫because our server doesn't use Python 3,
‫it uses Python 2.
‫Okay?
‫So in order to find the latest version of Python 2,
‫you're gonna have to scroll down a little bit
‫and see Python 2.7 over here.
‫So, this is the thing that we are looking for.
‫We're going to download this Python,
‫and we're going to install it on our Windows machine
‫so that we will be able to run the server.
‫And just click on this link, okay?
‫Just click on the Python 2.7.17.
‫So, this is the latest version of Python 2.
‫And if you come over here, you will see the Windows links,
‫and as well as MacOS links.
‫Here you go.
‫Now, we have different options,
‫and we are actually looking for this MSI option.
‫And as you can see, this is for 64-bit.
‫Okay?
‫And this is for 32-bit.
‫So, depending on your operating system, go for your choice.
‫I'm using 64-bit,
‫so I'm going to download this one.
‫And this is fairly a small file,
‫so it will not take so much time to download.
‫After download is completed,
‫you will be ready to install it.
‫And installing is very easy as well,
‫using it maybe can be a little different for you
‫if you're using Python for the first time,
‫and I'm going to show you how to do that, don't worry.
‫So wait until this is finished,
‫and I believe this is finished,
‫but it's getting refreshed or something,
‫just click on the downloaded file,
‫and it'll pop open for you.
‫As you can see, I have Python installed,
‫so it says that either you can change it,
‫or remove it, or repair it,
‫so most probably you will see install it over here,
‫and all you have to do is just click Next, Next, and Finish.
‫Okay?
‫Just allow the computer to install it
‫if it asks for any permission, okay,
‫and it will do the installation for you.
‫So, that's it for installing Python, actually.
‫Even though it's stuck right now,
‫it will actually repair the Python,
‫or just try to update it once it gets out of this.
‫Yep, like this.
‫So, you will see exactly something like this,
‫it will install the Python,
‫and then you will be done.
‫So, it didn't ask me where to install it,
‫but make sure you take note of where you are installing it.
‫Of course, you can find it eventually.
‫Okay so, mine is under C:,
‫okay so, most probably it'll install it under C: over here,
‫and we are going to have to find this python.exe
‫in order to run our server,
‫so make sure you take a note of where you are installing it.
‫Okay?
‫And then when the installation completes,
‫come over here and find the python.exe.
‫So as you can see, mine is under C:\Python27.
‫So if yours is a different location, it doesn't matter,
‫just open your file browser
‫and try to find the Python27 folder,
‫and that's where the python exe is actually located.
‫So, let me see if the installation is completed or not.
‫No, it's still going on.
‫Yeah, it's now completed,
‫so I'm gonna say Finish.
‫Here we go.
‫Now what I'm going to do, I'm going to open this up,
‫and I believe we are done for here,
‫and we have downloaded this as well, right?
‫So, we have downloaded the CTF challenge
‫in in our computers as well,
‫so find it.
‫And if it's a zip file, you can extract it like this.
‫Okay? Or you can use WinRAR, or WinZip,
‫or any other extraction software
‫that you have on your computer.
‫So make sure you extract it
‫so that you will have all the files and folders ready,
‫and we are going to use Python in order to run our server.
‫And I'm going to show you exactly
‫how to find the server file on your CTF challenge folder,
‫and then run it.
‫So, when you double-click on it,
‫you will see the AndroidLabServer,
‫and under AndroidLabServer, you will see these files.
‫So, let me open the Command Prompt
‫by running cmd on my search.
‫And what I want to do over here
‫is to find this folder using cd commands.
‫So, I'm gonna go for cd Downloads,
‫and when I run there,
‫I will see the Android-InsecureBank,
‫and I will just run cd Android-InsecureBank,
‫and then it will take me inside of it.
‫And then one more time, if I run there,
‫I will cd in AndroidLabServer folder over here,
‫so I'm gonna go for cd AndroidLabServer,
‫and if I run there,
‫I will see the exact files
‫that I have seen in my file browser, right?
‫So make sure you come to this point,
‫when you run there,
‫you will see all these files and folders.
‫Then we are gonna run something like this,
‫pip install -r requirements.txt.
‫But it won't work,
‫because it actually requires Python
‫in order to run this command, okay?
‫So what we are going to do,
‫we are going to paste the thing that we have copied.
‫So, let me go over here and show you one more time.
‫If you go to your computer, okay,
‫if you go to your Python folder,
‫not this one, but C:,
‫then come over here, make sure you find python.exe,
‫it doesn't matter where it's located,
‫but once you find it, you have to run it like this.
‫So, C:\Python27\python.exe -m pip install requirements.txt.
‫And actually we have a -r over here as well.
‫So, once we do that, it will run the pip command,
‫so it will install the library's required packages for you
‫in order to run it.
‫As you can see, it's downloading something,
‫and it will download and install
‫all the required libraries for us.
‫So, we have used Python in order to run this command.
‫And again, if you actually install Python
‫any folder other than mine,
‫like under C:, then it really doesn't matter,
‫all you have to do is just write it like I have written,
‫python, okay?
‫So, make sure you use backward slashes,
‫like in a Windows style.
‫Okay?
‫And after that, make sure you wait
‫until this installation is finished,
‫because without having these requirements it won't work.
‫So, I believe it's still going on over here,
‫as you can see, we are using a lot of different libraries
‫just to run the server.
‫And now this is done,
‫so I'm gonna run cls.
‫And when I run dir,
‫I will see this app.py.
‫So, in order to run this py, which is a Python file,
‫I'm going to use Python one more time
‫and just write app.py, like this.
‫When I run it, it will ask for a permission,
‫I'm going to give it, of course,
‫and it will start running.
‫Okay, make sure you check all of these things,
‫and Allow access.
‫And when you do that,
‫it starts to work on your local host like that.
‫So, this is all you have to do
‫in order to run your Python server on your computer.
‫If you're done, just go into the next lecture,
‫and meet me there.