UTS Namespace
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:
HackTricks Training GCP Red Team Expert (GRTE)
Basic Information
A UTS (UNIX Time-Sharing System) namespace is a Linux kernel feature that provides isolation of two system identifiers: the hostname and the NIS (Network Information Service) domain name. This isolation allows each UTS namespace to have its own independent hostname and NIS domain name, which is particularly useful in containerization scenarios where each container should appear as a separate system with its own hostname.
How it works:
When a new UTS namespace is created, it starts with a copy of the hostname and NIS domain name from its parent namespace. This means that, at creation, the new namespace shares the same identifiers as its parent. However, any subsequent changes to the hostname or NIS domain name within the namespace will not affect other namespaces.
Processes within a UTS namespace can change the hostname and NIS domain name using the
sethostname()
andsetdomainname()
system calls, respectively. These changes are local to the namespace and do not affect other namespaces or the host system.Processes can move between namespaces using the
setns()
system call or create new namespaces using theunshare()
orclone()
system calls with theCLONE_NEWUTS
flag. When a process moves to a new namespace or creates one, it will start using the hostname and NIS domain name associated with that namespace.
Lab:
Create different Namespaces
CLI
By mounting a new instance of the /proc
filesystem if you use the param --mount-proc
, you ensure that the new mount namespace has an accurate and isolated view of the process information specific to that namespace.
Docker
Check which namespace is your process in
Find all UTS namespaces
Enter inside an UTS namespace
Last updated