1 00:00:01,230 --> 00:00:02,063 ‫-: Hi! 2 00:00:02,063 --> 00:00:03,150 ‫Within this lecture 3 00:00:03,150 --> 00:00:07,350 ‫we are going to see a very good feature of the Virtual Box 4 00:00:07,350 --> 00:00:09,900 ‫which is called snapshots. 5 00:00:09,900 --> 00:00:12,360 ‫So we're going to see how to use snapshots 6 00:00:12,360 --> 00:00:14,340 ‫and what are snapshots in general 7 00:00:14,340 --> 00:00:18,480 ‫and how to leverage them when we use virtual machines. 8 00:00:18,480 --> 00:00:22,710 ‫So, snapshots are just like safe points in games. 9 00:00:22,710 --> 00:00:27,330 ‫So if you are in a state that you want to save it 10 00:00:27,330 --> 00:00:31,500 ‫or if you are in a state that you are very comfortable with 11 00:00:31,500 --> 00:00:35,370 ‫then, we are going to have a checkpoint over there. 12 00:00:35,370 --> 00:00:37,440 ‫Then after that, if we mess it up 13 00:00:37,440 --> 00:00:40,290 ‫or if we crash it or if we hack something 14 00:00:40,290 --> 00:00:42,090 ‫or if we broke something. 15 00:00:42,090 --> 00:00:47,090 ‫We can always go back to that save point, that checkpoint. 16 00:00:47,490 --> 00:00:48,720 ‫In order to do that, 17 00:00:48,720 --> 00:00:51,960 ‫you have to click on this little rectangle over here 18 00:00:51,960 --> 00:00:54,270 ‫and say snapshots. 19 00:00:54,270 --> 00:00:57,480 ‫So as you can see now we have the snapshots 20 00:00:57,480 --> 00:01:00,180 ‫and I can just say take. 21 00:01:00,180 --> 00:01:02,670 ‫So when I click on this button 22 00:01:02,670 --> 00:01:05,440 ‫it will take the current snapshots 23 00:01:06,309 --> 00:01:09,270 ‫and I can change the state whenever 24 00:01:09,270 --> 00:01:12,240 ‫and wherever I want, right? 25 00:01:12,240 --> 00:01:15,420 ‫So if I take a snapshot right now 26 00:01:15,420 --> 00:01:19,470 ‫it will just take the current state of the Kali Linux. 27 00:01:19,470 --> 00:01:24,470 ‫But, just don't confuse it with saving and closing it down. 28 00:01:25,290 --> 00:01:26,880 ‫I'm going to show you what I mean. 29 00:01:26,880 --> 00:01:29,220 ‫I'm just going to run this in a headless way 30 00:01:29,220 --> 00:01:33,630 ‫because the irregular way causes me some kind of bug. 31 00:01:33,630 --> 00:01:38,040 ‫If I minimize the window, it will just crash itself. 32 00:01:38,040 --> 00:01:39,450 ‫So it can happen. 33 00:01:39,450 --> 00:01:43,140 ‫I'm just going to run this with headless start. 34 00:01:43,140 --> 00:01:47,400 ‫It isn't something big, so it's kind of a bug. 35 00:01:47,400 --> 00:01:49,770 ‫I'm happy with it, okay. 36 00:01:49,770 --> 00:01:51,600 ‫And I'm going to say show 37 00:01:51,600 --> 00:01:54,870 ‫so that I can go to my Kali Linux. 38 00:01:54,870 --> 00:01:57,390 ‫And remember, the username is root 39 00:01:57,390 --> 00:01:59,880 ‫and the password is t o o r. 40 00:01:59,880 --> 00:02:01,230 ‫Okay! 41 00:02:01,230 --> 00:02:03,090 ‫And I'm in. 42 00:02:03,090 --> 00:02:05,550 ‫So if I do any change 43 00:02:05,550 --> 00:02:08,610 ‫if I make any change in the Kali Linux like 44 00:02:08,610 --> 00:02:12,750 ‫if I create a file or if I create a folder. 45 00:02:12,750 --> 00:02:15,420 ‫Then, when I close it down 46 00:02:15,420 --> 00:02:17,820 ‫it will save the state, okay? 47 00:02:17,820 --> 00:02:21,690 ‫It won't be fresh every time I open Kali Linux. 48 00:02:21,690 --> 00:02:25,560 ‫So just double click on this file manager over here 49 00:02:25,560 --> 00:02:27,090 ‫like file system. 50 00:02:27,090 --> 00:02:31,710 ‫So you will see the folders and files inside of Kali Linux. 51 00:02:31,710 --> 00:02:34,230 ‫If you cannot see file system 52 00:02:34,230 --> 00:02:36,450 ‫you can just click over here 53 00:02:36,450 --> 00:02:40,680 ‫and type something like file system, okay? 54 00:02:40,680 --> 00:02:42,910 ‫Like this, file system 55 00:02:43,920 --> 00:02:46,950 ‫and you will see the file manager 56 00:02:46,950 --> 00:02:51,360 ‫of which you can just click on and open it, okay? 57 00:02:51,360 --> 00:02:56,340 ‫And you can of course write something like file manager 58 00:02:56,340 --> 00:02:59,850 ‫in order to narrow it down as well. 59 00:02:59,850 --> 00:03:02,970 ‫So if you see the file system on your desktop 60 00:03:02,970 --> 00:03:04,410 ‫you don't need to do that. 61 00:03:04,410 --> 00:03:06,630 ‫And by accident, I believe 62 00:03:06,630 --> 00:03:09,720 ‫I have clicked on the properties of file system. 63 00:03:09,720 --> 00:03:12,720 ‫I'm going to say file manager 64 00:03:12,720 --> 00:03:14,250 ‫like file system. 65 00:03:14,250 --> 00:03:16,590 ‫And let me click on this one more time. 66 00:03:16,590 --> 00:03:17,820 ‫Here you go. 67 00:03:17,820 --> 00:03:20,250 ‫Now I see the file manager 68 00:03:20,250 --> 00:03:22,020 ‫and once you open it 69 00:03:22,020 --> 00:03:25,890 ‫as I said before, you will see the folders and files. 70 00:03:25,890 --> 00:03:27,840 ‫So if you click on the root 71 00:03:27,840 --> 00:03:31,320 ‫you can just go into documents or downloads or desktop 72 00:03:31,320 --> 00:03:32,820 ‫and everything. 73 00:03:32,820 --> 00:03:36,990 ‫So right click over here and say create folder. 74 00:03:36,990 --> 00:03:40,830 ‫For example I'm going to create something called test folder 75 00:03:40,830 --> 00:03:44,010 ‫inside of documents. Okay? 76 00:03:44,010 --> 00:03:44,940 ‫So that's it. 77 00:03:44,940 --> 00:03:48,330 ‫That's all what I wanna do. Okay? 78 00:03:48,330 --> 00:03:52,770 ‫But, what happens if I close the Kali down 79 00:03:52,770 --> 00:03:54,690 ‫and restart it? 80 00:03:54,690 --> 00:03:56,970 ‫So let me close this down. 81 00:03:56,970 --> 00:03:58,890 ‫I'm going to get this air. 82 00:03:58,890 --> 00:04:01,020 ‫I'm going to say okay. 83 00:04:01,020 --> 00:04:02,220 ‫And, 84 00:04:02,220 --> 00:04:03,780 ‫here I'm done. 85 00:04:03,780 --> 00:04:05,670 ‫Okay, I finished my work. 86 00:04:05,670 --> 00:04:08,820 ‫I closed it down, closed it down 87 00:04:08,820 --> 00:04:10,890 ‫and now I'm back. 88 00:04:10,890 --> 00:04:15,060 ‫I'm back for work and I'm going to open my Kali Linux. 89 00:04:15,060 --> 00:04:19,050 ‫So I didn't take any snapshot or anything, right? 90 00:04:19,050 --> 00:04:20,790 ‫But it saved itself. 91 00:04:20,790 --> 00:04:24,090 ‫So what happens when I go to the documents right now 92 00:04:24,090 --> 00:04:27,330 ‫will I see the test folder? 93 00:04:27,330 --> 00:04:28,650 ‫Of course. 94 00:04:28,650 --> 00:04:31,470 ‫Otherwise it will be a fresh Kali Linux 95 00:04:31,470 --> 00:04:33,826 ‫every time I open it. 96 00:04:33,826 --> 00:04:35,880 ‫It won't make sense. 97 00:04:35,880 --> 00:04:38,370 ‫So let me log in one more time 98 00:04:38,370 --> 00:04:42,183 ‫and you are going to see the test folder is over there. 99 00:04:43,140 --> 00:04:44,730 ‫That I'm going to show you 100 00:04:44,730 --> 00:04:46,980 ‫what you can do with snapshots as well. 101 00:04:46,980 --> 00:04:51,300 ‫Don't worry, I'm just going to show this works. 102 00:04:51,300 --> 00:04:55,710 ‫In order not to make you confused about saving the state. 103 00:04:55,710 --> 00:04:57,270 ‫So as you can see 104 00:04:57,270 --> 00:05:01,320 ‫without snapshots and everything, it's working fine. 105 00:05:01,320 --> 00:05:03,780 ‫I can just create whatever I want to create. 106 00:05:03,780 --> 00:05:07,290 ‫I can just put whatever I wanna put over here 107 00:05:07,290 --> 00:05:11,670 ‫and close it down and open it up anytime I want. 108 00:05:11,670 --> 00:05:14,100 ‫But let me take a screenshot. 109 00:05:14,100 --> 00:05:16,713 ‫Snapshots right now, not screenshots. 110 00:05:17,670 --> 00:05:21,120 ‫So I believe we have some kind of bug over here. 111 00:05:21,120 --> 00:05:23,130 ‫Let me just minimize this. 112 00:05:23,130 --> 00:05:24,510 ‫Yep, here you go. 113 00:05:24,510 --> 00:05:27,510 ‫Now I will, I will just click on this take 114 00:05:27,510 --> 00:05:31,440 ‫and I can give whatever snapshot name I want. 115 00:05:31,440 --> 00:05:34,710 ‫So it's auto completed it for me 116 00:05:34,710 --> 00:05:37,080 ‫and it said that snapshot one 117 00:05:37,080 --> 00:05:38,940 ‫so I'm fine with that name. 118 00:05:38,940 --> 00:05:43,680 ‫And as you can see, my snapshot one is actually saved 119 00:05:43,680 --> 00:05:45,810 ‫in the virtual box. 120 00:05:45,810 --> 00:05:48,030 ‫So this is the last state 121 00:05:48,030 --> 00:05:51,000 ‫that I have closed the Kali Linux down. 122 00:05:51,000 --> 00:05:51,960 ‫Okay, 123 00:05:51,960 --> 00:05:55,920 ‫So if I run the Kali Linux right now from here 124 00:05:55,920 --> 00:06:00,030 ‫like a regular way, like a regular headless start way. 125 00:06:00,030 --> 00:06:02,610 ‫If I open the Kali Linux right now 126 00:06:02,610 --> 00:06:05,400 ‫everything will seem perfectly okay. 127 00:06:05,400 --> 00:06:08,730 ‫I will see the test, one more time in documents. 128 00:06:08,730 --> 00:06:13,730 ‫If I go over there, everything is where we have left off. 129 00:06:14,610 --> 00:06:17,550 ‫So this is no biggie as well. 130 00:06:17,550 --> 00:06:20,730 ‫So we haven't done anything special yet 131 00:06:20,730 --> 00:06:24,780 ‫but this special thing will become, will arise 132 00:06:24,780 --> 00:06:28,410 ‫when I create another folder over here. 133 00:06:28,410 --> 00:06:31,050 ‫So let me come over here 134 00:06:31,050 --> 00:06:35,460 ‫and let me wait for my desktop icons to appear. 135 00:06:35,460 --> 00:06:38,520 ‫I'm going to double click on this file system. 136 00:06:38,520 --> 00:06:42,000 ‫I'm going to go into the documents like from here 137 00:06:42,000 --> 00:06:44,490 ‫like from root and documents. 138 00:06:44,490 --> 00:06:45,990 ‫Now I see the test 139 00:06:45,990 --> 00:06:49,770 ‫but this time I'm going to create something called test two. 140 00:06:49,770 --> 00:06:52,620 ‫So I'm going to hit create. 141 00:06:52,620 --> 00:06:55,380 ‫And now I have two folders. 142 00:06:55,380 --> 00:06:57,030 ‫So let me close this down. 143 00:06:57,030 --> 00:06:59,520 ‫So this is kind of getting boring, right? 144 00:06:59,520 --> 00:07:01,590 ‫So I'm creating folders 145 00:07:01,590 --> 00:07:03,900 ‫closing it down or putting it again. 146 00:07:03,900 --> 00:07:06,450 ‫But this is the perfect way to understand 147 00:07:06,450 --> 00:07:09,060 ‫what's it snapshots do. 148 00:07:09,060 --> 00:07:11,970 ‫So here now I have the snapshot one 149 00:07:11,970 --> 00:07:14,490 ‫but I have also this current state 150 00:07:14,490 --> 00:07:17,580 ‫and says that it has been changed 151 00:07:17,580 --> 00:07:21,510 ‫since you have taken the last snapshot. 152 00:07:21,510 --> 00:07:26,160 ‫So I'm going to take another snapshot called snapshot two. 153 00:07:26,160 --> 00:07:28,200 ‫Now in the snapshot one 154 00:07:28,200 --> 00:07:31,170 ‫I don't have test two folder. 155 00:07:31,170 --> 00:07:32,790 ‫But in the snapshot two, 156 00:07:32,790 --> 00:07:36,330 ‫I have the test two folder. 157 00:07:36,330 --> 00:07:39,240 ‫So for, for a reason suppose 158 00:07:39,240 --> 00:07:42,930 ‫that test two broke my system, okay? 159 00:07:42,930 --> 00:07:45,720 ‫I'm not very satisfied with test two. 160 00:07:45,720 --> 00:07:48,090 ‫I want to go back 161 00:07:48,090 --> 00:07:50,040 ‫and how can I do that? 162 00:07:50,040 --> 00:07:52,980 ‫Fortunately, I have the snapshot 163 00:07:52,980 --> 00:07:56,580 ‫and I can just restart the snapshot 164 00:07:56,580 --> 00:07:59,460 ‫whenever or wherever I want. 165 00:07:59,460 --> 00:08:03,300 ‫So if I say restore after clicking on the snapshot. 166 00:08:03,300 --> 00:08:06,150 ‫It'll restore the snapshot. 167 00:08:06,150 --> 00:08:07,110 ‫And here you go. 168 00:08:07,110 --> 00:08:09,960 ‫Now my current snapshot is here. 169 00:08:09,960 --> 00:08:12,900 ‫My current snapshot is snapshot one. 170 00:08:12,900 --> 00:08:16,530 ‫Now what will happen when I run this? 171 00:08:16,530 --> 00:08:18,450 ‫What do you think will happen 172 00:08:18,450 --> 00:08:20,913 ‫when I go to the documents folder? 173 00:08:20,913 --> 00:08:22,740 ‫Will I see test one? 174 00:08:22,740 --> 00:08:24,210 ‫Of course. 175 00:08:24,210 --> 00:08:26,730 ‫Will I see test two? 176 00:08:26,730 --> 00:08:31,350 ‫Nope, because test two wasn't even over there 177 00:08:31,350 --> 00:08:35,250 ‫when I had taken the snapshot one. 178 00:08:35,250 --> 00:08:36,600 ‫Right? 179 00:08:36,600 --> 00:08:40,353 ‫So let's test this and see if it works. 180 00:08:41,250 --> 00:08:44,040 ‫And this is very useful because 181 00:08:44,040 --> 00:08:47,250 ‫we are doing some kind of ethical hacking stuff, okay? 182 00:08:47,250 --> 00:08:49,920 ‫We are going to work with a lot of repositories 183 00:08:49,920 --> 00:08:53,010 ‫a lot of libraries, a lot of tools. 184 00:08:53,010 --> 00:08:54,900 ‫Something may go wrong. 185 00:08:54,900 --> 00:08:58,530 ‫And something will be broken at some point. 186 00:08:58,530 --> 00:09:03,530 ‫So take this seriously and try to take snapshots regularly. 187 00:09:04,290 --> 00:09:06,690 ‫Like maybe once a week or something 188 00:09:06,690 --> 00:09:11,040 ‫so that you can go back when you need it, okay. 189 00:09:11,040 --> 00:09:15,420 ‫So let me go to root and documents one more time. 190 00:09:15,420 --> 00:09:17,160 ‫Here you go. 191 00:09:17,160 --> 00:09:20,730 ‫And, as you can see I don't have test two folders 192 00:09:20,730 --> 00:09:24,510 ‫so this is working just fine. 193 00:09:24,510 --> 00:09:28,530 ‫So if I want to go back to snapshot two right now 194 00:09:28,530 --> 00:09:30,060 ‫I can do that as well. 195 00:09:30,060 --> 00:09:32,280 ‫I can just go to Virtual Box 196 00:09:32,280 --> 00:09:35,220 ‫and click on Restore on the snapshot two. 197 00:09:35,220 --> 00:09:38,910 ‫It will just bring me forward in time 198 00:09:38,910 --> 00:09:42,270 ‫and I can just revert back anytime I want. 199 00:09:42,270 --> 00:09:45,240 ‫So this is the power of the snapshots. 200 00:09:45,240 --> 00:09:46,770 ‫So we are gonna stop here 201 00:09:46,770 --> 00:09:48,420 ‫and we're going to continue 202 00:09:48,420 --> 00:09:51,930 ‫with the usage of Kali Linux and Linux in general 203 00:09:51,930 --> 00:09:53,793 ‫in the next section.