[THM][--s] Linux Fundamentals

·

3 min read

This is a summary of thm Linux Fundamentals Part 1~3 Room

THM separate Linux into 3 parts, from basic commands to file operators and shell scripting.

Although these parts are quite simple, I record some important informations anyway.

Linux is colorful for me!!! <3 LINUX <3

0x00 Mind Map

图片.png

图片.png

图片.png

0x01 About Linux Environment variables & export

Actually I was a little bit confused when meet task 6 in part 2. In the introduction it said "Environment variables can also be set pretty easily, just running export = will set that as an environment variable", and when I deal with "How would you set nootnoot equal to 1111", it's clearly export nootnoot=1111, but when I do this too in task 13, it was failed. Instead, it should be executed by the following steps:

图片.png

Then I found my mistake, here the variable is test1234 and just let $USER equals it. We can check if it is done by 'export', and here is the result: 图片.png

RECORD: Here I know the meaning of environment variable and the use of export, but I don't know why should we do this? What does it mean? what's the function? and, how could we deal with "Segmentation fault (core dumped)"? Also, there exists another question: xxx is not in the sudoers file. This incident will be reported.

The art of this task is how to use 'find' command and find the password from that file, it is not simple as I thought formally.

so here is the command: find / -name shiba4 2>/dev/null

Here "2>/dev/null" means do not display permission denied content. otherwise it will show too many results that you may miss the most important part.

There are three results, only one can be executed, one is a directory, the last file cannot be executed even when I use sudo chmod 660 shiba4.

Done.