THM Linux Fundamentals PT 2
This room in addition to the next few outline Linux fundamentals within the pre-security learning path, this learning path covers a lot of content I’ve already covered within university and self-study, but is a good refresher on the topics to further solidify them
Task 1: Introduction
We’re ditching the browser utility for SSH
Let’s Proceed
No answer needed.
Task 2: Accessing Your Linux Machine Using SSH (Deploy)
SSH is Secure SHell, it enables an encrypted text based interface which is often used for device management or configuration.ssh <Username>@<IP_Address>
is the syntax for using SSH, in this case, our username is tryhackme ad the IP is 10.10.169.17
so our command is ssh tryhackme@10.10.169.17
a password will also be required once the initial connection is made.
Accessing Your Linux Machine Using SSH (Deploy)
No answer needed.
Task 3: Introduction to Flags and Switches
Switches or flags are a keyword which is appended to a command following a hyphen
EX: ls -al
is two flags, -a
is all -l
asks for a list format, note that these two can be interpreted together or singularly
many commands come with a built in --help
(ls --help
)option which will bring up a number of flags and switches for a command, as well as display the syntax usage.--help
is a formatted output of the man
(man ls
)
Explore the manual page of the ls command
No answer needed.
What directional arrow key would we use to navigate down the manual page?
down
What flag would we use to display the output in a “human-readable” way?
-h
Task 4: File system Interaction Continued
touch <filename>
creates a filemkdir <foldername>
makes a directorycp <file_name_to_copy> <files_new_name_when_copying>
copies a file or folder to a targetmv
moves a file or folder to a target, can also be used to rename a file or folderrm
removes a file or folder (-R
is needed to remove a folder)file
determines what type of file a file is.
How would you create the file named “newnote”?
touch newnote
On the deployable machine, what is the file type of “unknown1” in “tryhackme’s” home directory?
ASCII Text
How would we move the file “myfile” to the directory “myfolder”
mv myfile myfolder
What are the contents of this file?
THM{FILESYSTEM}
Continue to apply your knowledge and practice the commands from this task.
No answer needed.
Task 5: Permissions 101
when we use ls -l
it show the user permissions, these are broken into three triplets, user, group and all others.
permissions are
- R — Read
- W — Write
- X — Execute
Users are a singular individual, and groups are made up on users. Linux enables very granular control using these abstractions.
su
can be used to switch users. appending the -l
flag enables the shell to act much more as if we had logged in as the user and lets us maintain their environment variables and such and redirects our home folder.
On the deployable machine, who is the owner of “important”?
user2
What would the command be to switch to the user “user2”?
su user2
Now switch to this user “user2” using the password “user2”
No answer needed.
Output the contents of “important”, what is the flag?
THM{SU_USER2}
Task 6: Common Directories
/etc
stores commonplace system files used by the OS psswd and shadow files are both stored here which hold SHA256 values for users.
/var
short for variable data, often were logs are stored when utilized by a service or application (/var/log)
not typically associated with a specific user.
/root
home for the root system user.
/tmp
volatile folder that only only needs to be accessed once or twice per up time, like RAM once the PC shuts down, the file will be wiped. useful for storing enumscripts.
Read me!
No Answer Needed
What is the directory path that would we expect logs to be stored in?
/var/logs
What root directory is similar to how RAM on a computer works?
/tmp
Name the home directory of the root user
/root
Now apply your learning and navigate through these directories on the deployed Linux machine.
No Answer Needed
Task 7: Conclusions and Summaries
Proceed to the next task to continue your learning
No answer needed