{"id":3354,"date":"2025-01-27T22:24:31","date_gmt":"2025-01-27T18:54:31","guid":{"rendered":"https:\/\/fireserver.ir\/blog\/?p=3354"},"modified":"2025-02-15T22:28:50","modified_gmt":"2025-02-15T18:58:50","slug":"cloudlinux-disable-ptrace","status":"publish","type":"post","link":"https:\/\/fireserver.ir\/blog\/cloudlinux-disable-ptrace\/","title":{"rendered":"\u063a\u06cc\u0631 \u0641\u0639\u0627\u0644\u0633\u0627\u0632\u06cc PTrace \u062f\u0631 CloudLinux"},"content":{"rendered":"<h2>PTrace \u06cc\u0627 Proccess Trace \u062f\u0631 \u06a9\u0644\u0648\u062f \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0686\u06cc\u0633\u062a\u061f<\/h2>\n<p>Ptrace \u06cc\u0627 Process Trace \u06cc\u06a9 \u062a\u0627\u0628\u0639 \u0628\u0631\u0627\u06cc \u0639\u06cc\u0628 \u06cc\u0627\u0628\u06cc \u062f\u0631 \u06a9\u0644\u0648\u062f \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0627\u0633\u062a \u06a9\u0647 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc \u062f\u0647\u062f.\u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0647 \u0645\u0627 \u0627\u06cc\u0646 \u0627\u0645\u06a9\u0627\u0646 \u0631\u0627 \u0645\u06cc \u062f\u0647\u062f \u06a9\u0647 \u067e\u0631\u0627\u0633\u0633 \u0647\u0627\u06cc Memory \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u0648 \u062b\u0628\u062a \u06a9\u0646\u06cc\u0645.\u06a9\u0627\u0631\u0628\u0631\u0627\u0646\u06cc \u06a9\u0647 \u062f\u0633\u062a\u0631\u0633\u06cc \u0631\u0648\u062a \u0631\u0627 \u0646\u062f\u0627\u0631\u0646\u062f \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0646\u062f \u0627\u0632 ptrace() \u0628\u0631\u0627\u06cc \u06af\u0631\u0641\u062a\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0627\u0644\u0627\u062a\u0631\u060c \u0627\u0632 \u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631 \u0647\u0627\u06cc \u062f\u0631 \u062d\u0627\u0644 \u0627\u062c\u0631\u0627 \u0633\u0648\u0621\u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u0646\u062f \u067e\u0633 \u0641\u0639\u0627\u0644 \u0628\u0648\u062f\u0646 \u0622\u0646 \u0628\u0631 \u0631\u0648\u06cc \u06cc\u06a9 \u0633\u0631\u0648\u0631 \u0647\u0627\u0633\u062a \u06a9\u0647 \u062f\u0631 \u0627\u0634\u062a\u0631\u0627\u06a9 \u06a9\u0627\u0631\u0628\u0631\u0627\u0646 \u0627\u0633\u062a \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u062e\u0637\u0631\u0646\u0627\u06a9 \u0628\u0627\u0634\u062f.\u0628\u0647 \u0645\u0647\u0627\u062c\u0645 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc \u062f\u0647\u062f \u062a\u0627 \u0628\u062a\u0648\u0627\u0646\u062f \u0628\u0647 \u062a\u0627\u0628\u0639 setuid \u062f\u0633\u062a\u0631\u0633\u06cc \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u062f \u0648 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 ptrace \u06cc\u0627 \u0633\u0627\u06cc\u0631 \u0641\u0627\u0646\u06a9\u0634\u0646 \u0647\u0627 \u062f\u0633\u062a\u0648\u0631\u0627\u062a \u062e\u0648\u062f \u0631\u0627 \u0628\u0627 \u062f\u0633\u062a\u0631\u0633\u06cc \u0631\u0648\u062a \u0627\u062c\u0631\u0627 \u06a9\u0646\u062f \u0648 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u06cc \u062f\u0631 \u0646\u062a\u06cc\u062c\u0647 \u0627\u062c\u0631\u0627\u06cc \u067e\u0631\u0627\u0633\u0633 \u0647\u0627 \u0627\u06cc\u062c\u0627\u062f \u06a9\u0646\u062f.<\/p>\n<h2>\u0631\u0627\u0647\u06a9\u0627\u0631 \u063a\u06cc\u0631 \u0641\u0639\u0627\u0644 \u06a9\u0631\u062f\u0646 PTrace \u062f\u0631 \u06a9\u0644\u0648\u062f\u0644\u06cc\u0646\u0648\u06a9\u0633<\/h2>\n<p>\u0628\u0627\u06cc\u062f \u062f\u0631 \u0646\u0638\u0631 \u062f\u0627\u0634\u062a\u0647 \u0628\u0627\u0634\u06cc\u062f \u06a9\u0647 \u0628\u0647 \u0635\u0648\u0631\u062a \u067e\u06cc\u0634 \u0641\u0631\u0636 ptrace() \u062f\u0631 \u06a9\u0644\u0648\u062f \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0641\u0639\u0627\u0644 \u0645\u06cc \u0628\u0627\u0634\u062f \u0648 \u0645\u0642\u0627\u062f\u06cc\u0631 \u0622\u0646 \u0628\u0647 \u0635\u0648\u0631\u062a \u0632\u06cc\u0631 \u062a\u0646\u0638\u06cc\u0645 \u0634\u062f\u0647 \u0627\u0633\u062a:<\/p>\n<pre class=\"language-text\"><code>kernel.user_ptrace = 1\r\nkernel.user_ptrace_self = 1<\/code><\/pre>\n<p>\u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0645\u0627 \u0627\u0632 kernel.user_ptrace \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645 \u0628\u0631\u0627\u06cc \u063a\u06cc\u0631 \u0641\u0639\u0627\u0644\u0633\u0627\u0632\u06cc PTRACE_ATTACH\u060c \u0648 \u0627\u0632 kernel.user_ptrace_self \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0645\u06cc \u06a9\u0646\u06cc\u0645 \u0628\u0631\u0627\u06cc \u063a\u06cc\u0631 \u0641\u0639\u0627\u0644 \u0633\u0627\u0632\u06cc PTRACE_TRACEME\u060c \u067e\u0633 \u0628\u0631\u06cc\u0645 \u06a9\u0647 \u0627\u0635\u0644 \u06a9\u0627\u0631 \u0631\u0648 \u0634\u0631\u0648\u0639 \u06a9\u0646\u06cc\u0645.\u0645\u0627 \u0628\u0627\u06cc\u062f \u0645\u0642\u062f\u0627\u0631 \u0647\u0631 \u062f\u0648 \u0645\u0648\u0631\u062f \u0631\u0648 \u0628\u0647 0 \u062a\u063a\u06cc\u06cc\u0631 \u062f\u0647\u06cc\u0645 \u062a\u0627 \u063a\u06cc\u0631 \u0641\u0639\u0627\u0644 \u0634\u0648\u0646\u062f \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0647 \u0628\u0627\u06cc\u062f \u0627\u0632 \u0637\u0631\u06cc\u0642 sysctl \u0627\u0642\u062f\u0627\u0645 \u06a9\u0646\u06cc\u0645. \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u062f\u0631 \u0648\u06cc\u0631\u0627\u06cc\u0634\u06af\u0631 nano \u0641\u0627\u06cc\u0644 \/etc\/sysctl.conf \u0631\u0627 \u0628\u0627\u0632 \u0645\u06cc \u06a9\u0646\u06cc\u0645:<\/p>\n<pre class=\"language-text\"><code>nano \/etc\/sysctl.conf<\/code><\/pre>\n<p>\u0645\u0642\u0627\u062f\u06cc\u0631 \u0631\u0627 \u0628\u0647 \u0635\u0648\u0631\u062a \u0632\u06cc\u0631 \u0642\u0631\u0627\u0631 \u0645\u06cc \u062f\u0647\u06cc\u0645:<\/p>\n<pre class=\"language-text\"><code>## CL. Disable ptrace for users\r\nkernel.user_ptrace = 0\r\nkernel.user_ptrace_self = 0\r\n##<\/code><\/pre>\n<p>\u0648 \u0628\u0639\u062f \u0627\u0632 \u0637\u0631\u06cc\u0642 \u062f\u0633\u062a\u0648\u0631 \u0632\u06cc\u0631 \u062a\u063a\u06cc\u06cc\u0631\u0627\u062a\u06cc \u06a9\u0647 \u062f\u0627\u062f\u0647 \u0627\u06cc\u0645 \u0631\u0627 \u0627\u0639\u0645\u0627\u0644 \u0645\u06cc \u06a9\u0646\u06cc\u0645:<\/p>\n<pre class=\"language-text\"><code>sysctl -p<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>PTrace \u06cc\u0627 Proccess Trace \u062f\u0631 \u06a9\u0644\u0648\u062f \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0686\u06cc\u0633\u062a\u061f Ptrace \u06cc\u0627 Process Trace \u06cc\u06a9 \u062a\u0627\u0628\u0639 \u0628\u0631\u0627\u06cc \u0639\u06cc\u0628 \u06cc\u0627\u0628\u06cc \u062f\u0631 \u06a9\u0644\u0648\u062f \u0644\u06cc\u0646\u0648\u06a9\u0633 \u0627\u0633\u062a \u06a9\u0647 \u0627\u062c\u0627\u0632\u0647 \u0645\u06cc \u062f\u0647\u062f.\u0647\u0645\u0686\u0646\u06cc\u0646 \u0628\u0647 \u0645\u0627 \u0627\u06cc\u0646 \u0627\u0645\u06a9\u0627\u0646 \u0631\u0627 \u0645\u06cc \u062f\u0647\u062f \u06a9\u0647 \u067e\u0631\u0627\u0633\u0633 \u0647\u0627\u06cc Memory \u0631\u0627 \u062a\u063a\u06cc\u06cc\u0631 \u0648 \u062b\u0628\u062a \u06a9\u0646\u06cc\u0645.\u06a9\u0627\u0631\u0628\u0631\u0627\u0646\u06cc \u06a9\u0647 \u062f\u0633\u062a\u0631\u0633\u06cc \u0631\u0648\u062a \u0631\u0627 \u0646\u062f\u0627\u0631\u0646\u062f \u0645\u06cc\u200c\u062a\u0648\u0627\u0646\u0646\u062f \u0627\u0632 ptrace() \u0628\u0631\u0627\u06cc \u06af\u0631\u0641\u062a\u0646 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0627\u0644\u0627\u062a\u0631\u060c \u0627\u0632 \u0646\u0631\u0645 &hellip;<\/p>\n","protected":false},"author":7,"featured_media":3384,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,152],"tags":[],"class_list":["post-3354","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-cloudlinux"],"_links":{"self":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts\/3354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/comments?post=3354"}],"version-history":[{"count":7,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts\/3354\/revisions"}],"predecessor-version":[{"id":3359,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/posts\/3354\/revisions\/3359"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/media\/3384"}],"wp:attachment":[{"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/media?parent=3354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/categories?post=3354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fireserver.ir\/blog\/wp-json\/wp\/v2\/tags?post=3354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}