Linux fundamentals part 3

Linux fundamentals

Linux Fundamentals Part 3

Task 1

Let’s go ahead and connect to the shiba3. We got theshiba3 credentials from Linux Fundamentals Part 2.

[visith@parrot][~/Desktop/CTF/thm/Linux_Fundamentals/part_3]
└──╼ $ssh shiba3@10.10.242.136
The authenticity of host '10.10.242.136 (10.10.242.136)' can't be established.
ECDSA key fingerprint is SHA256:IivpLEJoW3uwEdrsiUSFX8EfJsQgcQS0K6mfWr08BNU.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.10.242.136' (ECDSA) to the list of known hosts.
shiba3@10.10.242.136's password:happynootnoises
....
shiba3@nootnoot:~$ 

Task 3

  1. Using relative paths, how would you cd to your home directory?
cd ~
  1. Using absolute paths how would you make a directory called test in /tmp?
mkdir /tmp /test

Task 4

  1. How would I link /home/test/testfile to /tmp/test?
ln  /home/test/testfile /tmp/test

Task 5

  1. How do you find files that have specific permissions?
-perm
  1. How would you find all the files in /home?
find /home
  1. How would you find all the files owned by paradox on the whole system?
find / -user paradox

Task 6

  1. What flag lists line numbers for every string found?
-n
  1. How would I search for the string boop in the file aaaa in the directory /tmp?
grep boop /tmp /aaaa

Task 7

shiba3@nootnoot:~/test$ find /* |grep shiba4 > shiba4_location.txt
....
shiba3@nootnoot:~/test$ cat shiba4_location.txt 
/etc/shiba/shiba4
/home/shiba4
/home/shiba4/.profile
/home/shiba4/.bashrc
/home/shiba4/.bash_logout
/opt/secret/shiba4

This will also give you a list with files you do not have acces to. So I pipe the results into
shiba4_location.txt and output this on screen using cat shiba4_location.txt

  1. What is shiba4’s password?
hiba3@nootnoot:~/test$ cd ~
shiba3@nootnoot:~$ cd /opt/secret
shiba3@nootnoot:/opt/secret$ ls
shiba4
shiba3@nootnoot:/opt/secret$ ./shiba4
<password>
shiba3@nootnoot:/opt/secret$ 

Task 9

  1. How do you specify which user you want to run a command as.?
-u
  1. How would I run whoami as user jen?
sudo -u jen whoami
  1. How do you list your current sudo privileges(what commands you can run, who you can run them as etc.)
-l

Task 10

  1. How would I add the user test to the group test?
sudo usermod -a -G test test

Task 13

Important files and directories

  • /etc/passwd - Stores user information - Often used to see all the users on a system
  • /etc/shadow - Has all the passwords of these users
  • /etc/sudoers - Used to control the sudo permissions of every user on the system -
  • /home - The directory where all your downloads, documents etc are.
  • /root - The root user’s home directory
  • /usr - Where all your software is installed
  • /bin and /sbin - Used for system critical files - DO NOT DELETE
  • /var - The Linux miscellaneous directory, a myriad of processes store data in /var
  • $PATH - Stores all the binaries you’re able to run - same as $PATH on Windows

Popular posts from this blog

Mustacchio - TryHackMe

Tech_Supp0rt: 1 - TryHackMe