1 00:00:00,600 --> 00:00:03,910 Now it is time to write our own first Botkin. 2 00:00:04,350 --> 00:00:09,920 OK, now, actually, I am assuming that you know how what kind what? 3 00:00:10,260 --> 00:00:11,770 So I will start right away. 4 00:00:12,180 --> 00:00:18,860 OK, now, actually, I already write the program, as you can see, to avoid wasting your time to to 5 00:00:19,020 --> 00:00:22,130 avoid stupid mistakes and taking a lot of time. 6 00:00:22,140 --> 00:00:24,400 Actually, this is not good, but don't worry, OK? 7 00:00:24,630 --> 00:00:27,700 Actually I would explain that in details line by line. 8 00:00:27,770 --> 00:00:32,540 OK, so I by the way, I already upload this code so you can download it. 9 00:00:32,880 --> 00:00:38,080 You can have a look there and you can have practice that with me. 10 00:00:38,310 --> 00:00:43,920 OK, so the first thing which is the import and we import it, the buy it. 11 00:00:44,130 --> 00:00:46,290 Now what is this library or module. 12 00:00:46,680 --> 00:00:54,660 So actually if you write it on Google, as simple as that now actually you can see that it is just Hick's 13 00:00:54,780 --> 00:00:58,080 ASCII text and render it in ASCII art form. 14 00:00:58,200 --> 00:01:06,090 OK, so if I return here again, so you can see that I'm using this variable and I'm using the Biophilia 15 00:01:06,510 --> 00:01:11,990 DOT format and I'm using as some text here, which is the scan. 16 00:01:12,030 --> 00:01:17,670 OK, so I'm typing what's going on here and I'm printing the ASCII banner. 17 00:01:17,700 --> 00:01:24,490 OK, so if I open my terminal here and run my code, by the way, I'm putting it here, what can I just 18 00:01:24,510 --> 00:01:26,040 buy and I want to run it. 19 00:01:26,400 --> 00:01:27,900 OK, so like this. 20 00:01:28,820 --> 00:01:32,440 If you ignore this invalid amount of argument, we will talk about it right away. 21 00:01:32,610 --> 00:01:39,500 But for now, you can see the body scanner has somehow the vibe of a hacker or something like that, 22 00:01:39,510 --> 00:01:40,100 you see. 23 00:01:40,320 --> 00:01:45,840 So you can see that it is somehow elegant and, you know, for putting us and ask you or something, 24 00:01:46,200 --> 00:01:47,130 by the way, you can just. 25 00:01:47,140 --> 00:01:49,710 But what's going or we don't need that. 26 00:01:49,740 --> 00:01:54,810 So what is matter is the functionality, not the stuff about it or the way it look. 27 00:01:54,840 --> 00:01:56,100 So we return here. 28 00:01:56,100 --> 00:01:58,710 You can see that the scanner has been. 29 00:01:59,770 --> 00:02:02,590 Written as an ASCII text banner. 30 00:02:02,620 --> 00:02:08,500 OK, so if I type test, for example, so and I return here actually. 31 00:02:09,770 --> 00:02:12,440 You can see that now it is just, by the way. 32 00:02:12,600 --> 00:02:13,880 All right, so far, so good. 33 00:02:14,120 --> 00:02:23,150 OK, so if we return here, let's return this to Botswana and you can see that we open a variable using 34 00:02:23,150 --> 00:02:26,960 this by village, which is the imported one, that format. 35 00:02:26,990 --> 00:02:29,750 This is a function within the village library. 36 00:02:29,930 --> 00:02:36,730 And inside it, we can put the text we want, which is Botswana, and then we print the variable with 37 00:02:36,900 --> 00:02:41,080 which we defined or we thought that inside it, which is the banner. 38 00:02:41,110 --> 00:02:42,830 OK, now this is what we call it. 39 00:02:43,080 --> 00:02:47,900 OK, now we can see that we imported this library and this is used. 40 00:02:48,530 --> 00:02:49,610 You can see that here. 41 00:02:50,390 --> 00:02:54,070 And this is what I talked about, which is the inverted amount of argument. 42 00:02:54,410 --> 00:02:59,490 Now here you can see we we used systems that are the equal equal to. 43 00:02:59,750 --> 00:03:04,070 So then the target will we will take or will do something. 44 00:03:04,100 --> 00:03:11,240 We talk about this right away, don't worry else, which means the argument is not Tooele or so it is 45 00:03:11,240 --> 00:03:12,980 less than two or more than two. 46 00:03:13,040 --> 00:03:14,060 This is not acceptable. 47 00:03:14,070 --> 00:03:16,910 So we will print this invalid amount of argument. 48 00:03:17,090 --> 00:03:19,460 OK, now, by the way, we already show that. 49 00:03:19,460 --> 00:03:25,220 So let's see again so you can see that this is the bottom three and this is Bortz, Canada by. 50 00:03:26,180 --> 00:03:27,280 So if I write here. 51 00:03:27,560 --> 00:03:31,670 So actually, yeah, you can see that it is inverted amount of argument. 52 00:03:32,210 --> 00:03:34,250 By the way, I forget to save here. 53 00:03:34,580 --> 00:03:38,190 So let's return, let's clear the screen and turn again. 54 00:03:38,210 --> 00:03:38,540 Yeah. 55 00:03:38,870 --> 00:03:40,980 I see that invalid amount of argument. 56 00:03:41,000 --> 00:03:42,980 OK, now this is not acceptable because. 57 00:03:42,980 --> 00:03:44,200 Why why is that. 58 00:03:44,210 --> 00:03:48,890 Because we only bought scan but we need to provide the IP address actually. 59 00:03:49,190 --> 00:03:50,510 But you can see it here. 60 00:03:50,510 --> 00:03:52,760 You can say here and there at the moment for argument. 61 00:03:52,760 --> 00:04:00,110 You can, you must but so you can modify that you must and served or put into. 62 00:04:01,510 --> 00:04:02,660 The I.B., for example. 63 00:04:02,690 --> 00:04:04,210 OK, it doesn't matter. 64 00:04:04,240 --> 00:04:12,010 Actually, no big deal, so they did this and run it again because the invalid argument, you must enter 65 00:04:12,010 --> 00:04:13,080 the IP anyway. 66 00:04:13,090 --> 00:04:14,710 It's no big deal, actually. 67 00:04:15,010 --> 00:04:17,330 OK, now here for this. 68 00:04:17,330 --> 00:04:18,180 It's all right. 69 00:04:18,190 --> 00:04:18,950 So far, so good. 70 00:04:19,150 --> 00:04:20,360 Now for the socket. 71 00:04:20,650 --> 00:04:25,660 Now, this is the main library actually that's being used in what scanner? 72 00:04:25,690 --> 00:04:31,750 OK, so this is socket to open a socket and connection between the victim machine. 73 00:04:32,620 --> 00:04:40,780 So we want to scan there or here's what you can see that when we so it is less than one, less than 74 00:04:40,780 --> 00:04:44,820 two or greater than two, it will print in that amount of argument. 75 00:04:44,830 --> 00:04:47,870 But if we provide the argument we want. 76 00:04:47,890 --> 00:04:55,390 So if I return here and put it like this and find something here, actually, so you can see that this 77 00:04:55,390 --> 00:04:59,720 time it will take it, we would go through the if by the. 78 00:04:59,950 --> 00:05:02,820 And we will define a target variable. 79 00:05:02,860 --> 00:05:06,480 And inside it we would use the socket dot get tossed by name. 80 00:05:06,700 --> 00:05:10,060 And actually this is a function within that socket library. 81 00:05:10,210 --> 00:05:15,080 And here inside it we would use the system that are what are we want. 82 00:05:15,140 --> 00:05:19,060 OK, so by the way, are V1 which means that this one. 83 00:05:19,270 --> 00:05:21,300 OK, so actually it start from here. 84 00:05:21,310 --> 00:05:22,870 So zero one. 85 00:05:23,060 --> 00:05:26,110 OK, so you know that why it is two. 86 00:05:26,800 --> 00:05:32,140 Because this the scanner just by this considered to be one of the arguments by the way. 87 00:05:32,330 --> 00:05:36,580 OK, so this is the first argument and this is the second argument. 88 00:05:36,580 --> 00:05:41,710 OK, now I know this is not an IP address or nettelhorst, but this is just a better example. 89 00:05:41,710 --> 00:05:44,240 By the way, I would put a real IP address right away. 90 00:05:44,260 --> 00:05:46,090 OK, but for now, keep with me, OK? 91 00:05:47,210 --> 00:05:48,480 So this is the first argument. 92 00:05:48,500 --> 00:05:49,580 This is the second argument. 93 00:05:49,610 --> 00:05:54,970 OK, so that's why we would if it is only two, it would be acceptable only if it is two arguments, 94 00:05:54,980 --> 00:06:02,000 which means the name of that bathroom program and the IP address that we want to scan the board on. 95 00:06:02,240 --> 00:06:09,560 OK, OK, so what we will get here, so we will get the system, which is that this library here to 96 00:06:09,570 --> 00:06:13,430 start the and the one which means this one. 97 00:06:13,520 --> 00:06:15,920 OK, so start from zero one. 98 00:06:16,010 --> 00:06:18,350 I'm pretty sure you are getting familiar with that. 99 00:06:18,350 --> 00:06:20,540 So I will not repeat that again. 100 00:06:20,600 --> 00:06:21,980 OK, so this is one. 101 00:06:23,010 --> 00:06:29,190 OK, now, if it is done so we would store that ghettoised by name, so they get tossed by name here, 102 00:06:29,190 --> 00:06:32,390 by the way, if you can if you can search about it. 103 00:06:32,400 --> 00:06:35,790 So let's put it like that and see Button. 104 00:06:36,710 --> 00:06:37,520 And open. 105 00:06:38,490 --> 00:06:44,640 The official documentation and from here you can see that we have it here, so, yeah, get tossed by 106 00:06:44,640 --> 00:06:44,950 name. 107 00:06:45,750 --> 00:06:52,020 So this what what this does it translate a hostname to ebe the port address format. 108 00:06:52,890 --> 00:07:00,690 OK, so actually translate to I.B. for now before his return as a string such as this one. 109 00:07:01,410 --> 00:07:05,660 Now, if the host name is an IBT for itself is returned and changed. 110 00:07:05,690 --> 00:07:12,180 So either you provide, for example, hostname, for example, Google Titcomb, and it will translate 111 00:07:12,180 --> 00:07:19,620 that to its own IPV for, as you can see, or you can just provide the IP address of this machine and 112 00:07:19,620 --> 00:07:25,030 it will get it immediately or it will return it and change immediately. 113 00:07:25,050 --> 00:07:25,390 OK. 114 00:07:25,740 --> 00:07:26,220 All right. 115 00:07:26,820 --> 00:07:27,900 Now let's return again. 116 00:07:28,380 --> 00:07:36,440 So that IP address that we provide here also, by the way, actually it's not good practice to scan 117 00:07:36,660 --> 00:07:37,400 real machines. 118 00:07:37,410 --> 00:07:38,790 Actually, it is very dangerous. 119 00:07:39,510 --> 00:07:41,940 You will get yourself in jail for that. 120 00:07:42,300 --> 00:07:48,180 Well, I'm not I know it is not for just scanning the board, but actually it's better to be cautious 121 00:07:48,180 --> 00:07:49,560 in this in this scenario. 122 00:07:49,890 --> 00:07:51,410 So, by the way, how to do that? 123 00:07:51,420 --> 00:07:59,190 Actually, I have this machine, as you can see, I'm using the ATM machine and this meter of tool, 124 00:07:59,460 --> 00:08:01,050 actually, you can just download it. 125 00:08:01,480 --> 00:08:02,070 No big deal. 126 00:08:02,160 --> 00:08:06,690 You can download it and run it on your virtual box, as you can see, as a virtual machine. 127 00:08:06,870 --> 00:08:10,020 And then you can just have it here if config. 128 00:08:10,020 --> 00:08:13,970 And I will get my idea this, which is as as the following. 129 00:08:14,030 --> 00:08:18,950 OK, so which is this one, which is something within my machine and within my power. 130 00:08:18,960 --> 00:08:21,760 So no power and no damage will be done. 131 00:08:21,780 --> 00:08:25,220 OK, so you will be safe and you will not go to jail. 132 00:08:25,500 --> 00:08:31,240 So I bet you can see that the Botkin worked OK, so and so on. 133 00:08:31,260 --> 00:08:31,710 All right. 134 00:08:31,950 --> 00:08:32,760 So you can see. 135 00:08:32,760 --> 00:08:34,050 But don't worry about this. 136 00:08:34,050 --> 00:08:36,200 We will talk about this right away. 137 00:08:36,420 --> 00:08:38,080 I'm just showing you step by step. 138 00:08:38,120 --> 00:08:41,470 OK, so we got the IP address immediately, OK? 139 00:08:42,160 --> 00:08:45,270 And right now we talked about this. 140 00:08:45,720 --> 00:08:46,590 So far, so good. 141 00:08:46,590 --> 00:08:50,090 If it is the argument and else is invalid argument. 142 00:08:50,250 --> 00:08:50,730 All right. 143 00:08:50,970 --> 00:08:57,390 Now here just some accessories to make the utility writing more elegant. 144 00:08:57,390 --> 00:08:59,490 So we can you can see that here. 145 00:08:59,490 --> 00:09:07,620 If I return again, this command, you can see that I'm doing these some of the text, you can see dashes 146 00:09:08,070 --> 00:09:09,290 multiplied by 50. 147 00:09:09,300 --> 00:09:14,880 So which means that this will be printed 50 times instead of typing it like this. 148 00:09:14,880 --> 00:09:19,920 I mean, OK, so instead of like that, you can just put the number you want. 149 00:09:20,250 --> 00:09:24,510 But that string, I mean, you want and multiply it by how many times you want. 150 00:09:24,720 --> 00:09:30,600 OK, now we are scanning the target and this is the target, as you can see, if I return here, because 151 00:09:30,600 --> 00:09:34,620 he's scanning the target and this is the target, which is the IP address I provided here. 152 00:09:34,950 --> 00:09:38,420 And we're scanning started at something here. 153 00:09:38,580 --> 00:09:44,050 OK, this is the second thing or the other thing we will talk about, which is the data. 154 00:09:44,070 --> 00:09:49,920 So actually, I bought it from that time in both daytime and here at that time. 155 00:09:49,920 --> 00:09:50,460 Did not. 156 00:09:50,940 --> 00:09:55,700 So here it would return actually that time currently. 157 00:09:55,710 --> 00:09:59,790 So if I return here, you can see that the time is like this. 158 00:09:59,990 --> 00:10:01,350 OK, so I return. 159 00:10:01,680 --> 00:10:06,960 What is the time currently which is like this, as you can see, which hour, which minute, second, 160 00:10:07,230 --> 00:10:09,750 millisecond or part of the science and so on. 161 00:10:09,780 --> 00:10:10,170 OK. 162 00:10:11,180 --> 00:10:17,640 All right, again, we just print it as is so you can see the scanning started at something, so it 163 00:10:17,640 --> 00:10:22,670 will be more elegant and so on, and we print another dashes. 164 00:10:22,670 --> 00:10:25,040 So you can see we have these here. 165 00:10:25,310 --> 00:10:25,870 All right. 166 00:10:25,880 --> 00:10:26,750 So far, so good. 167 00:10:26,960 --> 00:10:28,410 Now, here is the real deal. 168 00:10:28,550 --> 00:10:30,440 OK, now here is the real question. 169 00:10:30,500 --> 00:10:35,210 Now, what if that was just for Baner for printing out and to be more elegant? 170 00:10:35,210 --> 00:10:37,020 And so this is the functionality. 171 00:10:37,040 --> 00:10:38,110 This is the real deal. 172 00:10:38,350 --> 00:10:43,790 OK, now, I already told you that we bought the socket and the socket library. 173 00:10:43,820 --> 00:10:47,480 Here is the main thing that we would use for our body scanner. 174 00:10:48,050 --> 00:10:52,040 OK, so I opened a tray and accepts. 175 00:10:52,100 --> 00:10:53,630 So try this. 176 00:10:53,960 --> 00:10:57,440 Don't worry, I will talk about it right away and accept something. 177 00:10:57,440 --> 00:10:58,400 Accept something. 178 00:10:58,400 --> 00:10:59,360 Accept something. 179 00:10:59,540 --> 00:11:00,080 All right. 180 00:11:00,650 --> 00:11:02,750 OK, now for the try, try these. 181 00:11:02,840 --> 00:11:07,920 OK, let's start with the for loop now for support in this range. 182 00:11:08,330 --> 00:11:15,860 So by that actually we start scanning the boards from one until we reached this number. 183 00:11:16,310 --> 00:11:20,420 But by the way, not this number, this number minus one, which is ninety nine. 184 00:11:20,450 --> 00:11:29,270 OK, by the way, you can put here and variable like this and put X equal input and put inside it. 185 00:11:29,780 --> 00:11:32,090 Please enter a value. 186 00:11:32,240 --> 00:11:36,950 OK, by the way, you need to convert that to an integer like this. 187 00:11:38,030 --> 00:11:39,400 You can see that like this. 188 00:11:39,410 --> 00:11:44,320 So here we can prompt our self. 189 00:11:44,540 --> 00:11:50,310 So where this can that as a hardcoded both know you can just customize it as it is. 190 00:11:50,380 --> 00:11:54,320 OK, but for now we don't need that actually this return to that previous. 191 00:11:54,500 --> 00:11:55,620 So we don't need that. 192 00:11:55,910 --> 00:11:58,650 Well, actually, you may ask me, but this is a symbol. 193 00:11:58,700 --> 00:11:59,730 Yeah, I know. 194 00:11:59,960 --> 00:12:07,500 And why should I learn or know how to write my own words where there is a tool like a map, for example. 195 00:12:07,520 --> 00:12:09,530 And it is very powerful, open source. 196 00:12:09,530 --> 00:12:11,180 And it has a huge community. 197 00:12:11,180 --> 00:12:15,560 And actually, of course, it is very powerful in comparing with this tiny thought. 198 00:12:15,870 --> 00:12:16,450 Yeah, I know. 199 00:12:16,580 --> 00:12:18,860 But for you as a hacker, not all the time. 200 00:12:18,860 --> 00:12:21,590 You need to depend on other people's tool. 201 00:12:21,740 --> 00:12:24,260 You need to write your own tools sometimes. 202 00:12:24,290 --> 00:12:25,310 OK, so that's one. 203 00:12:25,520 --> 00:12:26,720 OK, let's continue. 204 00:12:27,110 --> 00:12:31,230 So we started with the follow up and we start from one to ninety nine. 205 00:12:31,700 --> 00:12:39,440 Now here we open a variable and this variable we call this and we inside it we use the socket library 206 00:12:39,770 --> 00:12:41,420 that the socket function. 207 00:12:41,570 --> 00:12:44,840 Now this is function from the socket library. 208 00:12:44,840 --> 00:12:51,110 And here we defined that this socket that we want to open the socket is like a bucket. 209 00:12:51,110 --> 00:12:51,830 Imagine that. 210 00:12:52,130 --> 00:12:54,470 And we define the criteria, the standard. 211 00:12:54,470 --> 00:13:00,620 We want our connection to be with the other people or with the other the other end. 212 00:13:00,860 --> 00:13:04,700 And we define that it is to be on it and so extreme. 213 00:13:04,730 --> 00:13:13,280 Now, what are those f I need, which means I before OK, so extreme here means that it is for TCBY 214 00:13:13,280 --> 00:13:14,720 transmission control protocol. 215 00:13:14,960 --> 00:13:21,630 OK, so which means that we are opening ECB connection on IBD four with the other end. 216 00:13:21,750 --> 00:13:28,220 OK, and we store the value of that for the return value inside the S. 217 00:13:29,660 --> 00:13:32,520 So this as will be used later on as you can see here. 218 00:13:32,870 --> 00:13:41,350 OK, don't worry, we'll talk about it now after we open that, now we decide or we put the socket set 219 00:13:41,360 --> 00:13:44,200 timeout or the default timeout the socket. 220 00:13:44,210 --> 00:13:45,590 By the way, this is the library. 221 00:13:45,590 --> 00:13:48,440 We import it and that's a different time. 222 00:13:48,440 --> 00:13:49,230 Out to be one. 223 00:13:49,430 --> 00:13:54,860 Now what it is one, because we don't need to have the connection up for 30 seconds. 224 00:13:54,860 --> 00:13:57,370 For example, this will take a lot of time. 225 00:13:57,830 --> 00:14:04,050 We can put actually another values like ten seconds or five seconds or whatever. 226 00:14:04,070 --> 00:14:07,980 OK, but one second for to be for it to be more fast, OK. 227 00:14:08,240 --> 00:14:09,740 So why is that? 228 00:14:09,890 --> 00:14:12,970 Because when we connect to a specific board for example. 229 00:14:13,310 --> 00:14:19,240 But don't worry right now we did intended that both functionality we did intended that board functionality. 230 00:14:19,240 --> 00:14:21,700 Yet now we are talking about the connection. 231 00:14:21,860 --> 00:14:24,010 So here we will talk about the board. 232 00:14:24,050 --> 00:14:28,610 OK, but don't worry, we will talk about it step by step for now for me. 233 00:14:28,960 --> 00:14:30,790 OK, so default time out. 234 00:14:30,950 --> 00:14:39,650 So when we connect with that criteria to that specific board, we will not handle more than one second. 235 00:14:39,920 --> 00:14:46,370 OK, so after one second it would be considered timeout because we assuming that one second means that 236 00:14:46,370 --> 00:14:51,770 the board is closed so we don't need to know more about or that the board is open. 237 00:14:51,770 --> 00:14:53,420 We will know within this period. 238 00:14:53,630 --> 00:14:53,970 OK. 239 00:14:54,320 --> 00:14:55,610 Anyway, all right. 240 00:14:55,910 --> 00:14:59,840 Now we will have the result variable and inside that is a variable. 241 00:14:59,840 --> 00:15:07,160 We will use the variable that we thought our socket criteria, which is IB before and TCBY. 242 00:15:07,520 --> 00:15:10,760 And we will use, as you can see, that connect. 243 00:15:11,480 --> 00:15:17,480 Now, could next six, eight accept two arguments, but as a table, by the way, you can see that it 244 00:15:17,480 --> 00:15:21,170 is accepted as a tubin right now. 245 00:15:21,410 --> 00:15:24,750 The first thing is the target, which is if you return here. 246 00:15:24,800 --> 00:15:26,540 But this is the IP address we entered. 247 00:15:26,890 --> 00:15:31,100 Remember when we put the IP address, the second arguments are the one. 248 00:15:31,730 --> 00:15:32,150 Yeah. 249 00:15:32,540 --> 00:15:33,660 And the board. 250 00:15:33,710 --> 00:15:34,080 No. 251 00:15:34,290 --> 00:15:35,120 OK, so the board. 252 00:15:35,120 --> 00:15:38,000 No, it will start from the loop. 253 00:15:38,000 --> 00:15:40,010 So it will start from one until ninety nine. 254 00:15:40,160 --> 00:15:45,240 So it will strike one, two and three or four until it reach ninety nine. 255 00:15:45,650 --> 00:15:50,890 OK, so then the return of these would be stored on the result. 256 00:15:50,930 --> 00:15:58,400 By the way the Connect exe will return zero if the open if there are a connection other than that it 257 00:15:58,400 --> 00:15:59,510 would be considered close. 258 00:15:59,690 --> 00:16:01,870 So zero as you can see here. 259 00:16:01,880 --> 00:16:02,230 Yeah. 260 00:16:02,390 --> 00:16:06,530 If there is of equal equals zero this would be considered what is open. 261 00:16:06,680 --> 00:16:12,500 And you can see we opened, we used that, formatted that format the board because I'm using the basis 262 00:16:12,500 --> 00:16:13,550 here, OK. 263 00:16:14,030 --> 00:16:16,880 Other than that it will be considered close. 264 00:16:17,090 --> 00:16:18,260 Now how did I know that? 265 00:16:18,260 --> 00:16:19,960 Actually, it's not from myself. 266 00:16:19,970 --> 00:16:20,610 I get it. 267 00:16:20,900 --> 00:16:23,330 No, actually this is how the function works. 268 00:16:23,600 --> 00:16:30,740 It return zero for connection or for a connected socket and it would return other than that. 269 00:16:31,490 --> 00:16:39,800 So one nine five zero one, I mean, 10 something and or some values, OK, and these would be considered 270 00:16:39,800 --> 00:16:40,200 closed. 271 00:16:40,240 --> 00:16:41,630 OK, so no connection at all. 272 00:16:41,820 --> 00:16:45,770 OK, so either it is there is a connection or there is no connection. 273 00:16:46,280 --> 00:16:52,550 If there is not here, if it is zero, which means that the result of that connect X will be zero, 274 00:16:52,580 --> 00:16:53,900 which means the board is open. 275 00:16:53,930 --> 00:16:57,320 There is a connection other than that would be considered close. 276 00:16:57,500 --> 00:17:03,600 But you can see that I didn't put elsea because we just need the open, but we don't need any bot. 277 00:17:03,620 --> 00:17:04,010 Right. 278 00:17:04,250 --> 00:17:10,730 By the way, you can customize that on your own if you want to have some indigency, like you would 279 00:17:10,730 --> 00:17:15,170 need to need to know if there are no boards of it, you need to print those. 280 00:17:15,310 --> 00:17:17,870 And actually it's no, no, no big deal. 281 00:17:17,870 --> 00:17:18,860 You can just put it here. 282 00:17:19,100 --> 00:17:26,780 And this is something can be done by defining outside the trickier podium variable and inside it. 283 00:17:26,780 --> 00:17:28,640 But is nobut true. 284 00:17:29,480 --> 00:17:32,700 And if there are some board, it would be false. 285 00:17:32,930 --> 00:17:41,210 OK, and up here outside the tribe or outside there and the for loop, you would Brint know. 286 00:17:41,870 --> 00:17:43,250 What is it. 287 00:17:43,580 --> 00:17:43,850 Yeah. 288 00:17:43,950 --> 00:17:47,510 Yeah, it's it's up to how the logic you will use on that. 289 00:17:47,570 --> 00:17:48,740 OK, ok. 290 00:17:49,160 --> 00:17:56,750 No after we checked the result is equal zero and we print the board is open or there are level then 291 00:17:56,750 --> 00:17:58,170 we will close the connection. 292 00:17:58,190 --> 00:18:00,440 So as you can see s that close. 293 00:18:00,680 --> 00:18:01,110 Yeah. 294 00:18:01,160 --> 00:18:04,010 Here it is the S which is the variable. 295 00:18:04,010 --> 00:18:08,080 We thought our criteria so as not close. 296 00:18:08,090 --> 00:18:15,710 OK, and for these anything or any exception happened either if it is a keyboard interrupt or circuit 297 00:18:15,710 --> 00:18:23,270 that they error or circuit that we would brint and we will do the following which is Brint exiting program 298 00:18:23,570 --> 00:18:30,320 or print hostname couldn't be resolved or Brint therefore not responding by the way, that gave error 299 00:18:30,440 --> 00:18:31,320 and error. 300 00:18:31,610 --> 00:18:34,840 These are from the socket, by the way, from the socket library. 301 00:18:34,880 --> 00:18:35,770 You can read about it. 302 00:18:35,770 --> 00:18:40,810 So actually it's better to have lockyear so you can see that it is here. 303 00:18:40,810 --> 00:18:43,440 Yeah, a subclass of O has zero. 304 00:18:43,490 --> 00:18:47,210 This exception is raised for Adria's related errors, blah, blah, blah and so on. 305 00:18:47,210 --> 00:18:48,830 You can read more about it if you're interested. 306 00:18:49,130 --> 00:18:54,860 But anyway, because sometimes this is a these for the host couldn't be resolved. 307 00:18:54,860 --> 00:19:00,380 Actually these are used for the host couldn't be resolved and the that these are used for the server 308 00:19:00,380 --> 00:19:01,250 not responding. 309 00:19:01,430 --> 00:19:09,300 OK, now actually this sportscar is not 100 percent accurate, but you can say it is good for a start. 310 00:19:09,510 --> 00:19:12,080 OK, now it's time to test this out. 311 00:19:12,320 --> 00:19:20,660 By the way, I recommend you to install a meta virtual machine and run it on your system like this and 312 00:19:20,660 --> 00:19:23,900 copy the IP address and its output. 313 00:19:24,470 --> 00:19:29,210 So you can see that here I bought from one to one hundred. 314 00:19:29,220 --> 00:19:35,060 OK, so let's check so you can see that twenty one is open. 315 00:19:35,060 --> 00:19:35,720 Twenty two. 316 00:19:35,720 --> 00:19:36,500 Twenty three. 317 00:19:36,500 --> 00:19:36,890 Twenty five. 318 00:19:36,890 --> 00:19:43,550 By the way, this machine actually it's compromisable actually here because this is the MLO It is a 319 00:19:43,550 --> 00:19:48,410 lot, it has a lot of holes, a lot of vulnerability's bugs, a lot of dangerous. 320 00:19:48,590 --> 00:19:50,840 Ritsch can be done to it actually. 321 00:19:50,840 --> 00:19:51,140 Yeah. 322 00:19:51,140 --> 00:19:53,540 But this is intended for that. 323 00:19:53,870 --> 00:19:59,560 So that's why I'm using boin machines, not on a real world or real life machines like Google that com 324 00:19:59,570 --> 00:20:02,390 or like some servers online. 325 00:20:02,390 --> 00:20:07,760 So you may get InGen for that or get in trouble at least for by using that or by doing that. 326 00:20:07,790 --> 00:20:09,530 OK, now thanks for watching. 327 00:20:09,720 --> 00:20:10,610 I hope you enjoyed. 328 00:20:10,810 --> 00:20:13,510 This lecture I see you in the next lecture.