Linux fundamentals tryhackme Flashcards

1
Q

echo

A

Output any text that we provide

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

whoami

A

Find out what user we’re currently logged in as!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ls

A

listing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

cd

A

Change Directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

cat

A

concatenate

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

pwd

A

print working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

find

A

search for files in a directory hierarchy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

grep

A

Grep, short for “global regular expression print”, isa command used for searching and matching text patterns in files contained in the regular expressions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

&

A

This operator allows you to run commands in the background of your terminal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

&&

A

This operator allows you to combine multiple commands together in one line of your terminal.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

>

A

This operator is a redirector - meaning that we can take the output from a command (such as using cat to output a file) and direct it elsewhere.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

> >

A

This operator does the same function of the > operator but appends the output rather than replacing (meaning nothing is overwritten).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is SSH and how does it work

A

Secure Shell or SSH simply is a protocol between devices in an encrypted form. Using cryptography, any input we send in a human-readable format is encrypted for travelling over a network – where it is then unencrypted once it reaches the remote machine,

SSH allows us to remotely execute commands on another device remotely.
Any data sent between the devices is encrypted when it is sent over a network such as the Internet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

–help

A

This option is, in fact, a formatted output of what is called the man page (short for manual), which contains documentation for Linux commands and applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

–help

A

This option is, in fact, a formatted output of what is called the man page (short for manual), which contains documentation for Linux commands and applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

man

A

The manual pages are a great source of information for both system commands and applications available on both a Linux machine, which is accessible on the machine itself and online.

17
Q

man

A

The manual pages are a great source of information for both system commands and applications available on both a Linux machine, which is accessible on the machine itself and online.

18
Q

touch

A

Create file

19
Q

mkdir

A

Create a folder

20
Q

cp

A

Copy a file or folder

21
Q

mv

A

Move a file or folder

22
Q

rm

A

Remove a file or folder

23
Q

file

A

Determine the type of a file

24
Q

What is the difference between Users & Groups

A

The great thing about Linux is that permissions can be so granular, that whilst a user technically owns a file, if the permissions have been set, then a group of users can also have either the same or a different set of permissions to the exact same file without affecting the file owner itself.

Let’s put this into a real-world context; the system user that runs a web server must have permissions to read and write files for an effective web application. However, companies such as web hosting companies will have to want to allow their customers to upload their own files for their website without being the webserver system user – compromising the security of every other customer.

25
Q

How do you switch users?

A

Switching between users on a Linux install is easy work thanks to the su command. Unless you are the root user (or using root permissions through sudo), then you are required to know two things to facilitate this transition of user accounts:

The user we wish to switch to
The user’s password
The su command takes a couple of switches that may be of relevance to you. For example, executing a command once you log in or specifying a specific shell to use. I encourage you to read the man page for su to find out more. However, I will cover the -l or –login switch.

26
Q

what is /tmp

A

This is a unique root directory found on a Linux install. Short for “temporary”, the /tmp directory is volatile and is used to store data that is only needed to be accessed once or twice. Similar to the memory on your computer, once the computer is restarted, the contents of this folder are cleared out.

What’s useful for us in pentesting is that any user can write to this folder by default. Meaning once we have access to a machine, it serves as a good place to store things like our enumeration scripts.

27
Q

what is /etc

A

This root directory is one of the most important root directories on your system. The etc folder (short for etcetera) is a commonplace location to store system files that are used by your operating system.

For example, the sudoers file highlighted in the screenshot below contains a list of the users & groups that have permission to run sudo or a set of commands as the root user.

Also highlighted below are the “passwd” and “shadow” files. These two files are special for Linux as they show how your system stores the passwords for each user in encrypted formatting called sha512.

28
Q

what is /var

A

The “/var” directory, with “var” being short for variable data, is one of the main root folders found on a Linux install. This folder stores data that is frequently accessed or written by services or applications running on the system. For example, log files from running services and applications are written here (/var/log), or other data that is not necessarily associated with a specific user (i.e., databases and the like).

29
Q

what is /root

A

Unlike the /home directory, the /root folder is actually the home for the “root” system user. There isn’t anything more to this folder other than just understanding that this is the home directory for the “root” user. But, it is worth a mention as the logical presumption is that this user would have their data in a directory such as “/home/root” by default.

30
Q

What is Nano

A

It is easy to get started with Nano! To create or edit a file using nano, we simply use nano filename – replacing “filename” with the name of the file you wish to edit.
Once we press enter to execute the command, nano will launch! Where we can just begin to start entering or modifying our text. You can navigate each line using the “up” and “down” arrow keys or start a new line using the “Enter” key on your keyboard.
Nano has a few features that are easy to remember & covers the most general things you would want out of a text editor, including:
Searching for text
Copying and Pasting
Jumping to a line number
Finding out what line number you are on
You can use these features of nano by pressing the “Ctrl” key (which is represented as an ^ on Linux) and a corresponding letter. For example, to exit, we would want to press “Ctrl” and “X” to exit Nano.

31
Q

how can you use wget in linux

A

open python3 -m python.server

then in a new terminal use

wget http”//”ipaddress”:port/directory/filename

32
Q

how do you use scp

A

this is used with the following syntax
import file with,
scp filename_for_import user@ipaddress:/filepath/filename
export file with
scp remoteuser@ipaddress:/filepath/remotename.txt ourfilename.txt

33
Q

what does kill “PID” do?

A

This terminates a proccess

34
Q

what does killterm do

A

Kill the process, but allow it to do some cleanup tasks beforehand

35
Q

what does sigkill do

A

Kill the process - doesn’t do any cleanup after the fact

36
Q

what does sigstop do

A

Stop/suspend a process

37
Q

what does systemctl do

A

Enter the use of systemctl – this command allows us to interact with the systemd process/daemon. Continuing on with our example, systemctl is an easy to use command that takes the following formatting: systemctl [option] [service]
For example, to tell apache to start up, we’ll use systemctl start apache2. Seems simple enough, right? Same with if we wanted to stop apache, we’d just replace the [option] with stop (instead of start like we provided)
We can do four options with systemctl:
Start
Stop
Enable
Disable

38
Q

how do you push the current process which is running in the foreground to the background?

A

CTRL + Z

39
Q
A