-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
14138 lines (10663 loc) · 323 KB
/
index.html
File metadata and controls
14138 lines (10663 loc) · 323 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Linux Mastery Course · Dark Theme</title>
<!-- PWA Meta Tags -->
<meta name="description" content="Complete Linux command-line and cybersecurity mastery course with 17 modules. Learn bash, system administration, security, and more.">
<meta name="theme-color" content="#0E0E0E">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Linux Master">
<meta name="mobile-web-app-capable" content="yes">
<meta name="application-name" content="Linux Mastery Course">
<meta name="msapplication-TileColor" content="#0E0E0E">
<meta name="msapplication-config" content="none">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
<!-- Highlight.js for bash syntax coloring -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/base16/tomorrow-night.min.css">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<style>
:root {
--bg: #0E0E0E;
--bg-alt: #141414;
--card: #1A1A1A;
--muted: #888888;
--text: #EDEDED;
--accent: #98C379;
--accent-2: #61AFEF;
--keyword: #E5C07B;
--variable: #C678DD;
--string: #98C379;
--number: #56B6C2;
--comment: #5A5A5A;
--error: #E06C75;
--border: #2A2A2A;
--shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
--radius: 12px;
}
* { box-sizing: border-box; }
body {
margin: 0;
min-height: 100vh;
background: var(--bg);
color: var(--text);
font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
font-weight: 500;
line-height: 1.75;
letter-spacing: 0.01em;
padding: 40px 20px 60px;
}
.page { max-width: 1000px; margin: 0 auto; }
.hero {
position: relative;
padding: 32px;
border-radius: var(--radius);
background: linear-gradient(135deg, rgba(97, 175, 239, 0.1) 0%, rgba(152, 195, 121, 0.08) 100%);
border: 1px solid var(--border);
box-shadow: var(--shadow);
margin-bottom: 32px;
}
.hero-title {
margin: 0 0 12px;
font-weight: 800;
font-size: 38px;
letter-spacing: -0.02em;
color: #FFFFFF;
}
.hero-subtitle {
margin: 0 0 20px;
color: var(--muted);
max-width: 700px;
font-size: 17px;
font-weight: 400;
}
.pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.pill {
padding: 8px 14px;
border-radius: 999px;
background: rgba(255, 255, 255, 0.06);
border: 1px solid var(--border);
color: var(--text);
font-size: 13px;
font-weight: 600;
display: inline-flex;
gap: 6px;
align-items: center;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat {
padding: 16px;
border-radius: var(--radius);
background: var(--bg-alt);
border: 1px solid var(--border);
}
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; margin: 0 0 4px; }
.stat-value { margin: 0; font-size: 20px; font-weight: 700; color: #FFFFFF; }
.card {
padding: 32px;
border-radius: var(--radius);
background: var(--card);
border: 1px solid var(--border);
box-shadow: var(--shadow);
}
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.toolbar .hint { color: var(--muted); font-size: 13px; }
.markdown { color: var(--text); font-size: 16px; font-weight: 500; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 {
color: #FFFFFF;
font-weight: 800;
letter-spacing: -0.01em;
margin-top: 36px;
margin-bottom: 16px;
}
.markdown h1 { font-size: 32px; border-bottom: 2px solid var(--border); padding-bottom: 12px; }
.markdown h2 { font-size: 26px; color: var(--accent-2); }
.markdown h3 { font-size: 22px; color: var(--keyword); }
.markdown h4 { font-size: 18px; }
.markdown p { margin: 14px 0; color: var(--text); }
.markdown strong { color: #FFFFFF; font-weight: 700; }
.markdown em { color: var(--variable); font-style: italic; }
.markdown a { color: var(--accent-2); text-decoration: none; font-weight: 600; }
.markdown a:hover { text-decoration: underline; }
.markdown blockquote {
margin: 20px 0;
padding: 16px 20px;
border-left: 4px solid var(--accent);
background: rgba(152, 195, 121, 0.08);
color: var(--text);
border-radius: 0 var(--radius) var(--radius) 0;
font-weight: 500;
}
.markdown code {
background: rgba(255, 255, 255, 0.08);
padding: 3px 8px;
border-radius: 6px;
font-family: "JetBrains Mono", "Fira Code", monospace;
font-size: 14px;
font-weight: 500;
color: var(--accent);
border: 1px solid rgba(255, 255, 255, 0.08);
}
.markdown pre {
background: #0A0A0A;
padding: 20px;
border-radius: var(--radius);
overflow-x: auto;
border: 1px solid var(--border);
margin: 20px 0;
}
.markdown pre code {
background: transparent;
padding: 0;
border: none;
color: var(--text);
font-size: 14px;
line-height: 1.6;
}
/* Bash syntax highlighting overrides - SUPER COLORFUL */
.hljs { background: transparent !important; color: var(--text) !important; }
.hljs-keyword { color: #E5C07B !important; font-weight: 700; }
.hljs-built_in { color: #61AFEF !important; font-weight: 700; }
.hljs-string { color: #98C379 !important; font-weight: 600; }
.hljs-variable { color: #C678DD !important; font-weight: 600; }
.hljs-number { color: #56B6C2 !important; font-weight: 600; }
.hljs-comment { color: #5A5A5A !important; font-style: italic; }
.hljs-function { color: #61AFEF !important; font-weight: 700; }
.hljs-title { color: #61AFEF !important; font-weight: 700; }
.hljs-params { color: #E06C75 !important; font-weight: 600; }
.hljs-attr { color: #E5C07B !important; font-weight: 600; }
.hljs-literal { color: #56B6C2 !important; font-weight: 600; }
.hljs-symbol { color: #C678DD !important; font-weight: 600; }
.hljs-meta { color: #E06C75 !important; font-weight: 600; }
.hljs-meta .hljs-keyword { color: #E06C75 !important; }
.hljs-meta .hljs-string { color: #98C379 !important; }
/* Shell prompt and operators */
.hljs-doctag { color: #E5C07B !important; font-weight: 700; }
.hljs-selector-tag { color: #E06C75 !important; font-weight: 700; }
.hljs-selector-class { color: #E5C07B !important; }
.hljs-selector-id { color: #61AFEF !important; }
.hljs-subst { color: #C678DD !important; }
.hljs-section { color: #61AFEF !important; font-weight: 700; }
.hljs-link { color: #56B6C2 !important; }
.hljs-regexp { color: #56B6C2 !important; }
.hljs-deletion { color: #E06C75 !important; background: rgba(224, 108, 117, 0.15); }
.hljs-addition { color: #98C379 !important; background: rgba(152, 195, 121, 0.15); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
.hljs-type { color: #56B6C2 !important; font-weight: 600; }
.hljs-class { color: #E5C07B !important; }
.hljs-name { color: #E06C75 !important; font-weight: 600; }
.hljs-attribute { color: #E5C07B !important; }
.hljs-property { color: #61AFEF !important; }
/* Shebang and special */
.hljs-shebang { color: #5A5A5A !important; font-style: italic; }
.hljs-operator { color: #56B6C2 !important; font-weight: 700; }
.hljs-punctuation { color: #ABB2BF !important; }
.markdown table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
background: var(--bg-alt);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
}
.markdown th, .markdown td {
border: 1px solid var(--border);
padding: 12px 16px;
text-align: left;
color: var(--text);
}
.markdown th {
background: rgba(255, 255, 255, 0.05);
font-weight: 700;
color: #FFFFFF;
}
.markdown tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }
.markdown ul, .markdown ol { padding-left: 24px; margin: 14px 0; }
.markdown li { margin: 8px 0; }
.markdown li::marker { color: var(--accent); }
.badge {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
border-radius: 8px;
background: rgba(97, 175, 239, 0.15);
border: 1px solid rgba(97, 175, 239, 0.3);
color: var(--accent-2);
font-size: 13px;
font-weight: 600;
}
.muted { color: var(--muted); }
.github-link {
display: inline-flex;
align-items: center;
gap: 6px;
color: var(--muted);
font-size: 13px;
text-decoration: none;
transition: color 0.2s;
}
.github-link:hover { color: var(--text); }
.footer {
margin-top: 40px;
padding-top: 24px;
border-top: 1px solid var(--border);
text-align: center;
color: var(--muted);
font-size: 14px;
}
.footer a { color: var(--accent-2); }
@media (max-width: 768px) {
body { padding: 20px 16px 40px; }
.hero, .card { padding: 20px; }
.toolbar { flex-direction: column; align-items: flex-start; }
.hero-title { font-size: 28px; }
}
</style>
</head>
<body>
<div class="page">
<section class="hero">
<div class="pill-row">
<span class="pill">🐧 Linux Mastery Course</span>
<span class="pill">Cybersecurity Focus</span>
<span class="pill">Beginner → Intermediate+</span>
</div>
<h1 class="hero-title">Linux Mastery, Dark & Readable</h1>
<p class="hero-subtitle">All of your existing notes rendered beautifully in a focused dark theme. Everything remains intact; just easier to read, search, and navigate.</p>
<div class="stats">
<div class="stat">
<p class="stat-label">Modules</p>
<p class="stat-value">17 total</p>
</div>
<div class="stat">
<p class="stat-label">Audience</p>
<p class="stat-value">CSIT · Hackers · Admins</p>
</div>
<div class="stat">
<p class="stat-label">Theme</p>
<p class="stat-value">Low-glare night mode</p>
</div>
</div>
</section>
<section class="card">
<div class="toolbar">
<div class="badge">📒 Rendered Markdown</div>
<span class="hint">Tip: Press Ctrl+F to jump anywhere instantly.</span>
</div>
<article id="md-target" class="markdown">Loading course notes…</article>
</section>
</div>
<script id="md-source" type="text/markdown">
# 🐧 Linux Mastery Course
### By [UnExplainableFish52](https://github.com/UnExplainableFish52) (Loki)
---
> **Course Focus:** Beginner to Intermediate+ Linux for CyberSecurity
> **Target Audience:** CSIT Students, Aspiring Ethical Hackers, SysAdmins
> **Total Modules:** 17
---
# Module 1: Foundation & Philosophy
## 📘 Introduction
Linux is a **Unix-like operating system** built around the Linux kernel. It powers everything from servers to smartphones, and is the **backbone of cybersecurity** operations worldwide. Understanding the **kernel**, **shell**, and **user space** is critical before diving into commands. Without this foundation, you'll struggle with advanced topics.
This module covers what Linux actually is, why it's the go-to OS for security professionals, and how to set up your own hacking lab.
---
## 1.1 What is Linux?
Linux is not just an operating system — it's a **kernel** combined with **GNU utilities** to form a complete OS.
| Component | Description |
|-----------|-------------|
| **Kernel** | Core component that manages CPU, memory, devices, and system calls |
| **Shell** | Command-line interpreter (bash, zsh, sh) that processes user commands |
| **User Space** | Where applications and user processes run, isolated from kernel space |
| **GNU Tools** | Essential utilities (grep, sed, awk, tar) that make Linux functional |
> 💡 **GNU/Linux:** The technically correct term — GNU provides the tools, Linux provides the kernel.
---
## 1.2 Why Linux for CyberSecurity?
Linux dominates the cybersecurity landscape:
| Reason | Explanation |
|--------|-------------|
| **Open Source** | Full transparency — audit every line of code |
| **Flexibility** | Customize everything from kernel to desktop |
| **Security** | Multi-user security model, strong permissions |
| **Tool Ecosystem** | Most security tools are Linux-native (Metasploit, Nmap, Burp Suite) |
| **Server Dominance** | 96%+ of web servers run Linux — mandatory knowledge for pentesting |
| **Scripting Power** | Bash scripting enables automation of complex tasks |
---
## 1.3 Linux vs Windows vs macOS
| Feature | Linux | Windows | macOS |
|---------|-------|---------|-------|
| **Source Code** | Open Source | Proprietary | Proprietary (BSD-based kernel) |
| **Cost** | Free | Paid License | Included with Apple hardware |
| **Security Tools** | Native support | Limited/Ported | Some native, many ported |
| **Customization** | Unlimited | Limited | Limited |
| **Server Usage** | ~96% of servers | ~4% of servers | Rare |
| **Package Manager** | apt, yum, pacman | None native (winget new) | Homebrew (third-party) |
| **Filesystem** | ext4, xfs, btrfs | NTFS, FAT32 | APFS, HFS+ |
| **Pentesting Distros** | Kali, Parrot, BlackArch | None | None |
> ⚠️ **Warning:** Windows is the target, Linux is the weapon. Know both.
---
## 1.4 Architecture Overview
```
┌─────────────────────────────────────────────────────────┐
│ USER SPACE │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Applications (Firefox, Nmap, Metasploit) │ │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Shell (bash, zsh, sh) │ │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ System Libraries (glibc, libssl) | │
│ └─────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────┤
│ KERNEL SPACE │
│ ┌─────────────────────────────────────────────────┐ │
│ │ System Call Interface │
│ └─────────────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────────────┐ │
│ │ Kernel (Process, Memory, Device, FS, Network) │
│ └─────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────┤
│ HARDWARE │
│ CPU | RAM | Disk | NIC | GPU │
└─────────────────────────────────────────────────────────┘
```
**Key Layers:**
- **User Space:** Where you (and hackers) operate — running applications and commands
- **Kernel Space:** Protected memory where the OS core runs — handles hardware abstraction
- **Hardware:** Physical components the kernel manages
---
## 1.5 Common Linux Distributions
| Distro | Base | Package Manager | Best For |
|--------|------|-----------------|----------|
| **Kali Linux** | Debian | apt | Penetration Testing, Ethical Hacking |
| **Parrot OS** | Debian | apt | Pentesting + Privacy + Development |
| **Ubuntu** | Debian | apt | General use, Beginners, Servers |
| **Debian** | Independent | apt | Stability, Servers |
| **Arch Linux** | Independent | pacman | Advanced users, Customization |
| **Fedora** | Independent | dnf | Cutting-edge features, Developers |
| **CentOS/RHEL** | Independent | yum/dnf | Enterprise servers |
| **BlackArch** | Arch | pacman | Advanced Pentesting (2800+ tools) |
> 💡 **For CyberSec:** Start with **Kali Linux** — 600+ pre-installed security tools.
---
## 1.6 Virtual Machine Setup (Best Practices)
### Recommended Setup for Your System
> **Your System:** Windows 11 Pro (Acer Nitro V15, RTX 3050, 16GB DDR5) + VirtualBox
### VirtualBox Configuration for Kali Linux
| Setting | Recommended Value | Reason |
|---------|-------------------|--------|
| **RAM** | 4096 MB (4 GB) | Smooth operation with multiple tools |
| **CPU Cores** | 2-4 cores | Parallel processing for scans |
| **Storage** | 80 GB (Dynamic) | Tools + wordlists + captures |
| **Network** | NAT + Host-Only | NAT for internet, Host-Only for lab |
| **Graphics** | 128 MB VRAM | GUI performance |
| **Clipboard** | Bidirectional | Copy-paste between host and VM |
| **Drag & Drop** | Bidirectional | Easy file transfer |
### Post-Installation Commands
```bash
# Update system immediately after install
sudo apt update && sudo apt upgrade -y
# Install VirtualBox Guest Additions (for better performance)
sudo apt install -y virtualbox-guest-x11
# Verify installation
uname -a
lsb_release -a
```
### Snapshot Strategy
| Snapshot Name | When to Take |
|---------------|--------------|
| `fresh-install` | Right after OS installation |
| `base-configured` | After updates + guest additions |
| `pre-engagement` | Before starting any pentest lab |
> ⚠️ **Warning:** Always snapshot before experiments. Breaking your VM is part of learning — recovering should be instant.
---
## 🔑 Key Terms
| Term | Definition |
|------|------------|
| **Kernel** | Core of the OS — manages hardware, memory, processes. Direct communication with CPU. |
| **Shell** | Command interpreter — translates your commands into kernel actions. Examples: bash, zsh. |
| **Distro** | Distribution — a complete OS package built around the Linux kernel (Kali, Ubuntu, Arch). |
| **GNU** | "GNU's Not Unix" — collection of free software tools that complement the Linux kernel. |
| **User Space** | Memory area where applications run — isolated from kernel for security. |
| **Kernel Space** | Protected memory where OS core operates — only kernel code runs here. |
| **Package Manager** | Tool for installing/updating software (apt, yum, pacman). |
| **Rolling Release** | Continuous updates without major version upgrades (Arch, Kali). |
| **LTS** | Long Term Support — stable releases with extended security updates (Ubuntu LTS). |
---
## ❓ FAQs
**Q: Why use Kali Linux instead of Ubuntu for CyberSec?**
> Kali comes pre-installed with **600+ penetration testing tools** — Metasploit, Nmap, Burp Suite, John the Ripper, etc. Ubuntu is general-purpose and requires manual installation of each tool. For learning, Kali gets you hacking faster.
**Q: Is Kali Linux illegal?**
> No. Kali is legal to download and use. **How you use it** determines legality. Scanning/attacking systems without permission is illegal. Always get written authorization.
**Q: Should I dual-boot or use a VM?**
> **Start with VM. ** Reasons:
> - Snapshots save you from breaking things
> - Isolated network for safe lab practice
> - Easy to reset and experiment
> - No risk to your main Windows installation
>
> Dual-boot later when you need bare-metal performance for specific tasks.
**Q: What's the difference between bash and zsh?**
> Both are shells. **bash** (Bourne Again Shell) is the default on most systems. **zsh** has better autocompletion, themes, and plugins. Kali uses zsh by default since 2020. Core commands work the same in both.
**Q: Can I run Linux tools on Windows directly?**
> Yes, via **WSL2** (Windows Subsystem for Linux). However, some low-level network tools (raw sockets, packet injection) don't work properly. For serious pentesting, use a full VM or bare-metal.
---
## 📝 Practice Tasks
### Task 1: Install Kali Linux on VirtualBox
**Objective:** Set up your hacking lab
**Steps:**
1. Download Kali Linux VirtualBox image from [kali.org](https://www.kali.org/get-kali/)
2. Import the `.ova` file into VirtualBox
3. Configure RAM (4GB), CPU (2 cores), Network (NAT)
4. Boot and login (default: `kali` / `kali`)
5. Change default password: `passwd`
6. Update system: `sudo apt update && sudo apt upgrade -y`
7. Take a snapshot named `base-configured`
**Deliverable:** Screenshot of `neofetch` or `uname -a` output
---
### Task 2: Identify Your Kernel Version and Architecture
**Objective:** Understand your system internals
**Commands to run:**
```bash
uname -r # Kernel version
uname -m # Architecture (x86_64 = 64-bit)
uname -a # All system info
lsb_release -a # Distribution details
cat /etc/os-release # Alternative distro info
```
**Deliverable:** Document your findings in this format:
```
Kernel Version: ___________
Architecture: ___________
Distro: ___________
Codename: ___________
```
---
### Task 3: Compare 3 Distros
**Objective:** Understand the Linux ecosystem
**Research and document:**
| Criteria | Kali Linux | Ubuntu | Arch Linux |
|----------|------------|--------|------------|
| Primary Use Case | | | |
| Package Manager | | | |
| Release Model | | | |
| Default Desktop | | | |
| Beginner Friendly? | | | |
| Pre-installed Security Tools | | | |
**Deliverable:** Completed comparison table with your findings
---
## ✅ Module 1 Checkpoint
Before moving to Module 2, confirm:
- [ ] Kali Linux VM installed and running
- [ ] Default password changed
- [ ] System updated
- [ ] Snapshot taken
- [ ] Kernel version and architecture identified
- [ ] Understood the difference between kernel, shell, and user space
---
---
# Module 2: Getting Started — The Shell
## 📘 Introduction
The shell is your **primary interface** to Linux. Every command you type, every script you run, every hack you execute — it all goes through the shell. Mastering shell navigation and basic file operations is **non-negotiable** for any security professional.
This module covers terminal fundamentals, navigation commands, and essential file operations. By the end, you'll move through the Linux filesystem like second nature.
---
## 2.1 Terminal vs Shell vs Console
These terms are often confused. Here's the clarity:
| Term | Definition |
|------|------------|
| **Terminal** | Application/window that displays the shell (GNOME Terminal, Konsole, xterm) |
| **Shell** | The actual command interpreter running inside the terminal (bash, zsh) |
| **Console** | Physical/system-level terminal (Ctrl+Alt+F1 on Linux) — no GUI |
| **TTY** | Teletypewriter — legacy term for terminal devices (`/dev/tty`) |
| **Prompt** | The text indicating the shell is ready for input (`┌──(kali㉿kali)-[~]`) |
> 💡 **Think of it this way:** Terminal is the TV, Shell is the channel, Console is the antenna.
---
## 2.2 Shell Types
| Shell | Full Name | Description |
|-------|-----------|-------------|
| **bash** | Bourne Again Shell | Most common, default on most Linux distros |
| **zsh** | Z Shell | Enhanced bash with better autocompletion, Kali default |
| **sh** | Bourne Shell | Original Unix shell, minimal, POSIX-compliant |
| **fish** | Friendly Interactive Shell | User-friendly, syntax highlighting, not POSIX |
| **dash** | Debian Almquist Shell | Lightweight, used for system scripts |
### Check Your Current Shell
```bash
echo $SHELL # Default shell
echo $0 # Current shell
cat /etc/shells # All available shells
```
### Change Default Shell
```bash
chsh -s /bin/bash # Switch to bash
chsh -s /bin/zsh # Switch to zsh
```
> ⚠️ **For scripting:** Always use `#!/bin/bash` or `#!/bin/sh` for portability. zsh-specific scripts may not work on other systems.
---
## 2.3 Understanding Paths
### Absolute vs Relative Paths
| Type | Description | Example |
|------|-------------|---------|
| **Absolute Path** | Full path from root `/` | `/home/kali/Documents/report.txt` |
| **Relative Path** | Path from current directory | `./Documents/report.txt` or `../Downloads/` |
### Special Path Symbols
| Symbol | Meaning | Example |
|--------|---------|---------|
| `/` | Root directory (top of filesystem) | `cd /` |
| `~` | Home directory | `cd ~` → `/home/kali` |
| `.` | Current directory | `./script.sh` |
| `..` | Parent directory (one level up) | `cd ..` |
| `-` | Previous directory | `cd -` |
---
## 2.4 Navigation Commands
### Command: `pwd`
**Print Working Directory** — shows your current location
**Syntax:**
```bash
pwd [OPTIONS]
```
**Example:**
```bash
┌──(kali㉿kali)-[~]
└─$ pwd
/home/kali
┌──(kali㉿kali)-[/etc/network]
└─$ pwd
/etc/network
```
**Options:**
| Option | Description |
|--------|-------------|
| `-L` | Print logical path (default, follows symlinks) |
| `-P` | Print physical path (resolves symlinks) |
**Real-Life Use Case:**
When writing scripts that need to reference files relative to the script's location, `pwd` helps establish the base path. During pentesting, knowing exactly where you are prevents accidentally modifying wrong files.
---
### Command: `cd`
**Change Directory** — navigate the filesystem
**Syntax:**
```bash
cd [DIRECTORY]
```
**Examples:**
```bash
cd /var/log # Go to absolute path
cd Documents # Go to relative path (inside current dir)
cd .. # Go up one level
cd ../.. # Go up two levels
cd ~ # Go to home directory
cd # Also goes to home directory
cd - # Go to previous directory
```
**Pro Techniques:**
```bash
cd /etc/netw[TAB] # Tab completion → /etc/network
cd ~/Do[TAB][TAB] # Double-tab shows: Documents/ Downloads/
```
**Real-Life Use Case:**
Navigating to `/var/log` to analyze system logs during incident response, or moving to `/etc` to review configuration files during system enumeration.
---
### Command: `ls`
**List directory contents** — most used command in Linux
**Syntax:**
```bash
ls [OPTIONS] [PATH]
```
**Common Options:**
| Option | Description |
|--------|-------------|
| `-l` | Long format (permissions, size, date) |
| `-a` | Show hidden files (starting with `.`) |
| `-la` or `-al` | Long format + hidden files |
| `-lh` | Long format + human-readable sizes |
| `-R` | Recursive (list subdirectories) |
| `-t` | Sort by modification time (newest first) |
| `-S` | Sort by size (largest first) |
| `-r` | Reverse sort order |
| `-1` | One file per line |
| `--color` | Colorize output (default on most systems) |
**Examples:**
```bash
┌──(kali㉿kali)-[~]
└─$ ls
Desktop Documents Downloads Music Pictures Public
┌──(kali㉿kali)-[~]
└─$ ls -la
total 120
drwxr-xr-x 15 kali kali 4096 Dec 25 10:30 .
drwxr-xr-x 3 root root 4096 Dec 20 09:15 ..
-rw------- 1 kali kali 220 Dec 20 09:15 .bash_history
-rw-r--r-- 1 kali kali 220 Dec 20 09:15 . bash_logout
-rw-r--r-- 1 kali kali 3526 Dec 20 09:15 . bashrc
drwxr-xr-x 2 kali kali 4096 Dec 20 09:15 Desktop
drwxr-xr-x 2 kali kali 4096 Dec 25 10:30 Documents
┌──(kali㉿kali)-[~]
└─$ ls -lhS /var/log | head -5
total 15M
-rw-r----- 1 root adm 5.2M Dec 25 10:00 syslog
-rw-r----- 1 root adm 2.1M Dec 25 09:00 auth.log
-rw-r----- 1 root adm 1.8M Dec 24 23:59 kern.log
```
**Understanding `ls -l` Output:**
```
-rw-r--r-- 1 kali kali 4096 Dec 25 10:30 file.txt
│└──┬───┘ │ │ │ │ │ │
│ │ │ │ │ │ │ └── Filename
│ │ │ │ │ │ └── Modification date
│ │ │ │ │ └── Size in bytes
│ │ │ │ └── Group owner
│ │ │ └── User owner
│ │ └── Hard link count
│ └── Permissions (rwx for user, group, others)
└── File type (- = file, d = directory, l = symlink)
```
**Real-Life Use Case:**
During enumeration, `ls -la /home` reveals all users on a system. `ls -la` in any directory exposes hidden config files (like `.bashrc`, `.ssh`) that may contain credentials or useful information.
---
### Command: `tree`
**Display directory structure as a tree**
**Syntax:**
```bash
tree [OPTIONS] [PATH]
```
> ⚠️ **Note:** May need installation: `sudo apt install tree`
**Common Options:**
| Option | Description |
|--------|-------------|
| `-L n` | Limit depth to n levels |
| `-d` | Directories only |
| `-a` | Include hidden files |
| `-f` | Print full path |
| `-h` | Human-readable sizes |
| `--dirsfirst` | List directories before files |
**Examples:**
```bash
┌──(kali㉿kali)-[~]
└─$ tree -L 2
.
├── Desktop
│ └── tools
├── Documents
│ ├── notes
│ └── reports
├── Downloads
│ ├── exploits
│ └── wordlists
└── scripts
├── recon. sh
└── scan.sh
┌──(kali㉿kali)-[~]
└─$ tree -L 1 -d /etc
/etc
├── alternatives
├── apache2
├── apt
├── bash_completion. d
├── network
...
```
**Real-Life Use Case:**
Quickly visualizing web application structures after gaining access. `tree -L 3 /var/www/html` instantly shows the application layout, helping identify config files, upload directories, and potential targets.
---
## 2.5 File Operations
### Command: `touch`
**Create empty files or update timestamps**
**Syntax:**
```bash
touch [OPTIONS] FILENAME(S)
```
**Examples:**
```bash
touch newfile.txt # Create single file
touch file1.txt file2.txt file3.txt # Create multiple files
touch /tmp/test.log # Create file in specific location
touch {a,b,c}.txt # Create a. txt, b.txt, c.txt
touch file{1..10}.txt # Create file1.txt through file10.txt
```
**Options:**
| Option | Description |
|--------|-------------|
| `-a` | Change access time only |
| `-m` | Change modification time only |
| `-t STAMP` | Use specific timestamp (format: [[CC]YY]MMDDhhmm[. ss]) |
**Real-Life Use Case:**
Creating log files before running scans, or updating timestamps to cover tracks (note: this is detectable with forensic analysis of inode data).
---
### Command: `mkdir`
**Make directories**
**Syntax:**
```bash
mkdir [OPTIONS] DIRECTORY(S)
```
**Examples:**
```bash
mkdir projects # Create single directory
mkdir dir1 dir2 dir3 # Create multiple directories
mkdir -p pentest/target/scans/nmap # Create nested structure (-p = parents)
mkdir -m 700 private # Create with specific permissions
mkdir -p project/{src,bin,docs,logs} # Create project structure
```
**Options:**
| Option | Description |
|--------|-------------|
| `-p` | Create parent directories as needed (no error if exists) |
| `-m MODE` | Set permissions (like chmod) |
| `-v` | Verbose output |
**Real-Life Use Case:**
Setting up organized pentest project structures:
```bash
mkdir -p ~/pentests/client_name/{recon,scans,exploits,loot,reports}
```
---
### Command: `cp`
**Copy files and directories**
**Syntax:**
```bash
cp [OPTIONS] SOURCE DESTINATION
```
**Examples:**
```bash
cp file. txt backup. txt # Copy file
cp file.txt /tmp/ # Copy to directory
cp file1.txt file2.txt /backup/ # Copy multiple files to directory
cp -r directory/ backup_dir/ # Copy directory recursively
cp -p important.conf important.bak # Preserve permissions and timestamps
cp -i file.txt /tmp/ # Interactive (prompt before overwrite)
cp -v *.txt /backup/ # Verbose output
```
**Options:**
| Option | Description |
|--------|-------------|
| `-r, -R` | Recursive (required for directories) |
| `-p` | Preserve permissions, ownership, timestamps |
| `-i` | Interactive (prompt before overwrite) |
| `-v` | Verbose |
| `-n` | No clobber (don't overwrite existing) |
| `-u` | Update (copy only if source is newer) |
**Real-Life Use Case:**
Backing up configuration files before modifying them during system hardening:
```bash
cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
```
---
### Command: `mv`
**Move or rename files and directories**
**Syntax:**
```bash
mv [OPTIONS] SOURCE DESTINATION
```
**Examples:**
```bash
mv oldname.txt newname. txt # Rename file
mv file. txt /tmp/ # Move to directory
mv file. txt /tmp/newname.txt # Move and rename
mv *.log /var/log/archive/ # Move multiple files
mv -i important.txt /backup/ # Interactive mode
mv -n file.txt /existing/ # Don't overwrite
```
**Options:**
| Option | Description |
|--------|-------------|
| `-i` | Interactive (prompt before overwrite) |
| `-n` | No clobber (don't overwrite) |
| `-v` | Verbose |
| `-u` | Update only (move if source is newer) |
**Real-Life Use Case:**
Organizing captured data during a pentest:
```bash
mv *.pcap ~/pentests/client/captures/
mv scan_results_* ~/pentests/client/scans/
```
---
### Command: `rm`
**Remove files and directories**