Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,530 --> 00:00:05,850
In this section we're going to be looking at archiving and compassion.
2
00:00:06,050 --> 00:00:08,570
The difference between archiving and compression.
3
00:00:08,570 --> 00:00:12,500
So the objectives here are to understand the difference between these two.
4
00:00:12,560 --> 00:00:17,090
And to learn how to archive compress and decompress files and folders.
5
00:00:17,390 --> 00:00:23,870
Let me start by explaining the difference between the two terms archiving and compression I think started
6
00:00:23,990 --> 00:00:27,060
a while back in the early days of Unix.
7
00:00:28,110 --> 00:00:34,740
System administrators used to back up files and folders and put them on tapes.
8
00:00:34,740 --> 00:00:39,560
These tapes will be stored away just in case the backup was needed at any point in time.
9
00:00:39,600 --> 00:00:44,460
Say for example there was a system lost some files get lost or corrupted.
10
00:00:44,460 --> 00:00:49,640
They would bring back the tape and would restore the files and folders that are needed.
11
00:00:49,860 --> 00:00:53,130
Obviously that applies to a lot more than just files and folders.
12
00:00:53,130 --> 00:00:56,100
So we're talking about databases for example.
13
00:00:56,430 --> 00:01:03,480
But let's not complicate things too much so archiving in essence was only about taking a back up of
14
00:01:03,480 --> 00:01:06,330
the files and folders that we were interested in.
15
00:01:06,330 --> 00:01:12,570
However what would happen is that these files and folders would be copied to that tape and they would
16
00:01:12,570 --> 00:01:18,030
still be the same file size and the same for their size as they were originally on the system.
17
00:01:18,090 --> 00:01:24,050
So let's say for example I'm backing up my documents and My Documents are 20 megs in size.
18
00:01:24,060 --> 00:01:30,360
For example if I back them up on a tape or I archive them on the tape they would still be the exact
19
00:01:30,360 --> 00:01:33,650
same size 20 megs compression.
20
00:01:33,660 --> 00:01:41,870
However as the name implies would compress the flaws in a way that they would take up less space.
21
00:01:41,960 --> 00:01:47,940
So if I compress my documents they might end up for example being 15 makes instead of 20.
22
00:01:48,170 --> 00:01:55,370
And that way they will take less space on my archive tapes and that would end up saving me money because
23
00:01:55,370 --> 00:01:57,650
I wouldn't have to be buying more tapes.
24
00:01:57,650 --> 00:02:00,960
I would be saving space on tapes and thus I'd be saving money.
25
00:02:01,130 --> 00:02:05,570
And this is why it's very often that you're going to be seeing these technologies or these two commands
26
00:02:05,870 --> 00:02:07,740
being used in conjunction.
27
00:02:07,850 --> 00:02:13,660
It's rare that you see archiving being used without compression.
28
00:02:13,880 --> 00:02:18,050
So that was the original purpose of archiving and compression.
29
00:02:18,050 --> 00:02:21,100
However on top of that an ethical hacking.
30
00:02:21,110 --> 00:02:24,270
We use it for slightly different purposes as well.
31
00:02:24,470 --> 00:02:29,080
Here's the post exploitation tip for the section after the compromise a host.
32
00:02:29,180 --> 00:02:34,950
It's very often that you will be needing to upload and download files if you remember the section on
33
00:02:34,950 --> 00:02:36,570
package management.
34
00:02:36,840 --> 00:02:39,730
I told you that Nessus is not installed by default on kalee.
35
00:02:39,900 --> 00:02:44,100
As a matter of fact it's not installed by default on almost all Linux systems.
36
00:02:44,430 --> 00:02:48,990
So let's say for example you come across a Linux system that you managed to break into your compromise
37
00:02:49,560 --> 00:02:58,530
and you want to use it as a stepping stone C can scan another network using Nazis or unmap but unfortunately
38
00:02:58,530 --> 00:03:05,940
these tools on are found on that system where you need to do in that case is get that tool and uploaded
39
00:03:05,960 --> 00:03:08,060
on the compromised system.
40
00:03:08,060 --> 00:03:12,900
Assuming for example that that system doesn't have internet connectivity which could be the case.
41
00:03:12,950 --> 00:03:18,200
And some of corporate environments we discuss that's been argued before and I told you earlier and the
42
00:03:18,200 --> 00:03:23,750
package management section that they were hearing back then about how we upload and download files that's
43
00:03:23,750 --> 00:03:28,160
going to be for a different chapter in the course now we get to that.
44
00:03:28,310 --> 00:03:34,520
So you will come across interviews where you would have to upload or download files or folders or tools
45
00:03:34,630 --> 00:03:41,430
a compromise system and other scenario for example as you compromisers system but you don't have root
46
00:03:41,460 --> 00:03:44,140
access you compromises as a regular user.
47
00:03:44,370 --> 00:03:49,650
You will need to upload a privilege escalation exploit that will be an exploit that if you run will
48
00:03:49,650 --> 00:03:51,370
give you root access.
49
00:03:51,480 --> 00:03:57,770
You might also as an ethical hacker or as a penetration doesn't have to upload or download profiles.
50
00:03:58,020 --> 00:04:02,010
So that would be as an ideal for example that you would be assigned to target and as a proof you need
51
00:04:02,010 --> 00:04:06,400
to break into that target and create textfiles saying that you were there.
52
00:04:07,550 --> 00:04:10,200
So the scenarios are endless really.
53
00:04:10,410 --> 00:04:16,530
But what's really sure and certain is that you will definitely be in situations where you will have
54
00:04:16,530 --> 00:04:21,810
to upload or download faster systems that are not connected to the internet so you cannot just browse
55
00:04:21,810 --> 00:04:25,920
to anyone that you want and download files on that system.
56
00:04:26,110 --> 00:04:29,410
You're going to have to do that using your colonics.
57
00:04:30,210 --> 00:04:37,200
Usually the first option we go to if it's available as the SS H is pretty convenient it allows you to
58
00:04:37,200 --> 00:04:38,350
log in remotely.
59
00:04:38,370 --> 00:04:43,370
You can use it to upload files download files and do pretty much anything that you want.
60
00:04:43,380 --> 00:04:51,110
The second option if S-sh is not available as a DTP So here I'm talking about turning your Linux box
61
00:04:51,530 --> 00:04:53,280
into a web server.
62
00:04:54,900 --> 00:04:58,310
Now there are many other ways that we discuss in advanced courses.
63
00:04:58,350 --> 00:05:03,870
So for example if it's a Windows system you can take advantage of a script and polish if it's other
64
00:05:03,940 --> 00:05:10,730
of systems how he can take advantage of TFT or FTB and so on.
65
00:05:10,760 --> 00:05:16,770
Needless to say after I talked about oh that uploading one file at a time or downloading one file at
66
00:05:16,790 --> 00:05:19,330
time is going to be a big hassle.
67
00:05:19,670 --> 00:05:22,880
And this is what archiving and compression comes in handy.
68
00:05:23,300 --> 00:05:29,780
So let's look at the archiving tool and the next archiving tool is called Tott which is short actually
69
00:05:29,780 --> 00:05:33,430
for tape archive to create an archive.
70
00:05:33,470 --> 00:05:38,500
You use tie see 48 to append an archive.
71
00:05:38,600 --> 00:05:43,270
In other words to add files or for others to you archive that's already been created.
72
00:05:43,360 --> 00:05:44,550
Use the option.
73
00:05:44,560 --> 00:05:50,180
So tired or to list the contents of an archive without extracting it.
74
00:05:50,180 --> 00:05:51,790
You just want to see what's in it.
75
00:05:51,830 --> 00:05:57,810
You use tot T taught X is to extract the archive.
76
00:05:57,860 --> 00:05:59,820
V is for verbose.
77
00:05:59,830 --> 00:06:03,720
It gives you information on the progress on what's going on top.
78
00:06:03,740 --> 00:06:07,810
F is used to specify the name of the file that you want.
79
00:06:07,970 --> 00:06:16,490
If we want to compress our archive we use one of two tools usually either a zip or zip to Jesus is the
80
00:06:16,490 --> 00:06:23,430
classic compression and Linux BS that too has more powerful compression but it takes a little bit more
81
00:06:23,430 --> 00:06:25,500
time to compress.
82
00:06:25,500 --> 00:06:28,020
Now frankly speaking the difference is negligible.
83
00:06:28,020 --> 00:06:32,510
You wouldn't really notice any difference if you're working on small files.
84
00:06:32,610 --> 00:06:36,440
You might notice a small difference if you walk in on far as of massive size.
85
00:06:36,570 --> 00:06:39,900
But for our purpose the difference really is negligible.
86
00:06:39,930 --> 00:06:45,810
So as you experiment more with Linux you will come across websites where you can download tools to play
87
00:06:45,810 --> 00:06:51,720
around with and it's very often that you're going to find these tools compressed and archived and Jees
88
00:06:51,770 --> 00:06:54,450
that format always a format.
89
00:06:54,450 --> 00:07:00,680
Here are some examples that we're going to be using practically in a moment to create an archive.
90
00:07:00,690 --> 00:07:08,660
You use the Taurasi like we said C is for create V is for verbose and F is for the filename.
91
00:07:08,670 --> 00:07:15,480
So in this example I'm doing taht c v f the archive name whatever I choose to name it.
92
00:07:15,480 --> 00:07:21,000
So in this instance calling it archive have taught and the files and directories that I want to archive
93
00:07:21,270 --> 00:07:26,150
file one file to deal one and the two.
94
00:07:26,170 --> 00:07:31,660
Now if you notice I change the colors of the first letters and this is just for you to be able to easily
95
00:07:31,660 --> 00:07:37,230
spot the difference between archiving and compression and the different options that we're using.
96
00:07:37,240 --> 00:07:41,470
You might also have noticed that I'm not using the minus here.
97
00:07:41,520 --> 00:07:43,440
We've seen that one is being used all the time.
98
00:07:43,440 --> 00:07:50,580
For example when using ls I'm using ls minus a L when I'm using or am I'm using odd minus odd F for
99
00:07:50,620 --> 00:07:51,600
the options.
100
00:07:51,610 --> 00:07:56,490
Torah is one of the very few tools that I don't have to use the minus one I'm using an option.
101
00:07:56,820 --> 00:07:59,570
So carrying on to list the contents of an archive.
102
00:07:59,580 --> 00:08:05,040
We said it's taught T and Vitthal verbose and F as the filename.
103
00:08:05,400 --> 00:08:08,460
So notice that it's pretty much all constant.
104
00:08:08,460 --> 00:08:11,180
The only thing changing is the first letter.
105
00:08:11,580 --> 00:08:15,730
If I want to bend or add a file or directory it's Todd R..
106
00:08:16,170 --> 00:08:21,480
That's the only thing that's changing via's still constant f still canceling the filename is constant
107
00:08:21,960 --> 00:08:26,930
and whatever I'm adding at the end let's see how that looks like practically.
108
00:08:27,210 --> 00:08:30,780
I've created three different directories and three different files.
109
00:08:30,840 --> 00:08:33,900
Some like to start by creating the archive to do that.
110
00:08:33,900 --> 00:08:42,020
I want to use that thought see create V for verbose and F for the file name and this case my filename
111
00:08:42,150 --> 00:08:43,070
is archived.
112
00:08:43,120 --> 00:08:54,950
Todd and whatever I want to archive did one dir to find one and file to because I've used the V option
113
00:08:54,950 --> 00:08:56,320
which is for verbose.
114
00:08:56,480 --> 00:08:59,160
I get a list of what's been archived.
115
00:08:59,180 --> 00:09:05,710
I notice that automatically did one and it's subdirectory and the two and add subdirectory archived.
116
00:09:05,870 --> 00:09:09,830
Now let me list the content of the archive just to verify what I have.
117
00:09:10,340 --> 00:09:16,530
And for that I use the tired t to list and then the remaining is still the same.
118
00:09:16,610 --> 00:09:20,510
The F and the Archive name perfect.
119
00:09:20,510 --> 00:09:22,730
Now let's say I want to append my archive.
120
00:09:22,790 --> 00:09:27,010
I forgot to add D.S. 3 and 5 3 append to my archive.
121
00:09:27,020 --> 00:09:31,890
I use the auto option so taught by V.F. is still the same.
122
00:09:31,930 --> 00:09:39,590
Like I have is still the same and whatever I want to add to my archive years 3 and 5 3 I will verify
123
00:09:39,590 --> 00:09:41,540
that again using that thought.
124
00:09:41,570 --> 00:09:44,210
T the F and the Archive name.
125
00:09:44,210 --> 00:09:45,830
And here we go.
126
00:09:45,830 --> 00:09:49,840
Now I have all the contents of my directory in the archive.
127
00:09:49,850 --> 00:09:51,850
Let me keep it on the screen.
128
00:09:52,880 --> 00:10:03,650
I'm going to create a directory called backup and copy my archive file into the backup directory.
129
00:10:03,650 --> 00:10:09,310
Now I'm going to navigate to the backup directory and all I have in that directory is just the file
130
00:10:09,340 --> 00:10:10,650
or the archive file.
131
00:10:11,040 --> 00:10:14,640
And I'm going to show you now how to extract files and folders.
132
00:10:14,680 --> 00:10:19,690
First of all let's say I want to extract only one file or only one folder.
133
00:10:19,870 --> 00:10:22,050
I don't want to extract the entire archive.
134
00:10:23,700 --> 00:10:25,460
I would still use the same command.
135
00:10:25,620 --> 00:10:28,300
Tor X for extract.
136
00:10:28,410 --> 00:10:35,640
The F which is still the same verbose filename the filename on the top and whatever I want to extract.
137
00:10:35,640 --> 00:10:41,610
In this case 5:3 if I do an s or see that file 3 is not extracted.
138
00:10:41,610 --> 00:10:44,060
Let me try that again with dier 3
139
00:10:48,580 --> 00:10:52,610
if I do as I have the three extracted as well.
140
00:10:52,760 --> 00:10:53,300
Excellent.
141
00:10:53,300 --> 00:10:58,430
So you don't actually have to extract everything you can pick and choose whatever you want to extract
142
00:10:59,090 --> 00:11:01,370
if I want to extract everything I say.
143
00:11:01,370 --> 00:11:05,770
Todd x4 extract V.F. and the archive name.
144
00:11:05,900 --> 00:11:06,790
And here we go.
145
00:11:06,920 --> 00:11:09,110
Extract everything.
146
00:11:09,110 --> 00:11:12,730
I'll clear the screen and I'm going to go back to the temp directory.
147
00:11:12,740 --> 00:11:17,810
Let me show you what's on my desktop doing unless home desktop.
148
00:11:17,860 --> 00:11:24,210
There's nothing that it's empty so let's say I'm now in my time that actually and I want to extract
149
00:11:24,210 --> 00:11:26,060
my archive but I want to do that.
150
00:11:26,100 --> 00:11:29,320
I wanted to extract that files to be on the desktop.
151
00:11:29,400 --> 00:11:32,280
I don't want them to be in the time that actually do that.
152
00:11:32,280 --> 00:11:38,760
I can specify the data to do what I want to extract using minus capital C option.
153
00:11:39,390 --> 00:11:40,980
So the command is tied.
154
00:11:41,060 --> 00:11:50,820
SDF archive name minus capital C and the destination directory.
155
00:11:50,830 --> 00:11:54,460
So now everything that I extracted on my desktop.
156
00:11:54,460 --> 00:12:02,680
Now let's say I want to archive and compress the files I'm going to start with the GC files to create
157
00:12:02,680 --> 00:12:03,280
those.
158
00:12:03,400 --> 00:12:03,790
I do.
159
00:12:03,800 --> 00:12:12,400
Todd z and z will be always used when we're dealing with the GC files or is that if you are British
160
00:12:13,450 --> 00:12:15,430
and the rest is going to be the same.
161
00:12:15,430 --> 00:12:18,960
So that's the way to memorize these commands easily.
162
00:12:19,110 --> 00:12:20,760
And this is what it looks like.
163
00:12:21,390 --> 00:12:23,500
Todd Z.
164
00:12:23,520 --> 00:12:28,780
C v f compressed dot dot dot.
165
00:12:28,860 --> 00:12:30,770
GZ and the files.
166
00:12:30,770 --> 00:12:31,940
I want to archive
167
00:12:37,430 --> 00:12:42,190
if I want to use visit to instead of Z.
168
00:12:42,300 --> 00:12:52,650
I use J and said exactly the same for the rest of the commands notice though that I do change the extension.
169
00:12:52,690 --> 00:12:53,410
And here we go.
170
00:12:53,410 --> 00:13:03,450
Now I have two different files compressed and zipped list again it's TV f if I want to list Jeezy files
171
00:13:03,540 --> 00:13:10,210
I do Z CVF and if I want a list Baeza to I use J.
172
00:13:10,420 --> 00:13:11,220
CVF
173
00:13:20,060 --> 00:13:22,120
Let's see how the extraction works.
174
00:13:22,130 --> 00:13:31,880
First I'm going to create a directory called Jeezy and I'll copy the compressed file to the directory.
175
00:13:32,040 --> 00:13:37,000
Man I'm going to see neither the directory.
176
00:13:37,070 --> 00:13:38,240
So if I want to extract.
177
00:13:38,270 --> 00:13:39,670
You should know how to do that when out.
178
00:13:39,700 --> 00:13:44,560
It's Todd Z for the GZ files and then x4 extract the.
179
00:13:44,570 --> 00:13:46,340
And at.
180
00:13:46,490 --> 00:13:49,030
And I can specify the file name if I want
181
00:13:52,680 --> 00:13:57,840
or I can extract everything if I so choose.
182
00:13:57,910 --> 00:14:05,250
I do I'll ask to verify that they go back and let me do the same thing with the busy easy file.
183
00:14:05,430 --> 00:14:08,100
So I'm going to create a directory called visit
184
00:14:13,010 --> 00:14:16,130
and this case I'm going to copy it to the directory.
185
00:14:16,220 --> 00:14:19,630
I'm going to use the minus see option that we saw earlier.
186
00:14:19,940 --> 00:14:22,330
So again Todd J.
187
00:14:22,370 --> 00:14:31,310
This time because it's a busy busy file x4 extract the f the name of the file minus capital C and the
188
00:14:31,310 --> 00:14:32,810
destination directory.
189
00:14:33,230 --> 00:14:35,780
I do s to verify it.
190
00:14:36,260 --> 00:14:40,510
By the way here's the cool thing that you might have noticed when I'm typing.
191
00:14:41,000 --> 00:14:42,370
J.
192
00:14:42,830 --> 00:14:49,970
Z F and I type the name on the file and I hit tab for auto completion tab will automatically complete
193
00:14:50,000 --> 00:14:51,680
with the correct extension.
194
00:14:51,860 --> 00:14:53,140
So if I'm using j.
195
00:14:54,020 --> 00:14:57,160
It automatically completes the beezy to file.
196
00:14:57,350 --> 00:15:02,560
If I'm using the Z X-Fi it automatically completes the GC file.
197
00:15:03,480 --> 00:15:05,370
All right so that was it.
198
00:15:05,370 --> 00:15:09,300
To see how we can upload and download these files to the victim machine.
199
00:15:09,300 --> 00:15:11,280
You're going to have to wait for part two.
20808
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.