1 00:00:04,890 --> 00:00:06,860 Creating a banner. 2 00:00:07,110 --> 00:00:08,960 Hi, guys, welcome back to the course. 3 00:00:09,300 --> 00:00:12,590 Today, we're going to talk and actually create a banner. 4 00:00:12,780 --> 00:00:20,850 The banner is actually providing us with information related to the name of the Web server and the version 5 00:00:20,850 --> 00:00:22,730 on which the server is running on. 6 00:00:22,950 --> 00:00:29,120 And for that reason, it is quite important information to have if we want to assess a remote server. 7 00:00:29,310 --> 00:00:36,780 So obviously using the Stockett's module, you can easily actually really easy obtain this information. 8 00:00:36,780 --> 00:00:38,200 And today I will show you how. 9 00:00:38,730 --> 00:00:46,200 So if I create the new file in the file will be called Banner, and the first thing I will do is to 10 00:00:46,200 --> 00:00:47,810 add to the Python Library. 11 00:00:48,120 --> 00:00:51,720 So I will do the user in Python three. 12 00:00:53,320 --> 00:00:56,050 OK, and let's import. 13 00:00:57,560 --> 00:01:05,810 Socket and after that, let's import the R e package here, so let's do so. 14 00:01:06,110 --> 00:01:06,860 Equals. 15 00:01:07,860 --> 00:01:11,100 Socket, that socket. 16 00:01:12,330 --> 00:01:21,080 And in the break, it's our right socket that A.F. underscore I need, and these are always concretised 17 00:01:21,080 --> 00:01:26,180 that we're adding just windlass websites, so soak it so extreme. 18 00:01:26,560 --> 00:01:28,710 OK, and then if right. 19 00:01:29,010 --> 00:01:30,490 Sock not. 20 00:01:31,480 --> 00:01:41,440 Connect, and then we're going to write the name of the website, which will be secure ami dot com. 21 00:01:41,740 --> 00:01:42,230 OK. 22 00:01:42,520 --> 00:01:44,280 Como 80? 23 00:01:44,750 --> 00:01:45,380 That's right. 24 00:01:45,390 --> 00:01:51,290 We actually don't need one of the brackets and extrude only the second one as well. 25 00:01:52,410 --> 00:02:04,860 OK, and then let's write htp underscore or actually htp get in here will get the htp. 26 00:02:05,410 --> 00:02:06,290 So that's right. 27 00:02:06,290 --> 00:02:18,490 We get htp then one point, one backslash and so on the next row we write host and then the name of 28 00:02:18,490 --> 00:02:23,200 the host which will be w w w dot skilled. 29 00:02:24,740 --> 00:02:27,880 Army dot com and actually for a growth, right? 30 00:02:27,940 --> 00:02:29,120 Double, double, double. 31 00:02:30,200 --> 00:02:31,630 Scutaro dot com. 32 00:02:31,670 --> 00:02:36,540 OK, that's it, and then let's read backslash and backslash, OK? 33 00:02:37,610 --> 00:02:46,120 And then let's right there and there will be, quote, actually one empty variable name to string, 34 00:02:46,550 --> 00:02:48,660 because who filled with data later on. 35 00:02:49,040 --> 00:02:50,350 So let's try to try. 36 00:02:51,560 --> 00:02:58,930 So do an exception here and then soc equals send all OK. 37 00:02:59,240 --> 00:03:01,820 And I will write HTP. 38 00:03:03,190 --> 00:03:04,410 Ish to forget. 39 00:03:04,810 --> 00:03:12,190 OK, so we get all the data and after that, here we are going to update our data parameter that is 40 00:03:12,220 --> 00:03:12,960 empty for now. 41 00:03:13,240 --> 00:03:13,420 So. 42 00:03:13,460 --> 00:03:13,810 All right. 43 00:03:13,810 --> 00:03:16,180 So that receive. 44 00:03:17,060 --> 00:03:23,180 From and then I will do one thousand twenty four and then. 45 00:03:24,520 --> 00:03:33,070 Let's read this to our data, because we want to convert a string so I right data zero. 46 00:03:34,140 --> 00:03:41,850 OK, then Heather will be called to estie our data that. 47 00:03:43,280 --> 00:03:48,850 Split lines and then that's right for Kether actually here hitters. 48 00:03:49,340 --> 00:03:51,410 OK, so we're here in. 49 00:03:52,470 --> 00:03:59,240 In Heather's Let's write print, Heather notes the quote. 50 00:03:59,440 --> 00:04:01,980 OK, so here we're decoding the heather. 51 00:04:02,340 --> 00:04:06,810 And after we do that, let's write the actual value of the exceptions. 52 00:04:07,080 --> 00:04:10,830 So except socket, not error. 53 00:04:11,280 --> 00:04:16,410 And then let's print and let's print circuit error, comma. 54 00:04:17,890 --> 00:04:23,090 Socket that error, and then it's right here, finally. 55 00:04:23,950 --> 00:04:29,020 OK, we'll print closing. 56 00:04:30,040 --> 00:04:30,820 Connection. 57 00:04:31,390 --> 00:04:31,710 OK. 58 00:04:32,590 --> 00:04:35,560 And then a so-called CLO's. 59 00:04:37,160 --> 00:04:38,420 Flows and that's it. 60 00:04:38,570 --> 00:04:40,000 OK, we're ready with that group. 61 00:04:40,510 --> 00:04:44,910 Guys, let's save it and let's run now the script and see what we get. 62 00:04:45,230 --> 00:04:50,210 So if I'm right here, as you can see the banner that your way. 63 00:04:50,210 --> 00:04:57,710 So let's do Python and then banner up your way and you can see that the socket connect our argument 64 00:04:57,710 --> 00:04:58,210 is wrong. 65 00:04:58,700 --> 00:05:00,500 So let's see what the issue is. 66 00:05:00,650 --> 00:05:03,710 So I think they're here is that they remove the second bracket. 67 00:05:04,280 --> 00:05:07,490 Let's put it back in and let's see if it's going to run now. 68 00:05:08,780 --> 00:05:14,450 So as you can see now, we need to wait for a certain time because the court needs to process a bit. 69 00:05:14,660 --> 00:05:20,090 But after a few seconds, we are actually getting the banner of our website. 70 00:05:21,080 --> 00:05:25,550 And if we can see here, we're getting the HTP data. 71 00:05:26,570 --> 00:05:28,370 A sexualising request. 72 00:05:28,790 --> 00:05:36,020 But in any ways, we're getting the type of server who are getting the content and we're getting the 73 00:05:36,020 --> 00:05:40,150 connection that is not closed because of the last statement in our call. 74 00:05:40,640 --> 00:05:51,220 And also you are getting the e-mail hit that request and we can see that the server could not be understand 75 00:05:51,230 --> 00:05:52,460 and so on and so forth. 76 00:05:52,760 --> 00:05:59,270 But this section does matter because we will go to the HTML file, which means that we successfully 77 00:05:59,270 --> 00:06:05,120 established a connection to the server, even though the server provides information that the website 78 00:06:05,120 --> 00:06:05,660 is bad. 79 00:06:05,810 --> 00:06:10,040 So this is all that I want to share with you guys about Barnhurst. 80 00:06:10,040 --> 00:06:14,550 Now you can obtain them and you can see that the code for obtaining them is not that long. 81 00:06:14,870 --> 00:06:16,710 So thank you very much for watching. 82 00:06:16,730 --> 00:06:20,420 And in the next video, we're going to talk about port scanning.