If you can see this check that

  • Javascript is enabled

SELinux Usage

To reset all the check buttons from a previous attempt click here

Question 1 Basic Labelling

Create 2 directories in /root, "secure" and "protect". Set the SELinux type of secure to system_conf_t, and set the type of protect to etc_t.

Tests: Ready
 
Directories exist UNTESTED
Type secure UNTESTED
Type protect UNTESTED

Create a file called "test1" in secure, and "test2" in protect. Look at the types of these files. How does the types of these new files get decided?

Tests: Ready
 
How type is set UNTESTED
Directories exist UNTESTED

Copy test1 to protect/test3. What happens to the test3 type in comparison to test1?

Tests: Ready
 
How type is set UNTESTED
File copied UNTESTED

Rename secure/test1 to protect/test4. What happens to the test4 type in comparison to the type test1 was when it was in secure (system_conf_t)?

Tests: Ready
 
How type is set UNTESTED
File copied UNTESTED

Use matchpathcon to find the type which would be set if you did a restorecon on protect/test2. Save the output of matchpathcon to /root/match1. What type would be set if you did do restorecon?

Tests: Ready
 
Type unchanged UNTESTED
matchpathcon type UNTESTED
matchpathcon output UNTESTED

Use semanage and list all of the fcontext entries, grepping the list for those which start with /root. Grep through this with the restorecon type from the previous question. This should reduce the list to just 1 regular expression, i.e. the one which matchpathcon used to produce the answer above. What is that expression?

Tests: Ready
 
Regular expression UNTESTED

Add a rule to semanage fcontext so that any files in /root/ which end with .bin will be set to type bin_t. Create a file /root/test.bin and do a restorecon on that file to confirm it takes on bin_t.

Tests: Ready
 
Check dot escaped UNTESTED
Check in root UNTESTED
Check in subdir UNTESTED

Question 2 Boolean control

In this section we will practice accessing and using a selinux boolean.

There is a boolean called httpd_tmp_exec. Is the boolean on or off?

Tests: Ready
 
Status correct UNTESTED

Change the boolean called httpd_tmp_exec to on.

Tests: Ready
 
Status on UNTESTED

Find out all allow rules which are switched on by setting this boolean to on. Save the output of sesearch to /root/boolrule. When you search, find all rules, unrestricted by source types.

Tests: Ready
 
File correct UNTESTED

Question 3 Auditing

Click on the button to cause a mislabelling error for httpd.

Tests: Ready
 
Error caused UNTESTED

Start httpd with systemctl. It should fail... this should cause an event.

Tests: Ready
 
Status looks like a fail UNTESTED
At least 1 audit event in last 10 mins UNTESTED

Save the AVC event to /root/event. MAKE SURE ONLY THE AVC EVENT IS SAVED, AND THERE IS ONLY 1 AVC LINE.

Tests: Ready
 
File looks plausable - count UNTESTED
File looks plausable - content UNTESTED

Use the inode information from the event. What is the full pathname of the directory in the event?

Tests: Ready
 
Pathname correct UNTESTED

Use restorecon on that single directory to fix the label. Confirm that httpd now starts.

Tests: Ready
 
Label fixed UNTESTED
httpd running UNTESTED

Centos 7 introPaths | BasicShell | Search
Linux tutorialsintro1 | intro2 | wildcard | permission | pipe | vi | essential | admin | net | SELinux1 | SELinux2 | fwall | DNS | diag | Apache1 | Apache2 | log | Mail
Caine 10.0Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Mock Exam
Caine 13.0Essentials | Basic | Search | Acquisition | SysIntro | grep | MBR | GPT | FAT | NTFS | FRMeta | FRTools | Browser | Registry | Mock Exam
Kali 2020-41a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10
Kali 2024-41a | 1b | 1c | 2 | 3 | 4a | 4b | 5 | 6 | 7 | 8a | 8b | 9 | 10
UsefulPrivacy Policy | Terms and Conditions

Linuxzoo created by Gordon Russell.
@ Copyright 2004-2025 Edinburgh Napier University