-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathcompression.txt
More file actions
84 lines (76 loc) · 2.54 KB
/
compression.txt
File metadata and controls
84 lines (76 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
compression
TAR
.zip
unzip file.zip
7z x file.zip
.gz, .gzip
gunzip file.gz
gzip file
.tar
tar xvf file.tar
.tar.gz
tar xzvf file.tar.gz file.tgz
tar xf archive.tar.gz
.tar.bz2
tar vxjf file.tar.bz2
.tar.xz
tar xf file.tar.xz
tar xjf file.tar.xz
unxz file.tar.xz && tar xvf file.tar
tar -C /home/me -xvf yourfile.tar
--extract archive to target directory
Password-protect encrypted file archives
TAR
tar czvf - directory | gpg --symmetric --cipher-algo aes256 -o passwordprotectedarchive.tar.gz.gpg
-gpg encrypt a gnu-zipped tarball (.tar.gz/.tgz)
gpg -d passwordprotectedarchive.tar.gz.gpg | tar xzvf -
-decrpyt password-protected gzipped tarball archive
GZIP
mcrypt -z plaintext
-Compress & Encrypt
mdecrypt -z plaintext.gz.nc
-Decrypt and extract
-m(de)crypt flag -z to compress at gzip archive
cat plaintext | gzip | aespipe > plaintext.gz.aes
cat plaintext.gz.aes | aespipe -d | gunzip > plaintext
7ZIP
7z a -p<password> <someprotectedfile>.7z file1.txt file2.txt
-password protect (a) file(s) archived as 7z
cat <somefile> | 7z a -si -p<password> <someprotectedfile>.7z
-password protect (a) file(s) archived as 7z taking stdin as file handle
BCRYPT
bcrypt -r plaintext
bcrypt -r plaintext.bfe
Grepping Archives
.zip, .z
zipgrep something file.zip
.gz, .tar.gz
zgrep foor file.gz
zgrep -eir '(this|that)' file.gz
.tar.gz
tar xf file.tar.gz --to-command "awk '/foor/ { print ENVIRON[\"TAR_FILENAME"]; exit}'"
--prints names of archived files containing pattern
tar zxf file.tar.gz --to-command 'grep --label=$TAR_FILENAME" -H PATTERN ; true"
function grep-archive() {
for i in $(tar -tzf "$1"); do results=$(tar -Oxzf "$1" "$i" | grep --label="$i" -H "$2") && echo "$results"; done
}
grep-archive file.tgz "pattern"
zcat file.tar.gz | grep -ai pattern
Cracking
.zip
fcrackzip –u –c 1 –p aaaaaaaa ‘/root/Desktop/Test.zip’
fcrackzip –u –D –p ‘/root/Desktop/dic’ ‘/root/Desktop/Test.zip
winzip
zip2john file.zip | cut -d ':' -f 2 > hashfile
>hashcat64 -a 0 -m 13600 hashfile /usr/share/wordlists/rockyou.txt
>john hashfile --format=ZIP
7z2john
72hashcat
rar2john
C:\bin\hashcat-5.1.0>hashcat64 -h | findstr Archives
11600 | 7-Zip | Archives
12500 | RAR3-hp | Archives
13000 | RAR5 | Archives
13200 | AxCrypt | Archives
13300 | AxCrypt in-memory SHA1 | Archives
13600 | WinZip | Archives