110.1 Perform Security Administration Tasks Flashcards

(51 cards)

1
Q

Gain privileges for user bob, load bob’s home directory and environment variables.

A

su - bob

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

Executes a command as user moo and immediately returns to your user account.

A

su -c some_command moo

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

Shows who is logged on and what they are doing.

A

w

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

Shows who is currently logged in.

A

who

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

Shows the history of user login and logout along with the time and date.

A

last

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

Scan all devices on the 192.168.1.0 network for open ports, timing 5 seconds.

A

nmap -T5 192.168.1.0/24

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

Scan all hosts on 192.168.1.0 network for ports 1-12345, treat all hosts as online to avoid ICMP (ping).

A

nmap -Pn -p1-12345 192.168.1.0/24

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

Scan all devices on the 192.168.1.0 network and determine the operating systems for each host.

A

sudo nmap -O 192.168.1.0/24

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

Show protocol statistics for IP, TCP, UDP, ICMP.

A

netstat -s

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

Show the routing table.

A

netstat -r

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

Show all ports on the network in numeric format.

A

netstat -na

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

Show only listening sockets in numeric format.

A

netstat -nl

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

Find out which process is using port 33737/tcp, verbose.

A

fuser -v -n tcp 33737

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

List open files for device sda3, like a USB flash drive needing to be unmounted.

A

lsof | grep ‘/dev/sda3’

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

List processes listening on port 23.

A

lsof -i :23

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

Kills all processes using the Data file system or folder so that it can be unmounted.

A

fuser -km Data

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

Find files owned by root under / with mounted filesystems excluded and suid or sgid bit set.

A

find / -xdev -user root ( -perm -4000 -o -perm -2000 )

find / -xdev -user root ( -perm /u=s -o -perm /g=s )

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

Find files in home directory modified in the last 24 hours (last access time / 24 with remainder < 24).

A

find $HOME -mtime 0

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

Find files in home directory modified in the last 24 hours, exclude hidden files and directories.

A

find $HOME ( ! -regex ‘./..’ ) -mtime 0

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

Where is the EDITOR environment variable set?

A

~/.bashrc

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

Sets the max amount of virtual memory available to the shell.

22
Q

View the user hard limit for the max number of open files.

23
Q

Prevent application crashes from creating core dumps.

24
Q

List all user limits.

25
Set user CPU limits.
ulimit -t
26
Change login name for user moo to zoo.
usermod -l zoo moo
27
Set the day the password was last changed so user moo will be prompted to enter a new password on login.
chage -d 0 moo
28
List password info for user moo.
chage -l moo
29
Expire user moo's password and force them to change it on next login.
passwd -e moo
30
show the password status for all users.
passwd -a -S
31
Delete moo's password thus disabling moo's ability to log in.
passwd -d moo
32
Unlock moo's account.
passwd -u moo | usermod -U moo
33
Lock moo's account.
passwd -l moo | usermod -L moo
34
Change password for user moo.
sudo passwd moo
35
Command used to audit the system including suid system calls and the /etc/audit/audit.rules log file.
auditd
36
Sets the memory usage limit on your system.
setrlimit
37
Gets the memory usage limit on your system.
getrlimit
38
The file that overrides the limits.conf file.
limits.d
39
Full path to the file that contains the config info for sudo, modified with visudo.
/etc/sudoers
40
Full path to file that if changed requires restarting auditd service, and the command to perform the restart.
/etc/audit/audit.rules service auditd restart systemctl restart auditd
41
Find files in /usr/bin with suid set.
find /usr/bin -perm -u+s find /usr/bin -perm -4000 find /usr/bin -perm /u=s
42
Permissions when sgid is set on a file.
Permissions of the set group rather than permissions of the current user's group.
43
su stands for what?
substitute user
44
Add new user moo and create their home directory.
useradd -m moo
45
Clear any credentials for yourself.
sudo -k
46
Give regular user moo permission to run useradd and passwd commands but not to change the root user's password.
sudo visudo | moo ALL=(root) /usr/sbin/useradd, /etc/passwd, !/etc/passwd root
47
Add moo to the sudo secondary group.
usermod -G 27 moo
48
View permissions for user moo.
id moo
49
Temporarily increase the number of open files limit for your user account to 2048.
ulimit -n 2048 Display open file limit: ulimit -n 2048
50
Full path to limits.conf file.
/etc/security/limits.conf
51
Find files in /usr/bin with sgid set.
find /usr/bin -perm -g+s find /usr/bin -perm -2000 find /usr/bin -perm /g=s