Now, you may think that the program is completed, but I have to tell you that it is not completed.
Still, there is things, ways that we can improve it.
How to see.
Here we are having the interface and also the Mac address inside the script, inside the program.
Whenever a user want to change a mac address to a mac address or change the interface, they need to
open the program, it is not very good.
Okay, so how can we fix this?
It is better to ask the user to enter interface and enter the Mac address.
So interface is equal to input and list.
And here ask for interface okay.
This is going to be the interface.
And this port it is going to be the Mac address.
So input and let's say new Mac.
And now it is I think better let's go for this and execute this.
Okay.
What is the interface you want to change?
It is ETH zero.
And what is the new Mac address?
0011 okay.
One one.
Sorry.
Interface is ETH zero.
Hit enter now 1100 okay 2233 and four four and five five hit enter.
Now you see that changing Mac address to this one okay.
Cannot assign request address.
No problem.
Now let's use ifconfig and see if it is changed or not okay.
And here you see that it is not changed.
Let's come back here okay.
And see why it is not changed.
Okay.
It looks it is Okay.
It has no error here.
We have no problem.
Let's go and execute that again.
Let's see what is problem.
Okay.
Let me clear this for not clear.
Okay.
We have eth0.
Okay.
So now you see that this is the Mac address okay.
And zero zero okay.
112233 and four four.
This time again I'm going to change it back to five five.
Hit enter.
And you see that it is changing Mac address for eth0 to this Mac address.
It is what we executed or it is what we give.
Okay.
And now if I use ifconfig you see that it is changed okay.
I don't know what was the problem.
Cannot assign requested address.
Oh my God.
It is something that I give is the problem with problem is with giving.
This Mac address is not something that we can assign.
Okay.
And here we used.
Um.
Input function okay.
To ask the user to enter interface and new Mac address, and then we can use it that there is still
a problem.
Okay.
Let me show you.
Now.
Okay.
The user it is asking the user to enter the interface.
He is entering the ETH zero and then this semicolon.
And then for example LSE again semicolon.
And then hit enter new Mac address something okay.
And you see here we have changing Mac address to this.
And then we have eth0.
And again we have ETH zero okay.
We have Mac changer dot pi.
And then this thing not found.
And then we have three times this one.
Why is that.
Okay.
Come on.
And what is that?
What happened?
It is called hijacking.
Okay.
In programming language, it is called hijacking.
While we use this semicolon.
Okay.
And then use another command that means first it will execute this one and then it will execute this
one.
So it is one problem.
One big problem.
Whenever the user is going to use our program, he could hijack your program and use and execute another
command beside what we give.
So we need to solve this problem okay.
We can solve it very easily by just uh, by just adding here, okay.
Not just giving all this as a string, okay.
By giving them into a list.
Okay.
By putting them into a list.
So while the user is checking, it will come and check if a thing that the user enter if that exists
in a list, so it will execute.
If not then it will not be executed.
So let's go and see that in the next lecture.