1 00:00:00,510 --> 00:00:06,420 So in this video, we'll be seeing how to enumerate the organizations using this enumerate log on sessions 2 00:00:06,420 --> 00:00:09,030 and this session data functions. 3 00:00:09,300 --> 00:00:16,620 So these query the edit sales process and in the task process view how all of the information. 4 00:00:18,260 --> 00:00:24,110 And the design of the solar cells process is also very large because it store various information. 5 00:00:25,490 --> 00:00:30,950 So first we need to gauge how many sessions are there are currently lockdown. 6 00:00:31,640 --> 00:00:36,410 So this will give you the count and also the point load structure. 7 00:00:36,710 --> 00:00:38,570 So we have already seen we. 8 00:00:44,210 --> 00:00:48,580 Wood defines a particular object. 9 00:00:49,550 --> 00:00:51,410 It contains no part in the high part. 10 00:00:53,400 --> 00:00:58,550 And the first to, you know, need to go to any input parameters. 11 00:00:58,560 --> 00:01:00,420 What are the output parameters? 12 00:01:00,690 --> 00:01:05,580 So the first one is pointer to a long integer that presumes a number of elements. 13 00:01:07,920 --> 00:01:13,410 And the second one is a pointer to an array of the new structures. 14 00:01:14,810 --> 00:01:20,240 So first, I have already defined this one, these functions, so we could see sometime. 15 00:01:23,790 --> 00:01:26,910 So here you can see enumerated organizations. 16 00:01:27,810 --> 00:01:33,870 First one is union 64 and I have changed this 1 to 64 with our target to. 17 00:01:37,170 --> 00:01:39,090 So that's why I'm using this 164. 18 00:01:39,090 --> 00:01:40,470 And second one is Pointer. 19 00:01:40,470 --> 00:01:47,010 So we can later marshal this structure to set this pointer to structure. 20 00:01:47,820 --> 00:01:53,700 And we should also call this aggressive free return buffer to free the buffer allocated way. 21 00:01:53,730 --> 00:01:54,810 And it says process. 22 00:01:57,440 --> 00:02:09,370 So first we need count is because the giro that is the country to which possibilities and it's enumerated 23 00:02:09,380 --> 00:02:10,280 organizations. 24 00:02:20,680 --> 00:02:26,070 Faster running the difference can comma second one use the pointer. 25 00:02:31,390 --> 00:02:34,230 So began to rule. 26 00:02:40,680 --> 00:02:41,640 And I would put these. 27 00:02:51,830 --> 00:02:54,200 And the return to visit there is. 28 00:02:55,190 --> 00:02:58,330 You rest easy cost, easy cost of zero. 29 00:02:58,340 --> 00:03:00,290 That means the function has been succeeded. 30 00:03:00,800 --> 00:03:04,770 Now we can go and print the count. 31 00:03:13,290 --> 00:03:15,000 So we had ten sessions. 32 00:03:19,060 --> 00:03:22,060 These sessions are saying go to some computer accounts. 33 00:03:22,480 --> 00:03:26,440 So we'll be seeing that in the output of the next function. 34 00:03:30,910 --> 00:03:38,380 So we have this code now we can go and master this a good pointer to the root structure and we can iterate 35 00:03:38,380 --> 00:03:39,040 over these. 36 00:03:40,330 --> 00:03:47,110 We know how many elements will be here, how many array of fruit pointers that is this content so we 37 00:03:47,110 --> 00:03:54,870 can search for you wrong i use requested zero are you just then count free press press. 38 00:03:56,050 --> 00:04:05,470 So we are iterating over these many number of sessions and we are going to convert this one. 39 00:04:09,340 --> 00:04:11,560 My shoulder stature. 40 00:04:12,430 --> 00:04:14,740 So the point is, we are. 41 00:04:17,640 --> 00:04:19,650 Common type of rule. 42 00:04:21,180 --> 00:04:24,420 So this gives us the rule. 43 00:04:28,720 --> 00:04:30,610 And we should also free this one. 44 00:04:39,680 --> 00:04:42,100 For every member in that area. 45 00:04:42,110 --> 00:04:48,100 We are going to convert this into a structure and we can print. 46 00:04:51,860 --> 00:04:52,760 The low part. 47 00:04:52,760 --> 00:04:53,220 A lot. 48 00:04:53,240 --> 00:04:55,160 Low part and. 49 00:04:57,170 --> 00:04:57,700 High bar. 50 00:04:57,770 --> 00:04:58,540 So high bar. 51 00:04:59,030 --> 00:05:01,010 In most cases it will be giro. 52 00:05:04,490 --> 00:05:11,360 And now this lead pointer points to the first element of the fast food structure. 53 00:05:11,570 --> 00:05:19,970 So in order to advance to the second structure, we need to add the size of this huge structure. 54 00:05:21,770 --> 00:05:30,080 So we can do that using our air that we need to convert this input to into 64 press the size of fluid 55 00:05:30,080 --> 00:05:32,210 pointer that is marginal that size of. 56 00:05:34,160 --> 00:05:35,630 Type of rule. 57 00:05:37,820 --> 00:05:38,660 Now we need to. 58 00:05:41,540 --> 00:05:50,720 Convert this into into prettier and we can sell out musicals to this one. 59 00:05:51,050 --> 00:05:53,660 So we are advancing to the next element. 60 00:05:54,890 --> 00:06:03,110 Now, if we go and print this and here you can see we got the ten sessions, the real part, the hyper. 61 00:06:05,680 --> 00:06:12,310 We can pass this pointer to the Logitech Center to this function and let's say get logon session data 62 00:06:12,850 --> 00:06:17,650 to improve the information so we can easily read. 63 00:06:18,460 --> 00:06:26,890 So I how I define this one everything get organization data and the mem parameter is the pointer to 64 00:06:26,890 --> 00:06:27,780 this need. 65 00:06:30,510 --> 00:06:32,610 And the second barometer is output. 66 00:06:32,610 --> 00:06:36,270 That is a pointer to this executive session data. 67 00:06:36,510 --> 00:06:43,140 So if you go and check this one and here you can see this is the structure and all of its members. 68 00:06:43,350 --> 00:06:47,250 So this did not actually work for me. 69 00:06:47,250 --> 00:06:50,960 So I have to search for this in the work. 70 00:06:53,660 --> 00:06:56,000 And I just copy pasted this. 71 00:06:56,590 --> 00:06:59,600 And so this is this one. 72 00:07:04,910 --> 00:07:12,100 So we can see the members of this are the size of this structure. 73 00:07:12,100 --> 00:07:19,570 Log on to the username domain authentication, baggage log session and server DNS. 74 00:07:19,570 --> 00:07:27,040 No European user happens by name, so you can see all of these members. 75 00:07:29,990 --> 00:07:34,580 So we can just copy paste from the funeral. 76 00:07:36,790 --> 00:07:44,830 And before that, what we need to do is we need to begin to address a unique contracting rate so we 77 00:07:44,830 --> 00:07:46,180 go in search for this one. 78 00:07:48,780 --> 00:07:50,430 And here you can see the. 79 00:07:52,110 --> 00:07:54,230 Rent, the maximum rent and the buffer. 80 00:07:54,240 --> 00:07:57,060 So the pointer to the Unicode string. 81 00:07:58,530 --> 00:08:01,110 So we can also copy this one from. 82 00:08:02,280 --> 00:08:02,870 Being woke. 83 00:08:12,720 --> 00:08:12,930 It's. 84 00:08:15,370 --> 00:08:17,290 So I have already copied this one. 85 00:08:17,590 --> 00:08:19,150 And it a unicorn screen. 86 00:08:22,620 --> 00:08:23,280 And the rent. 87 00:08:23,280 --> 00:08:24,470 My rent and buffer. 88 00:08:24,480 --> 00:08:28,920 So this buffer is, uh, should be pointing to the unique should. 89 00:08:29,700 --> 00:08:31,440 So we write two functions. 90 00:08:32,870 --> 00:08:35,450 That is a breach party. 91 00:08:41,400 --> 00:08:44,430 Spring two and I say unicorn. 92 00:08:45,120 --> 00:08:51,300 So what this function does is it takes normal string as a parameter and convert this into this and let's 93 00:08:51,300 --> 00:08:51,800 say unicorn. 94 00:08:52,110 --> 00:08:54,100 So the return type is Al-Azhar University. 95 00:08:58,070 --> 00:08:59,030 Spring test. 96 00:08:59,310 --> 00:08:59,990 It's a test. 97 00:09:00,560 --> 00:09:06,080 And what we're going to do is we are going to allocate some memory for this test to function so we can 98 00:09:06,080 --> 00:09:08,540 look at using or not spring to. 99 00:09:11,170 --> 00:09:11,680 Uni. 100 00:09:19,620 --> 00:09:21,360 So this is global uni. 101 00:09:21,600 --> 00:09:25,110 So this copies the contents of manage bring. 102 00:09:25,530 --> 00:09:28,140 That is our second string in one manner. 103 00:09:30,870 --> 00:09:34,710 So this will return the pointer to this spring. 104 00:09:39,970 --> 00:09:43,420 So now we have the stringer here pointing to the screen. 105 00:09:43,840 --> 00:09:47,020 Now we need to make a necessary negotiating. 106 00:09:49,420 --> 00:09:55,780 We are going to create a new object for this structure and we are going to assign this. 107 00:09:57,010 --> 00:10:02,150 Not bother with his address to the unicorn, which is not. 108 00:10:03,220 --> 00:10:09,150 So here you can see this is pointing to the screen and we are sending to this buffer and let's you are 109 00:10:10,270 --> 00:10:20,020 then the end should be tested out then in two Unicode character things. 110 00:10:20,200 --> 00:10:26,320 So it is correct to say these two because it is UTF 16, 16 mean 16 bits. 111 00:10:26,620 --> 00:10:28,090 So that is two bytes. 112 00:10:31,290 --> 00:10:39,210 So that's why we are going to multiply with these characters and but ABC you shot. 113 00:10:50,620 --> 00:10:59,590 And the next one we need to set is maximum security, similar to this event, but we need to add one 114 00:10:59,590 --> 00:11:02,800 extra space for this one. 115 00:11:06,010 --> 00:11:07,270 So now we are good to go. 116 00:11:08,680 --> 00:11:09,940 We need to return this. 117 00:11:10,300 --> 00:11:12,760 See, that is the structure. 118 00:11:14,560 --> 00:11:14,870 No. 119 00:11:14,950 --> 00:11:15,200 Right. 120 00:11:16,720 --> 00:11:24,850 Another function that will take this and let's say Unicode structure as in parameter and gets the unique. 121 00:11:31,130 --> 00:11:32,420 So we can say strong. 122 00:11:33,540 --> 00:11:35,530 So let's say unique or. 123 00:11:37,750 --> 00:11:38,500 Boosting. 124 00:11:52,310 --> 00:11:52,640 No. 125 00:11:52,640 --> 00:11:56,180 Really two or actually this is the point today. 126 00:11:56,270 --> 00:12:07,010 So let's say you that buffer is a pointer so we can do that using Marshall Dot copy and we need to use 127 00:12:07,010 --> 00:12:07,490 this one. 128 00:12:07,700 --> 00:12:11,750 We can see the first one is the source and the second one is. 129 00:12:13,010 --> 00:12:14,480 The starting next and the length. 130 00:12:14,840 --> 00:12:16,700 So we need to create a character area. 131 00:12:17,510 --> 00:12:25,570 So test equal to new character area of the length of this edit that is defined. 132 00:12:25,630 --> 00:12:31,520 Whereas a maximum length and the copy of it is a buffer 133 00:12:33,950 --> 00:12:34,850 to. 134 00:12:37,850 --> 00:12:38,630 This test. 135 00:12:40,730 --> 00:12:43,160 And start index is zero and the rent is. 136 00:12:47,780 --> 00:12:51,770 Remember, we have multiplied this by Unicode and coding the characters. 137 00:12:52,460 --> 00:12:54,830 Now we need to divide with this one. 138 00:12:58,230 --> 00:12:59,370 Now we are going to work. 139 00:13:07,290 --> 00:13:08,150 Oh, no, we can. 140 00:13:08,700 --> 00:13:10,620 A new spring off test. 141 00:13:10,830 --> 00:13:13,050 So this will give you the spring. 142 00:13:13,860 --> 00:13:16,500 So we can test that using here. 143 00:13:16,500 --> 00:13:17,190 We can test. 144 00:13:18,030 --> 00:13:18,410 So. 145 00:13:24,750 --> 00:13:25,000 Spring. 146 00:13:25,190 --> 00:13:28,790 There is a unicorn that is being one, two, three. 147 00:13:44,840 --> 00:13:47,360 Now we can do this. 148 00:13:52,400 --> 00:13:55,290 And it is a unique string of and it is not buffered. 149 00:13:55,890 --> 00:13:57,180 So we can just say let's. 150 00:13:58,400 --> 00:14:01,560 Now, if you put into this and here you can see the unicorn. 151 00:14:03,920 --> 00:14:06,350 So you can comment on this one. 152 00:14:08,920 --> 00:14:09,280 Now. 153 00:14:09,280 --> 00:14:10,120 We are good to go. 154 00:14:12,680 --> 00:14:17,000 So I don't want to print out this low part and hope, but I can comment on this one. 155 00:14:18,560 --> 00:14:28,650 And now what I want to do is I want to send this, uh, lead pointer into this address to get realization 156 00:14:28,760 --> 00:14:29,110 better. 157 00:14:32,210 --> 00:14:35,180 The first parameter is read pointer. 158 00:14:38,170 --> 00:14:43,300 And the second one is also a pointer to this structure. 159 00:14:43,310 --> 00:14:51,490 So we can see this data in decision data and pointer, not zero. 160 00:14:53,410 --> 00:14:55,850 And we need to pass this as reference, as data. 161 00:15:10,020 --> 00:15:12,150 I dingo did not define this one. 162 00:15:33,200 --> 00:15:35,570 So first Ronnie's input. 163 00:15:36,020 --> 00:15:40,840 So in order to change these parameter names, it's just the parameter names. 164 00:15:40,850 --> 00:15:41,570 But anyway. 165 00:15:50,010 --> 00:15:53,460 So whenever you come back after some time, you'll still understand. 166 00:15:53,460 --> 00:15:54,090 We got do this. 167 00:15:55,290 --> 00:15:56,490 So I think we are good to go. 168 00:15:59,630 --> 00:16:00,000 Okay. 169 00:16:00,050 --> 00:16:08,540 Now we are getting we got the data for the asteroid pointer and then we need to convert this one shared 170 00:16:08,570 --> 00:16:15,230 our pointer to structure the point of use as data and the structure is type of. 171 00:16:17,840 --> 00:16:19,360 Security light session data. 172 00:16:19,890 --> 00:16:20,930 Sacagawea, this one. 173 00:16:31,560 --> 00:16:32,670 We can say yes. 174 00:16:42,000 --> 00:16:44,100 Now we can print out this one. 175 00:16:44,100 --> 00:16:44,490 Yes. 176 00:16:44,490 --> 00:16:51,090 Dot, uh, username and then gyro. 177 00:16:53,870 --> 00:17:00,910 Then I'm going to print the and it is a unique string of this username. 178 00:17:01,130 --> 00:17:03,660 So this is that username is the. 179 00:17:05,300 --> 00:17:07,580 And it has a unique string structure. 180 00:17:07,580 --> 00:17:10,810 And we are going to pass the strings function to get the unique to. 181 00:17:13,580 --> 00:17:16,280 Now we need to free this pointer. 182 00:17:16,940 --> 00:17:17,630 So this. 183 00:17:19,910 --> 00:17:20,690 Yes, data. 184 00:17:43,650 --> 00:17:45,600 So we got some mail. 185 00:17:49,280 --> 00:17:50,420 Argument bias. 186 00:17:50,750 --> 00:17:57,650 So what we can do is use this one is equal to zero. 187 00:17:58,100 --> 00:18:00,590 Then I'm going to put in. 188 00:18:05,290 --> 00:18:09,690 So we can see we got the two sessions and the username are stargirl. 189 00:18:10,360 --> 00:18:12,010 That is my this username. 190 00:18:16,200 --> 00:18:23,460 Or we can also printer Daria start blogging domain. 191 00:18:30,960 --> 00:18:35,970 So meanwhile, let me turn on this domain controller. 192 00:18:46,300 --> 00:18:51,670 So let's run this and we should see the username and the computer name. 193 00:18:52,810 --> 00:18:59,020 So we got only two sessions out of ten sessions because of the access denied? 194 00:18:59,590 --> 00:19:00,160 No. 195 00:19:02,670 --> 00:19:06,120 If we go and open this government, prompting the nation to. 196 00:19:17,740 --> 00:19:18,970 Now we're going into it. 197 00:19:19,360 --> 00:19:21,940 What are the ten sessions? 198 00:19:59,100 --> 00:19:59,640 So let's. 199 00:19:59,640 --> 00:20:00,390 Where this? 200 00:20:13,000 --> 00:20:16,070 But it's going to run this under the wing. 201 00:20:16,130 --> 00:20:16,630 Under. 202 00:20:44,970 --> 00:20:48,750 And now we can see all of these sessions. 203 00:20:49,200 --> 00:20:54,270 We have the anonymous organ and also the administrator. 204 00:20:56,640 --> 00:20:57,690 Now let's go. 205 00:20:57,690 --> 00:21:04,320 And, uh, Rand seemed to user. 206 00:21:12,440 --> 00:21:12,650 Now. 207 00:21:12,650 --> 00:21:16,130 We can see now has been logged on to the console. 208 00:21:16,370 --> 00:21:17,390 If you ran this again. 209 00:21:18,050 --> 00:21:20,600 And we should see push two somewhere here. 210 00:21:20,720 --> 00:21:25,760 So as to how we can also put into the log on account. 211 00:21:31,850 --> 00:21:34,130 So we can put in the end. 212 00:21:38,150 --> 00:21:38,480 Count. 213 00:21:51,040 --> 00:22:00,280 We have the 14 Rowland Sessions, which includes our test to see what caused this and we got on it. 214 00:22:01,570 --> 00:22:10,030 So that's how you use the these LSC functions filter through the log on sessions and the user information.