-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathChallenge_01
61 lines (55 loc) · 1.77 KB
/
Challenge_01
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
*********************The Linux Terminal*************************
1. Run the following command both as a non-privileged user and as root: tail /etc/shadow
Sol.
Non-privileged user-: tail /etc/shadow
-> tail: cannot open '/etc/shadow' for reading: Permission denied
Privileged user-: sudo tail /etc/shadow
-> [sudo] password for prateek:
hplip:*:18474:0:99999:7:::
whoopsie:*:18474:0:99999:7:::
colord:*:18474:0:99999:7:::
geoclue:*:18474:0:99999:7:::
pulse:*:18474:0:99999:7:::
gnome-initial-setup:*:18474:0:99999:7:::
gdm:*:18474:0:99999:7:::
prateek:$6$u4f3GbYvPkYaPRQt$KdN/ SmmJ91NmcoDlb9LoThTDsJyT7eQxdkurqPzpVeuDasu4KSa04aAD.dYYXrmNLIush1XoQI KhxyCa2EJ5a0:18521:0:99999:7:::
systemd-coredump:!!:18521::::::
vboxadd:!:18521::::::
2. Become root temporarily in a terminal.
Run the following command as root: apt update && apt install nmap
Logout root from the terminal using a keyboard shortcut
Sol.
su
-> Password:
apt update && apt install nmap
-> nmap will install
ctrl+d
-> terminal closed
3. Change (set) the root password
Become root in a terminal by running the su command
Run as root the following command: lshw
Sol.
sudo passwd root
-> [sudo] password for prateek:
New password:
Retype new password:
passwd: password updated successfully
su
-> Password:
lshw
-> prateek-virtualbox
description: Computer
product: VirtualBox.......
4. Display the user’s history
Remove line no. 4 from the history
Run a command without being recorded in the history. Check that it wasn’t saved in the shell history.
Remove the entire history.
Sol.
history
-> shows the history list
history -d 4
-> line no. 4 was removed
pwd
-> /home/prateek
history
-> " pwd" wasn't saved in the history because the environment variable, HISTCONTROL= ignorespace