Infsci 2150: Introduction To Security and Privacy Lab: Operating Systems and Access Control
Infsci 2150: Introduction To Security and Privacy Lab: Operating Systems and Access Control
Students Name:
Date of Experiment:
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
Read the following guidelines before working in the lab
General Guidelines
To run this lab you need to configure Oracle VirtualBox 4.2.24 for Windows. You will also
need the Windows and Fedora virtual images. All these files are included in the provided
folder.
A written report is required for this assignment. You should submit a PDF version of this
document with your answers in the space provided. You should also attach extra sheets of
paper with your answers for some of the questions. Please label your extra sheets with your
name and indicate precisely which questions you are answering.
For the Windows assignment you will need to log on and log off from different user
accounts quite frequently. The log off option is not very visible in the operating system. So,
to log off from an account select Start (the Windows Icon in the lower left corner) and then
select the right arrow next to the lock icon presented in the window. The Log Off option
should become visible and you can now select it.
The Linux assignment requires root permission. Make sure you remember the password for
the root user when installing the Linux virtual machine.
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
I. Objective
The objective of the exercises presented here is to familiarize the student with the access
control features available in the Microsoft Windows and UNIX-based systems and to
compare them.
II. Equipment/Software
A PC with a Windows operating system (Windows XP and later versions) installed is
required for the lab. All the tools required for the lab is available in the lab from:
http://www.sis.pitt.edu/jjoshi/courses/IS2150/Spring15/Onlinelabs.zip
The zip-compressed file contains two folders:
• Tools: it contains the following files and folders
² VirtualBox-4.2.24-92790-Win.exe which is the installation file for Oracle
VirtualBox. It can be downloaded online from
https://www.virtualbox.org/wiki/Download_Old_Builds_4_2.
² IE11 - Win7.ova which is the Windows 7 Virtual Machine installation file. It can be
download online from https://www.modern.ie/en-us/virtualization-tools#downloads.
² Fedora-17-x86 which has the Fedora Image related files for the Oracle VirtualBox.
It can be download online from http://virtualboxes.org/images/fedora/.
• Labs: it includes zip files required for completing all the exercises in this lab.
Virtual Windows 7
1. After the VirtualBox is installed in your PC, please click IE11 - Win7.ova in the
Tools folder to install the Virtual Windows 7 on the VirtualBox.
2. In the Appliance settings, appropriately adjust the size of the RAM, click CD/DVD
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
and USB support, select the appropriate location for the Virtual Disk image, and
click the Import button. It may take you up to 30 minutes to finish this initialization.
3. After the initialization is completed, you will see a Windows 7 instance, named
IE11-Win7 by default, listed in the VirtualBox main frame. Select this instance and
click Settings button above.
4. In the Settings, click Network, and enable Adapter 1. In Adapter 1, select Attach to
VirtualBox Bridged Adapter and choose your active Ethernet card for Name. Spread
Advanced, select Allow All in Promiscuous Mode.
5. In the Settings, click Shared Folder, add the Labs folder and select Auto-mount.
6. Go back to VirtualBox main frame, select IE11-Win7 and click Start button above
to run the instance.
Virtual Fedora
1. Open the folder Fedora-17-x86 in the Tools folder and click Fedora-17-x86.vbox to
configure Fedora in the VirtualBox.
2. In the VirtualBox main frame, select Fedora-17-x86 and click the Setting button.
3. In the Settings, select General, click Advanced tab and appropriately select a folder
for Snapshot Folder.
4. In the Settings, click Network, and enable Adapter 1. In Adapter 1, select Attach to
VirtualBox Bridged Adapter and choose your active Ethernet card for Name. Spread
Advanced, select Allow All in Promiscuous Mode.
5. In the Settings, select Shared Folder, add the Labs folder and select Auto-mount.
6. Go back to VirtualBox main frame, select Fedora-17-x86 and click Start button
above to run the instance.
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
IV. Windows OS
Access control in Microsoft Windows OS
Access control refers to the ability of a user to access a particular object and possibly
modify it. In terms of operating systems, access control refers to the ability of a user to
read, write or execute a certain file or folder. In this laboratory, we shall study the access
control framework for Microsoft Windows and UNIX-based platforms, by taking Microsoft
Windows Vista and Linux as respective examples.
The Microsoft Windows 2000/XP/2003 and Vista series of OSs introduced access control
for files, directories and devices. Before we introduce access control for these operating
systems, let us take a look at how objects are
arranged in these systems.
The Active Directory service was introduced in
the Windows NT family of operating systems as
a means of arranging all users, devices and
objects at a centralized location and allowing
these networked entities to find each other
through this service. Entities are known as
objects and they are arranged into a hierarchical
structure by the administrators, known as the
logical structure. A collection of objects that
share the same security policies is known as a
domain (a container object) and multiple
domains can be arranged hierarchically into a Figure 1. Active Directory
tree. A forest is a complete instance of the Active
Directory that consists of a set of domains that trust each other through a two-way transitive
trust. This arrangement of objects into logical structures enables easy management of the
objects and allows for more flexible access control. The place Active Directory has in the
network is shown in Figure 1.
Every object (all users, groups, domains, processes) has a Security Identifier (SID)
associated with them that is a unique identification associated with it. The SID is very
similar to the UID in UNIX. Objects that have some operations associated with them and
whose access must be controlled are called securable objects. Securable objects have
security descriptors associated with them that consist of Discretionary Access Control
lists (DACLs), describing which users or groups have what access rights over them and
System Access Control Lists (SACLs) that describe how auditing is done and the SID of the
owner of the object. Every time an object is created, a security descriptor can be assigned
to it, but if it is not assigned, it will inherit it from its parent object.
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
A security context is associated with every process (or user) which describes which
groups it belongs to, what privileges it has and what accounts are associated with it. The
security context is maintained in an access token. Access Control Lists (ACLs) for an
object contain the SID of the intended trustee and an access mask for the various access
rights. When access is requested, the access token of the accessing object requesting, is
checked with the security descriptor of the accessed object, to see if the access should be
permitted or not. An example is given in Figure 2.
Access token
Revision
Revision Number
Number
Control User:
User: Mark
Mark
Control flags
flags
Owner Group1:
Group1: Administrators
Administrators
Owner SID
SID
Group Group2:
Group2: Writers
Writers
Group SID
SID
DACL
DACL Pointer
Pointer
SACL
SACL Pointer
Pointer
Security
Deny
Deny
descriptor • User Mark requests write permission
Writers
Writers • Descriptor denies permission to group
Read,
Read, Write
Write • Reference Monitor denies request
Allow
Allow
Mark
Mark
Read,
Read, Write
Write
For added security, to protect sensitive data, the Encrypted File System (EFS) was
introduced in the Windows NT family. The EFS allows users to encrypt objects created by
them so that no other object can access them. The encryption is done using an EFS
certificate that the user gets and multiple users can be added to allow access, with the help
of their EFS certificates.
Auditing in Windows
The family of Windows OS products from Windows 2000 onwards provides audit functions
that include the following basic functions:
- audit collection
- audit review
- audit log overflow protection
- audit log restricted access protection
By default, at installation, only application logs and error logs are collected and stored by
the Audit function. The server administrator must enable security auditing on the machine.
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
Lab Procedures
Read the lab procedures before starting work in the lab. If you have any questions,
clarify them with the GSA or the instructor. This will make your work in the lab more
efficient.
Exercise 1.2: Studying the effects of using the Read-Only and Hidden attributes of a
file.
1. Log in as IEUser
2. Open the Notepad application to create a text document (Start->All Programs ->
Accessories -> Notepad)
3. Type some text in the document and save it in the C:\doctemp folder with the name
file1_group<gr#>.txt
4. Open the C:\doctemp folder and open the Properties window for the file you just
created by doing a clicking with the right button of the mouse over the file and
selecting Properties from the menu.
5. In the Attributes section, mark the Read-Only attribute and then click OK
6. Open the file again, add some text and try to save the changes.
a. What happens? Explain why it happens.
____________________________________________________________
___________________________________________________
___________________________________________________
___________________________________________________
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
___________________________________________________
____________________________________________________________
Exercise 1.3: Explicitly assigning permissions to different users for a given file.
1. Log in as IEUser.
2. Use Notepad to create a .txt document and save it in the C:/doctemp folder with
file2_group<gr#>.txt as the filename.
3. Open the C:\doctemp folder and open the Properties window for the file you just
created.
4. Select the Security tab. Click on the Edit… button
5. Click on the Add... button and add the user group<gr#>A to the file by typing
group<gr#>A in the text box field. Click on the Check Names button. If no errors
are reported, click on OK. Click the other OK buttons until you return to the
Properties window and Security tab is active.
6. Select the user you just added by clicking on its username. What are the default
permissions given to this user? While still viewing the Security tab options for this
file see the permissions assigned to the group called Users. Are the default
permissions for this group different than those of the user you added to have access
to the file?
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
7. View the advanced set of permissions for access to this file for user group<gr#>A.
To do this, open the Security tab in the Properties window for this file, select the
user, press the Advanced button, select the user again in the new window and press
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
Change Permissions , again select the user and press the Edit button
8. What do you see? How is it different than the permissions in the parent security tab?
Is there any relation?
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
________________________________________________________
8. Mark the List folder contents permission under the Deny column. Click OK and
approve all changes.
9. Log off from the IEUser account and log in as group<gr#>A
10. Open the Notepad application to create a text document (Start->All Programs ->
Accessories -> Notepad)
11. Type some text in the document and save it in the C:\doctemp\folder<gr#> folder
with the name file3_group<gr#>.txt
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
12. Open the C:\doctemp\folder<gr#> folder and verify that you can open the
document you just created.
13. Logoff from the group<gr#>A account and log in as the group<gr#>B user
14. Open the C:\doctemp\folder<gr#>. Explain what happens when you access the
folder and why?
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
Questions
1. Can you view security logs as normal users? Should normal users be able to view
security logs? Why?
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
8. For this exercise mark the List folder/Read Data and Create files/write data under
the Successful column. Click on OK and approve changes on all windows.
9. Log off from IEUser and log in as the group<gr#>B user.
10. Use Notepad to create a .txt document and save it in the
C:\doctemp\folder2_<gr#> folder with file4_group<gr#>.txt as the filename.
11. Open the C:\doctemp\folder2_<gr#> folder and verify that you can access the file
you just created
12. Log off group<gr#>B and log in as the IEUser user.
13. Open the event viewer. (Start->Control Panel->System and Security-
>Administrative tools -> Event Viewer)
14. Once in the Event Viewer, select Windows Logs category (left side of the
window) and select the Security category.
15. We will search the Security log for the audit entries related to the group<gr#>B
user. To do this, in the Actions panel of the window (right side of the window)
select the Find… command and write group<gr#>B in the find box.
16. Study the entries in the security log that don’t belong to Logoff or Log on
attempts. In particular study the ones that belong to File System access and that
register in the Access Request Information a Read Data or ListDirectory event. You
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
might have to go through several log entries until you find the ones that meet this
criteria. What is the event ID registered for these entries?
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
__________________________________________________________
17. To finish this part of the lab, do the steps mentioned in Exercise 1.6 but disable
object access auditing.
V. Linux
File Hierarchy
The Unix file
/
system is organized
as a hierarchy with
the root (/) at the usr bin … home test
highest level from
which directories
and files may exist. user1 user2 temp link_hello
Typically, some of
the directories that
may occur under hello.txt
the root are usr,
bin, sbin, home,
Figure 3. Example of File Hierarchy
var, boot, dev, etc,
etc. In Figure 3 shown above, user1 and user2 are sub-directories under home. hello.txt is
a plain-text file and link_hello is a linking file that points to hello.txt. In order to access
the file /test/temp/hello.txt, the system begins its search from the root(/) folder and then to
test and temp folders consecutively and then finally the file hello.txt.
Permission Bits
Extra owner group others
su sg t r w x r w x r w x
1
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
Lab procedures
Note: To enter the commands required for this assignment you will need to activate a text
terminal application to enter the required commands. If you want to work inside Fedora’s
graphical environment look for and activate the Terminal application in one of Fedora’s main
menus. Otherwise, to exit the graphical environment and enter directly to a text terminal, press
Ctrl-Alt-F3.
What are the directory permissions for user1, user2 and test directories?
________________________________________________
________________________________________________
________________________________________________
3
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
hello.txt is as follows: “100 111 101 100.” This can be achieved in several ways
using chmod command:
1. chmod 4754 hello.txt
2. chmod u+srwx g+rx o+r hello.txt
3. chmod u=srwx, g=rx, o=r hello.txt
1. In the /test/temp/ directory, as root user, create a new text file (“hello.txt”) and fill
it with some text.
a. echo something > /test/temp/hello.txt
2. Create a link link_hello in the test folder pointing to hello.txt in the temp folder
(refer to file structure in introduction)
b. cd /
c. ln -s /test/temp/hello.txt /test/link_hello
Is there any difference in file permissions of link_hello and hello.txt?
________________________________________________
________________________________________________
________________________________________________
1. In a terminal window, make sure you are a root user. If not the root user, then
switch back to root user.
2. Use umask command to check the current mask permission and assign a new
mask.
4
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
a. Umask
b. What is the current mask? How is it interpreted? (try umask –S or the man
pages)
c. cd /test
d. touch testmask1
e. ls –al
f. What are the permissions of the file testmask1
g. umask 0077
h. touch testmask2
i. Now what are the permissions of the file testmask2
4. The risks of setting the extra bits (i.e. assigning value ‘1’) will be covered in
Exercise 2.5 which shows that extra bits should not be set, in general. What
should be the umask value to ensure that the extra bits cannot be set?
________________________________________________
________________________________________________
________________________________________________
In the following exercise, the objective is to demonstrate how processes are affected
when the setuid bit is set. The exercise must be begun with root privileges.
a. which touch
b. ls –l /bin/touch
c. chmod 4755 /bin/touch
d. ls –l /bin/touch
5
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
e. ls –l /home/user2
f. chmod 700 /home/user2/HelloWorld
g. ls –l /home/user2 (observe timestamp and permissions)
h. su user1
i. touch /home/user2/HelloWorld
j. ls –l /home/user2 (observe timestamp, is it updated?)
k. su root
l. chmod 0755 /bin/touch
m. su user1
n. touch /home/user2/HelloWorld
1. su root
2. umask 0022
3. chmod 0755 /bin/touch
4. userdel user1
5. userdel user2
6. rm –rf /home/user1
7. rm –rf /home/user2
8. rm –rf /test
9. rm –rf /home/test/
Questions
1. How different is the UNIX access control architecture from that of Windows
based platforms?
6
Graduate Program in Information Science and Telecommunications and Networking
School of Information Sciences
University of Pittsburgh
_______________________________________________________
_______________________________________________________
_______________________________________________________
_______________________________________________________