Creating a banner.
Hi, guys, welcome back to the course.
Today, we're going to talk and actually create a banner.
The banner is actually providing us with information related to the name of the Web server and the version
on which the server is running on.
And for that reason, it is quite important information to have if we want to assess a remote server.
So obviously using the Stockett's module, you can easily actually really easy obtain this information.
And today I will show you how.
So if I create the new file in the file will be called Banner, and the first thing I will do is to
add to the Python Library.
So I will do the user in Python three.
OK, and let's import.
Socket and after that, let's import the R e package here, so let's do so.
Equals.
Socket, that socket.
And in the break, it's our right socket that A.F. underscore I need, and these are always concretised
that we're adding just windlass websites, so soak it so extreme.
OK, and then if right.
Sock not.
Connect, and then we're going to write the name of the website, which will be secure ami dot com.
OK.
Como 80?
That's right.
We actually don't need one of the brackets and extrude only the second one as well.
OK, and then let's write htp underscore or actually htp get in here will get the htp.
So that's right.
We get htp then one point, one backslash and so on the next row we write host and then the name of
the host which will be w w w dot skilled.
Army dot com and actually for a growth, right?
Double, double, double.
Scutaro dot com.
OK, that's it, and then let's read backslash and backslash, OK?
And then let's right there and there will be, quote, actually one empty variable name to string,
because who filled with data later on.
So let's try to try.
So do an exception here and then soc equals send all OK.
And I will write HTP.
Ish to forget.
OK, so we get all the data and after that, here we are going to update our data parameter that is
empty for now.
So.
All right.
So that receive.
From and then I will do one thousand twenty four and then.
Let's read this to our data, because we want to convert a string so I right data zero.
OK, then Heather will be called to estie our data that.
Split lines and then that's right for Kether actually here hitters.
OK, so we're here in.
In Heather's Let's write print, Heather notes the quote.
OK, so here we're decoding the heather.
And after we do that, let's write the actual value of the exceptions.
So except socket, not error.
And then let's print and let's print circuit error, comma.
Socket that error, and then it's right here, finally.
OK, we'll print closing.
Connection.
OK.
And then a so-called CLO's.
Flows and that's it.
OK, we're ready with that group.
Guys, let's save it and let's run now the script and see what we get.
So if I'm right here, as you can see the banner that your way.
So let's do Python and then banner up your way and you can see that the socket connect our argument
is wrong.
So let's see what the issue is.
So I think they're here is that they remove the second bracket.
Let's put it back in and let's see if it's going to run now.
So as you can see now, we need to wait for a certain time because the court needs to process a bit.
But after a few seconds, we are actually getting the banner of our website.
And if we can see here, we're getting the HTP data.
A sexualising request.
But in any ways, we're getting the type of server who are getting the content and we're getting the
connection that is not closed because of the last statement in our call.
And also you are getting the e-mail hit that request and we can see that the server could not be understand
and so on and so forth.
But this section does matter because we will go to the HTML file, which means that we successfully
established a connection to the server, even though the server provides information that the website
is bad.
So this is all that I want to share with you guys about Barnhurst.
Now you can obtain them and you can see that the code for obtaining them is not that long.
So thank you very much for watching.
And in the next video, we're going to talk about port scanning.