Hello everybody and welcome back to the Python basics.
Right now what I want to show you is a real important command to the viewers in our backdoor creation
which is the raw input command.
Now what that command does is basically it allows us to actually give users an input for a certain command
or a certain number or something like that.
Now I will show you what I mean by that.
So let's say we have a variable called Number One.
So number one it's easy to realize that we will be storing a number in this variable and we want to
for example take an input from a user that is using our code.
So how do we do that.
First of all we want to specify that this number will be an integer.
So what we want to do right now we want to type your int which stands for integer and what we want to
do is open up our brackets and type the function raw underscore input this raw underscore input will
actually ask a user to input a number for us.
Now it could be a string as well but since we specified right here integer it will only accept an integer
value to be stored in number one variable.
So right here we want to open up another bracket add our quote sign suitable quotes enter a number.
Let we put two dots and close quotes and then close to parentheses the first one parenthesis is closed
for this one and the second parentheses is code for this one.
So this command basically means that we will actually store in a given number from our user.
So they will get printed enter a number and then they specify for example three press enter and then
our number one variable will have a value of three.
So let's present right here.
And as you can see this is what our users of code will see so they get prompted enter a number and let's
say we type Kate and that's about it.
So right now if we just type your number one you will see that number 1 has a value of 8.
But let's say for example they type here as TR which is a string.
This will produce an error which will say string is not an integer basically since it really isn't.
So we need to make sure that we receive an integer from the user.
But if we wanted for to example receive our string you would just need to use the same here command.
Just specify here instead of in specify string or SDR which stands for string and read here of course
you will not be specifying enter a number just enter a string and as you can see now that I as the type
of string is not callable let me just see what do they mean by that
Klein I think you need to specify anything for the string let's just see.
So if we delete this right here.
TR Yeah for string you only can specify the raw input so let's see number one.
Now what has which sweet little bit ridiculous name for a string.
It has a string value of SDR which is what we specified.
So let me just clear this a little bit.
You can see it better than I know type the comment once again.
So you don't get confused with this.
So let's see this comment will be used once we want to get a string input from a user.
And this command will be used once we want to get an integer input from a user.
Now also one thing that you need to know is basically as a hacker or as an ethical hacker it really
doesn't matter.
The the your code basically doesn't matter if it is well written or not.
What matters for us is that it actually works and it doesn't break all the time.
So our exploits our back doors they only to be coded however you want to call them.
But the main point is don't break.
They shouldn't break.
So if you for example upload a backdoor on your victim b c and it breaks it is not a really good backdoor
you want to be able to execute commands as long as you want and you want to be able to execute some
of the tasks that your backdoor can perform without any errors.
So that is the only thing that you need to focus on as an ethical hacker is to create the backdoor without
actually producing any errors during the execution of those back doors.
So we saw in the previous video how we can give a value to a variable.
And right now we saw how we can get an input from a user.
So let's actually make our first program that is not in the Python interpreter.
So how we do that.
First of all what we want to do is exit this.
So how you exited it is exit and then two brackets open and closed and this will give us back our route.
Terminal shell what we want to do is first of all let's see where we are so TWD we are in the slash
root directory.
And right now let's create our directory for python programs or you can call it any way you want.
I will just call python programs.
Let me change my directory to there.
Right now let us actually type here nine nano by 2 on one dot Pi which is our first bite program and
right here you will get an output of simple nano window which we saw a bunch of times.
So here we can write anything we want.
Make sure once you open a program that you add the DOT P Y extension which stands for python program
if you do not have those net these dot B why extension you will not be able to execute your python program.
So the first thing what you want to do right here is specify this right here.
So at the first line you want to specify hashtag then exclamation mark slash user.
Then python.
This is something that you need to include in all of your programs since it is referring to the Python
directory where all the libraries are.
So for example if you were to import different library that comes with python you will not be able to
use it if you don't specify this path right here.
So remember to always include this in your python programs as you can see right here if I just sit you
control all this enter and then control X and I go to the user shared python and just type here unless
you will see that they are python programs right here.
So you need to specify this path in your python program.
So let's go back to the root python programs and then narrow the item dot by right now.
Well let's see what we can create.
So what we will do right now is for example let's create a program that will ask an input from a user.
So it will ask for for example a number or it will ask for two numbers and then it will actually multiply
those two numbers so let's do that.
It is rather simple so let's say number one equals.
So we saw in the previous command integer raw underscore input then we specified enter first number
two that's closed double quotes you will see that these string right here gets basically gets output
it in green format which means this is a string we also need to add two additional brackets called brackets
for these two right here.
So that is the first command.
The second command we want to ask for number two so equals integer raw input enter second number.
This is rather simple so it is easy to understand.
And right here what we want to do is result equals number 1.
And then this start sine number two which will multiply so this star sign right here is used to multiply
two numbers in python program.
So as we can see we will get the results sign out.
We will get the value of these two numbers multiply as taught in the result.
But right now if you were to for example compile this program or make it an executable and then run
it you would not get any output right here since.
What we need to do right now is actually type here.
Print result which will print the value or stored in result for us.
So just control oh this X or pardon me enter and then control x.
And if we just type here unless you will see we have our python program here now you will not be able
to run this on until you make it an executable.
So how do we make Python program edible.
We make it with see each month plus X. So loss X stands for executable we already covered that all of
this and then Python 1.0 PI we just entered that and just type your l s once again and we can see that
our program is now in Green format which means it is executable.
And how do we run it.
We run it with basically just dot slash Python 1 not pi.
And as we can see right here it will ask us for first number so let's say we are the first number is
three.
And the second number the second number is four.
And we will get twelve as a result.
But let's actually make this even a little bit prettier.
So nano Python 1 the PI.
Now let's actually print right here.
So we will do it with the same command that recovering the previous video.
So the result is then two dots.
Then as you remember when to specify the percent sign and an S for the Parliament and D for the number
then we close the quotes.
And after that percent result which is our integer number which will actually give us the value of result
instead of these percent D right here.
So if I say this once again.
So control and their control X to exit and then I run once again so 3 4 and you will see the result
is twelve.
So that is rather our first python program.
This is how you can make it an executable.
And this is how we can do the most simple program that we covered for now in the next video we will
start off with the sum of the loops that are in Python for example if loop while loop for loop and all
of that which is really important for us and which we will use in our coding section of backdoor but
for this video that would be it.
And I hope I see on the next one and take care but.