{"id":29880,"date":"2019-10-31T21:32:27","date_gmt":"2019-10-31T18:32:27","guid":{"rendered":"https:\/\/prohoster.info\/blog\/milliony-binarnikov-spustya-kak-ukreplyalsya-linux\/"},"modified":"2019-10-31T21:32:27","modified_gmt":"2019-10-31T18:32:27","slug":"milliony-binarnikov-spustya-kak-ukreplyalsya-linux","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/milliony-binarnikov-spustya-kak-ukreplyalsya-linux","title":{"rendered":"Millions of binaries later. How Linux has strengthened","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/bf51e5698530d4a6a44ff97f542a2a87.png\" style=\"display:block;margin: 0 auto;\" \/><b>TL;DR<\/b>In this article, we explore hardening schemes that work out of the box in five popular Linux distributions. For each, we took the default kernel configuration, loaded all packages, and analyzed the protection schemes in nested binaries. The distributions considered are OpenSUSE 12.4, Debian 9, CentOS, RHEL 6.10 and 7, as well as Ubuntu 14.04, 12.04, and 18.04 LTS. <\/p>\n<p>The results confirm that even basic schemes, such as stack canaries and position-independent code, are still not widely used. The situation is even worse for compilers when it comes to protection against vulnerabilities like stack clash, which gained attention in January after the disclosure of <noindex><a rel=\"nofollow\" href=\"https:\/\/capsule8.com\/blog\/exploiting-systemd-journald-part-1\/\">vulnerabilities in systemd.<\/a><\/noindex>However, not everything is hopeless. A significant portion of binaries implement basic protection methods, and their number is increasing with each version. <\/p>\n<p>The assessment showed that the highest number of protection methods is implemented in Ubuntu 18.04 at the OS and application levels, followed by Debian 9. On the other hand, OpenSUSE 12.4, CentOS 7, and RHEL 7 also implement basic protection schemes, with stack clash protection being applied even more broadly with a much denser default package set.<br \/>\n<noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h1>Introduction<\/h1>\n<p>\nEnsuring high software quality is challenging. Despite the vast array of advanced tools for static code analysis and dynamic runtime analysis, as well as significant progress in compiler and programming language development, modern software still suffers from vulnerabilities that are constantly exploited by malicious actors. The situation is exacerbated in ecosystems that include legacy code. In such cases, we not only face the perennial challenge of identifying potential exploitable bugs but are also constrained by rigid backward compatibility requirements that often necessitate retaining outdated, and in worse cases, vulnerable or buggy code.<\/p>\n<p>This is where protection or hardening methods come into play. Some types of errors we are unable to prevent, but we can make life harder for attackers and partially address the problem by preventing or obstructing <i>exploitation<\/i> these errors. Such protection is used in all modern operating systems, but the methods vary significantly in complexity, effectiveness, and performance: from stack canaries and <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Address_space_layout_randomization\">ASLR<\/a><\/noindex> to full-fledged protections <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Control-flow_integrity\">CFI<\/a><\/noindex> and <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Return-oriented_programming\">, Return-Oriented Programming), but uses nonexistent snippets of machine code to build a chain of calls ('gadgets') instead of actual machine code fragments, embedding them in subqueries within SELECT.<\/a><\/noindex>. In this article, we will examine what protection methods are employed in the most popular Linux distributions by default, as well as explore the properties of binaries distributed through the package management systems of each distribution.<\/p>\n<h3>CVE and security<\/h3>\n<p>\nWe have all seen articles with titles like \"The Most Vulnerable Applications of the Year\" or \"The Most Vulnerable Operating Systems.\" Typically, they present statistics on the total number of records for vulnerabilities of the type <noindex><a rel=\"nofollow\" href=\"https:\/\/cve.mitre.org\/\">CVE (Common Vulnerabilities and Exposures)<\/a><\/noindex>, obtained from <noindex><a rel=\"nofollow\" href=\"https:\/\/nvd.nist.gov\/\">the National Vulnerability Database (NVD)<\/a><\/noindex> from <noindex><a rel=\"nofollow\" href=\"https:\/\/www.nist.gov\/\">NIST<\/a><\/noindex> and other sources. Consequently, these applications or OS are ranked based on the number of CVEs. Unfortunately, while CVEs are very useful for tracking issues and informing vendors and users, they say little about the actual security of the software.<\/p>\n<p>For example, let\u2019s look at the total number of CVEs over the past four years for the Linux kernel and the five most popular server distributions, namely Ubuntu, Debian, Red Hat Enterprise Linux, and OpenSUSE.<\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/16d74634f010e340aedbce441513e3f8.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Figure 1<\/i><\/p>\n<p>What does this graph tell us? Does a higher number of CVEs mean that one distribution is more vulnerable than another? The answer is no. For instance, in this article, you will see that Debian implements stricter security mechanisms compared to OpenSUSE or Red Hat Linux, yet Debian has more CVEs. However, this does not necessarily mean weakened security: the presence of CVEs does not indicate whether a vulnerability is <i>exploitable<\/i>. Severity scores provide insight into how likely it is that a vulnerability will be exploited, but ultimately exploitability largely depends on the defenses present in the affected systems, as well as the resources and capabilities of malicious actors. Moreover, the absence of CVE reports does not indicate anything about other <i>unregistered or unknown<\/i> vulnerabilities. <i>unregistered or unknown<\/i> vulnerabilities. The difference in CVE may be explained not by the quality of the software but by other factors, including the resources allocated for testing or the size of the user base. In our example, a higher number of CVE for Debian may simply indicate that Debian provides more software packages. <\/p>\n<p>Of course, the CVE system provides useful information that allows for creating appropriate defenses. The better we understand the reasons for program failures, the easier it is to identify potential exploitation methods and develop corresponding mechanisms. <i>detection and response<\/i>. Figure 2 shows categories of vulnerabilities for all distributions over the past four years (<noindex><a rel=\"nofollow\" href=\"https:\/\/www.cvedetails.com\/top-50-products.php\">source<\/a><\/noindex>). It is immediately clear that most CVEs fall into the following categories: denial of service (DoS), code execution, overflow, memory corruption, information leakage (exfiltration), and privilege escalation. Although many CVEs are counted multiple times in different categories, the same issues persist year after year. In the next part of the article, we will evaluate the use of various protection schemes to prevent the exploitation of the specified vulnerabilities.<\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/45948bc64673540cfb3e1774c3247634.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Figure 2<\/i><\/p>\n<h3>Since I have already learned to \"somewhat\" port QEMU to JavaScript, this time it was decided to do it wisely and not repeat past mistakes.<\/h3>\n<p>\nIn this article, we intend to answer the following questions:<\/p>\n<ul>\n<li>What is the security of various Linux distributions? What protective mechanisms exist in the kernel and user space applications?\n<\/li>\n<li>How has the adoption of protection mechanisms changed over time for different distributions?\n<\/li>\n<li>What are the average dependencies of packages and libraries for each distribution?\n<\/li>\n<li>What protections are implemented for each binary?<\/li>\n<\/ul>\n<p><\/p>\n<h3>Choice of distributions<\/h3>\n<p>\nIt turns out to be difficult to find accurate statistics on distribution installations, as in most cases the number of downloads does not indicate the number of actual installations. Nevertheless, Unix options make up the majority of server systems (69.2% on web servers, according to W3techs and other sources), and their share is continually growing. Thus, for our research, we focused on distributions available out of the box on the platform <noindex><a rel=\"nofollow\" href=\"https:\/\/w3techs.com\/technologies\/overview\/operating_system\/all\">statistics<\/a><\/noindex> . In particular, we selected the following OS: <noindex><a rel=\"nofollow\" href=\"https:\/\/cloud.google.com\/\">Google Cloud<\/a><\/noindex>Distribution\/version<\/p>\n<p>Build<br \/>\nKernel<br \/>\nOpenSUSE 12.4<\/p>\n<p>4.12.14-95.3-default<br \/>\nDebian 9 (stretch)<br \/>\n#1 SMP Wed Dec 5 06:00:48 UTC 2018 (63a8d29)<\/p>\n<p>4.9.0-8-amd64<br \/>\nCentOS 6.10<br \/>\n#1 SMP Debian 4.9.130-2 (2018-10-27)<\/p>\n<p>2.6.32-754.10.1.el6.x86_64<br \/>\n3.10.0-957.5.1.el7.x86_64<br \/>\n#1 SMP Tue Jan 15 17:07:28 UTC 2019<\/p>\n<p>CentOS 7<br \/>\nRed Hat Enterprise Linux Server 6.10 (Santiago)<br \/>\n#1 SMP Fri Feb 1 14:54:57 UTC 2019<\/p>\n<p>2.6.32-754.9.1.el6.x86_64<br \/>\nRed Hat Enterprise Linux Server 7.6 (Maipo)<br \/>\n#1 SMP Wed Nov 21 15:08:21 EST 2018<\/p>\n<p>3.10.0-957.1.3.el7.x86_64<br \/>\n3.10.0-957.1.3.el7.x86_64<br \/>\n#1 SMP Thu Nov 15 17:36:42 UTC 2018<\/p>\n<p>Ubuntu 14.04 (Trusty Tahr)<br \/>\n4.4.0\u2013140-generic<br \/>\n <br \/>\n#166~14.04.1-Ubuntu SMP Sat Nov 17 01:52:43 UTC 20\u2026<\/p>\n<p>Ubuntu 16.04 (Xenial Xerus)<br \/>\n4.15.0\u20131026-gcp<br \/>\n#27~16.04.1-Ubuntu SMP Fri Dec 7 09:59:47 UTC 2018<\/p>\n<p>Ubuntu 18.04 (Bionic Beaver)<br \/>\n4.15.0\u20131026-gcp<br \/>\n#27-Ubuntu SMP Thu Dec 6 18:27:01 UTC 2018<\/p>\n<p><i>Table 1<\/i> <\/p>\n<h1>Analysis<\/h1>\n<p>\nWe will examine the default kernel configuration and the properties of the packages available through the package manager for each distribution out of the box. Thus, we consider only packages from the default mirrors of each distribution, ignoring packages from unstable repositories (for example, the 'testing' mirrors in Debian) and third-party packages (like Nvidia packages from standard mirrors). Additionally, we do not consider user-compiled kernels or configurations with enhanced security.<\/p>\n<h3>Kernel Configuration Analysis<\/h3>\n<p>\nWe applied an analysis script based on <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/a13xp0p0v\/kconfig-hardened-check\">the free kconfig checker<\/a><\/noindex>. We examine the out-of-the-box security parameters for the mentioned distributions and compare them with the list from <noindex><a rel=\"nofollow\" href=\"http:\/\/kernsec.org\/wiki\/index.php\/Kernel_Self_Protection_Project\/Recommended_Settings\">the Kernel Self-Protection Project<\/a><\/noindex> (KSPP). For each configuration parameter, Table 2 describes the desired setting: a checkmark indicates distributions that comply with KSSP recommendations (for clarification of terms see <noindex><a rel=\"nofollow\" href=\"https:\/\/capsule8.com\/blog\/kernel-configuration-glossary\/\">here<\/a><\/noindex>; in future articles, we will discuss how many of these protective measures were developed and how to compromise the system in their absence).<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/dx\/oh\/o0\/dxoho0z-lifjcybajszqb-aiirq.png\"><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/b1a42826f4afc78a2b25d158100b2ba4.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/2177579e65e4fe6bb320903756a04b9b.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\nOverall, newer kernels have stricter out-of-the-box settings. For instance, CentOS 6.10 and RHEL 6.10 on kernel 2.6.32 lack most critical features implemented in newer kernels, such as <noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Supervisor_Mode_Access_Prevention\">SMAP<\/a><\/noindex>, strict RWX permissions, address randomization, or copy2usr protection. It should be noted that many of the configuration options from the table are absent in older kernel versions and are not applicable in practice \u2014 in the table, this is nevertheless indicated as lack of adequate protection. Similarly, if a configuration parameter is absent in this version, and disabling this parameter is necessary for security, this is considered a reasonable configuration. <\/p>\n<p>Another point when interpreting results: some kernel configurations that increase the attack surface can also be used for security. Examples include uprobes and kprobes, kernel modules, and BPF\/eBPF. Our recommendation is to utilize the aforementioned mechanisms for providing real protection, as they are non-trivial to use, and their exploitation assumes that malicious actors are already embedded in the system. However, if these options are enabled, the system administrator must actively monitor for abuses.<\/p>\n<p>Examining the entries in Table 2 further, we see that modern kernels provide several options for protecting against the exploitation of vulnerabilities such as information leaks and stack\/heap overflows. However, we note that even the latest popular distributions have not yet implemented more complex protections (for example, with patches <noindex><a rel=\"nofollow\" href=\"https:\/\/grsecurity.net\/\">grsecurity<\/a><\/noindex>) or modern protections against code reuse attacks (such as <noindex><a rel=\"nofollow\" href=\"http:\/\/www.cs.columbia.edu\/~theofilos\/files\/slides\/krx.pdf\">a combination of randomization with R^X-type schemes for code<\/a><\/noindex>). What's worse, even these more advanced protections do not safeguard against the full spectrum of attacks. Thus, it is crucial for system administrators to complement reasonable configurations with solutions that offer detection and prevention of exploits at runtime.<\/p>\n<h3>Application Analysis<\/h3>\n<p>\nIt is not surprising that different distributions have varying package characteristics, compilation options, library dependencies, etc. Differences exist even for <noindex><a rel=\"nofollow\" href=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/1\/1b\/Linux_Distribution_Timeline.svg\">related<\/a><\/noindex> distributions and packages with a minimal number of dependencies (for example, coreutils in Ubuntu or Debian). To evaluate the differences, we downloaded all available packages, extracted their contents, and analyzed the binaries and dependencies. For each package, we tracked other packages on which it depends, and for each binary, we tracked its dependencies. In this section, we will summarize the findings.<\/p>\n<h4>Distributions<\/h4>\n<p>\nIn total, we have uploaded 361,556 packages for all distributions, extracting only packages from default mirrors. We ignored packages without ELF executable files, such as source codes, fonts, etc. After filtering, 129,569 packages remained, containing a total of 584,457 binary files. The distribution of packages and files across distributions is shown in Fig. 3.<\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/a24975fba7413ac8069c07412e5476cc.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Fig. 3<\/i><\/p>\n<p>It can be observed that the more modern the distribution, the more packages and binary files it contains, which is logical. Furthermore, the packages for Ubuntu and Debian include significantly more binary files (both executables and dynamic modules and libraries) than CentOS, SUSE, and RHEL, which potentially affects the attack surface of Ubuntu and Debian (it should be noted that the figures reflect all binaries from all package versions, meaning some files are analyzed multiple times). This is particularly important given the dependencies between packages. Thus, a vulnerability in a binary of one package can impact many parts of the ecosystem, just as a vulnerable library can affect all binary files that import it. As a starting point, let\u2019s examine the distribution of dependency counts across packages in various OSs:<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/ii\/e3\/e5\/iie3e5-ei26ezg5yvcyvtzqzl80.png\"><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/c6570e643d92103c87659e61f5d395a6.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><br \/>\n<i>Fig. 4<\/i> <\/p>\n<p>In almost all distributions, 60% of packages have at least 10 dependencies. Moreover, some packages have significantly more dependencies (over 100). The same applies to reverse package dependencies: as expected, several packages are used by many other packages in the distribution, so vulnerabilities in these select few carry a high risk. As an example, the following table lists 20 packages with the maximum number of reverse dependencies in SLES, CentOS 7, Debian 9, and Ubuntu 18.04 (each cell indicates the package and the number of reverse dependencies).<\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/0aa544db8be1af7bffe21b6314537e18.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Table 3<\/i><\/p>\n<p>An interesting fact. Although all analyzed OSs are built for the x86_64 architecture, and most packages are defined for the x86_64 and x86 architectures, packages often contain binary files for other architectures, as shown in Fig. 5.<\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/b40f607e0c2f169bd1df21bd9994de8c.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Fig. 5<\/i><\/p>\n<p>In the next section, we will delve into the characteristics of the analyzed binaries.<\/p>\n<h4>Statistics on binary file protection<\/h4>\n<p>\nAs an absolute minimum, it is necessary to study the basic set of protection options for existing binary files. Several Linux distributions come with scripts that perform such checks. For example, in Debian\/Ubuntu, there is such a script. Here is an example of its operation:<\/p>\n<pre><code class=\"bash\">$ hardening-check $(which docker)\n\/usr\/bin\/docker:\n Position Independent Executable: yes\n Stack protected: yes\n Fortify Source functions: no, only unprotected functions found!\n Read-only relocations: yes\n Immediate binding: yes<\/code><\/pre>\n<p>\nThe script checks five <noindex><a rel=\"nofollow\" href=\"http:\/\/manpages.ubuntu.com\/manpages\/trusty\/man1\/hardening-check.1.html\">protection functions<\/a><\/noindex>:<\/p>\n<ul>\n<li>Position Independent Executable (PIE): indicates whether the text section of a program can be relocated in memory to achieve randomization if ASLR is enabled in the kernel.\n<\/li>\n<li>Stack Protected: indicates whether stack canaries are enabled to protect against stack collision attacks.\n<\/li>\n<li>Fortify Source: indicates whether unsafe functions (e.g., strcpy) are replaced with their safer counterparts, while runtime checks are replaced with their unchecked equivalents (e.g., memcpy instead of __memcpy_chk).\n<\/li>\n<li>Read-only relocations (RELRO): indicates whether relocation table entries are marked as \"read-only\" if they were triggered before program execution begins.\n<\/li>\n<li>Immediate binding: indicates whether the runtime linker resolves all relocations before the program begins execution (this is equivalent to full RELRO).<\/li>\n<\/ul>\n<p>\nAre the aforementioned mechanisms sufficient? Unfortunately, no. There are known methods to bypass all of the above protections, but the more stringent the protection, the higher the bar for the attacker. For example, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.usenix.org\/system\/files\/conference\/usenixsecurity15\/sec15-paper-di-frederico.pdf\">RELRO bypass methods<\/a><\/noindex> are harder to apply if PIE and immediate binding are in effect. Similarly, full ASLR requires additional work to create a working exploit. However, sophisticated attackers are already prepared to confront such protections: their absence essentially accelerates a breach. Therefore, it is crucial that these measures are viewed as essential. <i>at least<\/i>. <\/p>\n<p>We wanted to study how many binary files in the examined distributions are protected by these, as well as three other methods:<\/p>\n<ul>\n<li>The non-executable bit (<noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Executable_space_protection\">NX<\/a><\/noindex>) prevents execution in any region that should not be executable, such as the stack heap, etc.<\/li>\n<li><noindex><a rel=\"nofollow\" href=\"https:\/\/en.wikipedia.org\/wiki\/Rpath\">RPATH\/RUNPATH<\/a><\/noindex> indicates the runtime path used by the dynamic loader to search for the appropriate libraries. The former is <i>mandatory.<\/i> For any modern system: its absence allows attackers to arbitrarily write a payload into memory and execute it as is. For the second, incorrect execution path configurations allow for the introduction of unreliable code, potentially leading to a number of issues (for example, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.nth-dimension.org.uk\/pub\/BTL.pdf\">privilege escalation<\/a><\/noindex>, as well as <noindex><a rel=\"nofollow\" href=\"https:\/\/wiki.debian.org\/RpathIssue\">other issues<\/a><\/noindex>).<\/li>\n<li>Stack collision protection safeguards against attacks that force the stack to overlap with other memory areas (for instance, the heap). Given the recent exploits that abuse <noindex><a rel=\"nofollow\" href=\"https:\/\/capsule8.com\/blog\/exploiting-systemd-journald-part-1\/\">heap collision vulnerabilities in systemd<\/a><\/noindex>, we deemed it appropriate to include this mechanism in our dataset.<\/li>\n<\/ul>\n<p>\nSo, without further ado, let's move to the numbers. Tables 4 and 5 contain a summary of the analysis of executable files and libraries from various distributions, respectively.<\/p>\n<ul>\n<li>As can be seen, NX protection is implemented everywhere, with rare exceptions. Notably, there is somewhat lower usage in the Ubuntu and Debian distributions compared to CentOS, RHEL, and OpenSUSE.\n<\/li>\n<li>Stack canaries are often absent, especially in distributions with older kernels. Some progress is observed in the latest distributions of CentOS, RHEL, Debian, and Ubuntu.\n<\/li>\n<li>With the exception of Debian and Ubuntu 18.04, the support for PIE is poor in most distributions.\n<\/li>\n<li>Stack collision protection is weakly implemented in OpenSUSE, CentOS 7, and RHEL 7 and is practically absent in the others.\n<\/li>\n<li>All distributions with modern kernels have some support for RELRO, with Ubuntu 18.04 leading, followed by Debian.<\/li>\n<\/ul>\n<p>\nAs previously mentioned, the metrics in this table are averages across all versions of the binary file. If only the latest versions of the files are considered, the numbers will differ (for example, see <noindex><a rel=\"nofollow\" href=\"http:\/\/outflux.net\/debian\/hardening\/\">Debian's progress with the implementation of PIE<\/a><\/noindex>). Moreover, most distributions usually check the protections of only a few functions in the binary code when counting statistics, while our analysis provides the true percentage of fortified functions. Therefore, if 5 out of 50 functions are protected in a binary, we will assign it a score of 0.1, which corresponds to 10% fortified functions.<\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/82e881c5ba2a3911f3a0ffae1a3475f4.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Table 4. Protection characteristics for executable files shown in Figure 3 (implementation of corresponding functions as a percentage of the total number of executable files)<\/i><\/p>\n<p><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/57c8e67be7a57341105262c6e956594c.png\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Table 5. Protection characteristics for libraries shown in Fig. 3 (implementation of corresponding functions as a percentage of the total number of libraries)<\/i><\/p>\n<p>So, is there progress? Definitely: this is evident from the statistics of individual distributions (for example, <noindex><a rel=\"nofollow\" href=\"http:\/\/outflux.net\/debian\/hardening\/\">Debian<\/a><\/noindex>), as well as from the tables provided above. For instance, Fig. 6 shows the implementation of protective mechanisms in three successive Ubuntu LTS distributions (we have omitted the stack collision protection statistics). We observe that from version to version, more and more files support stack canaries, and increasingly, more binary files are supplied with full RELRO protection.<\/p>\n<p><noindex><a rel=\"nofollow\" href=\"https:\/\/habrastorage.org\/webt\/d1\/ni\/or\/d1niordj1hmiklmg2-w5rsk6dla.png\"><img decoding=\"async\" alt=\"Millions of binaries later. How Linux has strengthened\" src=\"\/wp-content\/uploads\/2019\/03\/9130099db6d59106da8f0a0fc760410e.png\" style=\"display:block;margin: 0 auto;\" \/><\/a><\/noindex><br \/>\n<i>Fig. 6<\/i><\/p>\n<p>Unfortunately, a number of executables in different distributions still lack any of the aforementioned protections. For example, looking at Ubuntu 18.04, we can notice the binary ngetty (a replacement for getty), as well as the shells mksh and lksh, the picolisp interpreter, the nvidia-cuda-toolkit packages (a popular package for GPU-accelerated applications such as machine learning frameworks), and klibc-utils. Similarly, the binary mandos-client (an administrative tool that allows automatic reboots of machines with encrypted file systems), as well as the rsh-redone-client (a reimplementation of rsh and rlogin), are delivered without NX protection, even though they have SUID rights :(. Additionally, several suid binaries lack basic protection, such as stack canaries (for example, the Xorg.wrap binary from the Xorg package).<\/p>\n<h1>Summary and concluding remarks<\/h1>\n<p>\nIn this article, we highlight several security features of modern Linux distributions. Analysis shows that the latest Ubuntu LTS distribution (18.04) implements, on average, the strongest OS and application level protection among distributions with relatively new kernels, such as Ubuntu 14.04, 12.04, and Debian 9. However, the examined CentOS, RHEL, and OpenSUSE distributions in our dataset by default provide a denser package set, and in the latest versions (CentOS and RHEL), have a higher percentage of stack collision protection implementations compared to Debian-based competitors (Debian and Ubuntu). When comparing versions of CentOS and RedHat, we notice significant improvements in the implementation of stack canaries and RELRO from versions 6 to 7, but on average, CentOS implements more features than RHEL. Overall, all distributions should pay special attention to PIE protection, which, with the exception of Debian 9 and Ubuntu 18.04, is implemented in less than 10% of the binary files in our dataset. <\/p>\n<p>Finally, it should be noted: while we conducted the research manually, there are many security tools (for example, <noindex><a rel=\"nofollow\" href=\"https:\/\/cisofy.com\/lynis\/\">Lynis<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/www.nongnu.org\/tiger\/\">Tiger<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/github.com\/hubblestack\/hubble\">Hubble<\/a><\/noindex>), which perform analysis and help avoid unsafe configurations. Unfortunately, even strong protection in reasonable configurations does not guarantee the absence of exploits. This is why we firmly believe that it is vital to ensure <noindex><a rel=\"nofollow\" href=\"https:\/\/capsule8.com\/\">reliable monitoring and real-time attack prevention<\/a><\/noindex>, focusing on exploitation patterns and preventing them.<\/p>\n<p>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/444418\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>TL;DR. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0438\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0437\u0430\u0449\u0438\u0442\u043d\u044b\u0435 \u0441\u0445\u0435\u043c\u044b (hardening schemes), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0432 \u043f\u044f\u0442\u0438 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 Linux. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u044b \u0432\u0437\u044f\u043b\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u044f\u0434\u0440\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438 \u0432\u0441\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u0445\u0435\u043c\u044b \u0437\u0430\u0449\u0438\u0442\u044b \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445. \u0420\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u044b OpenSUSE 12.4, Debian 9, CentOS, RHEL 6.10 \u0438 7, \u0430 \u0442\u0430\u043a\u0436\u0435 Ubuntu 14.04, 12.04 \u0438 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-29880","post","type-post","status-publish","format-standard","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"TL;DR.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/milliony-binarnikov-spustya-kak-ukreplyalsya-linux\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432 \u0441\u043f\u0443\u0441\u0442\u044f. \u041a\u0430\u043a \u0443\u043a\u0440\u0435\u043f\u043b\u044f\u043b\u0441\u044f Linux | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"TL;DR.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/milliony-binarnikov-spustya-kak-ukreplyalsya-linux\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T18:32:27+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T18:32:27+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Millions of binaries later. How Linux has strengthened | ProHoster","description":"TL;DR.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/milliony-binarnikov-spustya-kak-ukreplyalsya-linux","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u043e\u0432 \u0441\u043f\u0443\u0441\u0442\u044f. \u041a\u0430\u043a \u0443\u043a\u0440\u0435\u043f\u043b\u044f\u043b\u0441\u044f Linux | ProHoster","og:description":"TL;DR.","og:url":"https:\/\/prohoster.info\/en\/blog\/milliony-binarnikov-spustya-kak-ukreplyalsya-linux","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T18:32:27+00:00","article:modified_time":"2019-10-31T18:32:27+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"29880","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-20 22:50:20","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-03-01 03:46:28","updated":"2026-01-20 22:50:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/29880","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=29880"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/29880\/revisions"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=29880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=29880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=29880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}