{"id":205274,"date":"2013-12-09T01:18:02","date_gmt":"2013-12-08T21:18:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=205274"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=205274","title":{"rendered":"<span class=\"post_title\">\u041f\u0440\u043e\u0441\u0442\u0430\u044f \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 Linux \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c DKOM<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043a\u043e\u0440\u044b\u0442\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 \u043e\u0442 \u0432\u0435\u0437\u0434\u0435\u0441\u0443\u0449\u0438\u0445 \u00ab\u0433\u043b\u0430\u0437\u00bb \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <a href=\"http:\/\/www.blackhat.com\/presentations\/win-usa-04\/bh-win-04-butler.pdf\">DKOM<\/a> (Direct Kernel Object Manipulation) \u2014 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0435\u0445\u043d\u0438\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0434\u0438\u0446\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u044f\u0434\u0440\u0430.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043e\u0441\u043d\u043e\u0432\u0443 DKOM \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438 \u044f\u0434\u0440\u0430. \u0412 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 <a href=\"http:\/\/lxr.free-electrons.com\/source\/kernel\/module.c?v=3.8#L105\">\u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/a>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435 <a href=\"http:\/\/lxr.free-electrons.com\/source\/include\/linux\/module.h?v=3.8#L223\">\u043c\u043e\u0434\u0443\u043b\u0438<\/a>, \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443.<\/p>\n<h4>\u041f\u0440\u0435\u0434\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432 \u044f\u0434\u0440\u0435<\/h4>\n<p>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439-\u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 Linux \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0430\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/lxr.free-electrons.com\/source\/include\/linux\/module.h?v=3.8#L223\">linux\/modules.h<\/a> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">223 struct module 224 { 225         enum module_state state; 226  227         \/* Member of list of modules *\/ 228         struct list_head list; 229  230         \/* Unique handle for this module *\/ 231         char name[MODULE_NAME_LEN]; ... 378 }; <\/code><\/pre>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, \u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u043b\u0435 <code>list<\/code>, \u044f\u0432\u043b\u044f\u044e\u0449\u0435\u0435\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0432 \u043e\u0431\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u044f\u0434\u0440\u0430. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u043d\u0435 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0441\u043f\u0438\u0441\u043a\u043e\u043c, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/lxr.free-electrons.com\/source\/kernel\/module.c?v=3.8#L105\">kernel\/module.c<\/a> \u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u0435\u043c\u044b\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c (\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c) <a href=\"http:\/\/lxr.free-electrons.com\/source\/kernel\/module.c?v=3.8#L104\">\u043c\u044c\u044e\u0442\u0435\u043a\u0441\u043e\u043c<\/a>:<\/p>\n<pre><code class=\"cpp\">103 DEFINE_MUTEX(module_mutex); 104 EXPORT_SYMBOL_GPL(module_mutex); 105 static LIST_HEAD(modules); <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u044f, \u044f\u0434\u0440\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u0441\u0432\u043e\u0439 \u0441\u043f\u0438\u0441\u043e\u043a. \u041f\u0440\u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0435 \u2014 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442. \u0412\u043e\u043e\u0431\u0449\u0435, \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0441\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043a \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u044f\u0434\u0440\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430.<\/p>\n<h4>\u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h4>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u0438, \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 <code>THIS_MODULE<\/code>, \u0441\u0441\u044b\u043b\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443-\u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u043e\u0435 \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u043b\u0435 <code>list<\/code> \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043e\u0431\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0441 \u0433\u043e\u043b\u043e\u0432\u043d\u044b\u043c \u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u0435\u043c, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u0432 \u043d\u0435\u0434\u0440\u0430\u0445 \u044f\u0434\u0440\u0430. \u0418\u0442\u0430\u043a, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 <a href=\"https:\/\/github.com\/milabs\/kmod_hidden\/blob\/master\/module-init.c#L61\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>:<\/p>\n<pre><code class=\"cpp\">static void list_modules(void) {         struct module * mod;         struct list_head * pos;          while(!mutex_trylock(&module_mutex))                 cpu_relax();          debug(&quot;List of available modules:\\n&quot;);          list_for_each(pos, &THIS_MODULE-&gt;list) {                 bool head = (unsigned long)pos &gt;= MODULES_VADDR;                  mod = container_of(pos, struct module, list);                  debug(&quot;  pos:%pK mod:%pK [%s]\\n&quot;, pos, \\                       head ? mod : 0, head ? mod-&gt;name : &quot;&lt;- looking for&quot;);         }          mutex_unlock(&module_mutex); } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u0435\u0436\u0434\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043c\u044c\u044e\u0442\u0435\u043a\u0441, \u0434\u0430\u0431\u044b \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0432\u0430\u0436\u043d\u044b\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u043c \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0433\u043e\u043b\u043e\u0432\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u2014 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b <a href=\"http:\/\/lxr.free-electrons.com\/source\/kernel\/module.c?v=3.8#L105\">modules<\/a>. \u0412 \u0441\u0438\u043b\u0443 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 \u044f\u0434\u0440\u0435 Linux, \u0433\u043e\u043b\u043e\u0432\u0430 \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u043d\u0438 \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0442.\u043a. \u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0432\u044b\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (<a href=\"http:\/\/lxr.free-electrons.com\/source\/arch\/x86\/include\/asm\/pgtable_64_types.h?v=3.8#L59\">MODULES_VADDR<\/a> \u2014 <a href=\"http:\/\/lxr.free-electrons.com\/source\/arch\/x86\/include\/asm\/pgtable_64_types.h?v=3.8#L60\">MODULES_END<\/a>), \u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u044b\u043c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043c\u0430\u0448\u0438\u043d:<\/p>\n<pre><code class=\"bash\">[11025.656372] [findme] List of available modules: [11025.656377] [findme]   pos:ffffffffa02a7388 mod:ffffffffa02a7380 [ipheth] [11025.656380] [findme]   pos:ffffffffa02b9108 mod:ffffffffa02b9100 [pci_stub] [11025.656382] [findme]   pos:ffffffffa01e7028 mod:ffffffffa01e7020 [vboxpci] [11025.656385] [findme]   pos:ffffffffa01dd148 mod:ffffffffa01dd140 [vboxnetadp] [11025.656387] [findme]   pos:ffffffffa01d4028 mod:ffffffffa01d4020 [vboxnetflt] ... [11025.656477] [findme]   pos:ffffffffa00205c8 mod:ffffffffa00205c0 [3c59x] [11025.656480] [findme]   pos:ffffffffa000c108 mod:ffffffffa000c100 [r8169] [11025.656483] [findme]   pos:ffffffff81c2daf0 mod:0000000000000000 [&lt;- looking for] <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u0441\u043a\u043e\u043c\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <code>ffffffff81c2daf0<\/code>, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\"># grep -w modules \/proc\/kallsyms  ffffffff81c2daf0 d modules <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441 \u043b\u0451\u0433\u043a\u043e\u0441\u0442\u044c\u044e, \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430, \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u0440\u043d\u0435\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u0415\u0451 \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435\u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u043d\u044b\u0439 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0430\u0434\u0440\u0435\u0441 (<code>ffffffff81xxxxxx<\/code> \u043f\u0440\u043e\u0442\u0438\u0432 <code>ffffffffa0xxxxxx<\/code>), \u0447\u0442\u043e \u0438 \u0431\u044b\u043b\u043e <a href=\"https:\/\/github.com\/milabs\/kmod_hidden\/blob\/master\/module-init.c#L14\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e<\/a>:<\/p>\n<pre><code class=\"cpp\">struct list_head * get_modules_head(void) {         struct list_head * pos;          while(!mutex_trylock(&module_mutex))                 cpu_relax();          list_for_each(pos, &THIS_MODULE-&gt;list) {                 if ((unsigned long)pos &lt; MODULES_VADDR) {                         break;                 }         }          mutex_unlock(&module_mutex);          if (pos) {                 debug(&quot;Found \\&quot;modules\\&quot; head @ %pK\\n&quot;, pos);         } else {                 debug(&quot;Can't find \\&quot;modules\\&quot; head, aborting\\n&quot;);         }          return pos; } <\/code><\/pre>\n<h4>\u041c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435\u0439<\/h4>\n<p>  \u0421\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0442.\u043a. \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e, \u043a\u0440\u043e\u043c\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0436\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0438\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043f\u0438\u0441\u043a\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 <a href=\"https:\/\/github.com\/milabs\/kmod_hidden\/blob\/master\/module-init.c#L38\">\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>:<\/p>\n<pre><code class=\"cpp\">static void hide_or_show(int new) {         while(!mutex_trylock(&module_mutex))                 cpu_relax();          if (new == 1) {                 \/* 0 -&gt; 1 : hide *\/                  list_del(&THIS_MODULE-&gt;list);                  debug(&quot;Module \\&quot;%s\\&quot; unlinked\\n&quot;, THIS_MODULE-&gt;name);          } else {                 \/* 1 -&gt; 0 : show *\/                  list_add(&THIS_MODULE-&gt;list, p_modules);                  debug(&quot;Module \\&quot;%s\\&quot; linked again\\n&quot;, THIS_MODULE-&gt;name);         }          mutex_unlock(&module_mutex); } <\/code><\/pre>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0434\u043b\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <a href=\"http:\/\/lxr.free-electrons.com\/source\/include\/linux\/list.h?v=3.8#L104\">list_del<\/a>. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u2014 <a href=\"http:\/\/lxr.free-electrons.com\/source\/include\/linux\/list.h?v=3.8#L60\">list_add<\/a>. \u041e\u0431\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0437\u0430\u0449\u0438\u0449\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u0445\u0432\u0430\u0442\u043e\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043c\u044c\u044e\u0442\u0435\u043a\u0441\u0430.<\/p>\n<h4>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c<\/h4>\n<p>  \u0412 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c <a href=\"https:\/\/github.com\/milabs\/kmod_hidden\">\u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043a\u043e\u0434 \u043c\u043e\u0434\u0443\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0438. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <code>make<\/code> \u0438 <code>insmod<\/code><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0447\u0435\u0440\u0435\u0437 <code>lsmod<\/code> \u0438\u043b\u0438 <code>rmmod<\/code>. \u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043f\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0438:<\/p>\n<pre><code class=\"bash\"># isnmod findme.ko # lsmod | grep findme findme                 12697  0 # sysctl -w findme=1 findme = 1 # lsmod | grep findme # rmmod findme libkmod: ERROR ..\/libkmod\/libkmod-module.c:753 kmod_module_remove_module: could not remove 'findme': No such file or directory Error: could not remove module findme: No such file or directory # sysctl -w findme=0 findme = 0 # lsmod | grep findme findme                 12697  0  # rmmod findme <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 \u043e\u0442 \u043f\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0433\u043b\u0430\u0437. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 <a href=\"https:\/\/github.com\/milabs\/kmod_hidden\">\u043f\u0440\u0438\u043c\u0435\u0440<\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u0434.<\/p>\n<h4>\u041d\u0430 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c<\/h4>\n<p>  1. <a href=\"http:\/\/www.blackhat.com\/presentations\/win-usa-04\/bh-win-04-butler.pdf\">Direct Kernel Object Manipulation<\/a><br \/>  2. <a href=\"http:\/\/isis.poly.edu\/kulesh\/stuff\/src\/klist\/\">Linux Kernel Linked List Explained<\/a><br \/>  3. <a href=\"http:\/\/lwn.net\/Articles\/336255\/\">Linux kernel design patterns \u2014 part 2<\/a>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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=\"http:\/\/habrahabr.ru\/post\/205274\/\"> http:\/\/habrahabr.ru\/post\/205274\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u043a\u043e\u0440\u044b\u0442\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430 \u043e\u0442 \u0432\u0435\u0437\u0434\u0435\u0441\u0443\u0449\u0438\u0445 \u00ab\u0433\u043b\u0430\u0437\u00bb \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <a href=\"http:\/\/www.blackhat.com\/presentations\/win-usa-04\/bh-win-04-butler.pdf\">DKOM<\/a> (Direct Kernel Object Manipulation) \u2014 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0435\u0445\u043d\u0438\u043a, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u043c\u043e\u0434\u0438\u0446\u0438\u043a\u0430\u0446\u0438\u0438 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u044f\u0434\u0440\u0430.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0442\u0435\u0445\u043d\u0438\u043a\u0438 \u0441 \u0446\u0435\u043b\u044c\u044e \u0441\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0432\u0438\u0434\u0438\u043c\u044b\u0445 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u043e\u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0438, \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0435\u0433\u043e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438.<\/p>\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-205274","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/205274","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=205274"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/205274\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=205274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=205274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=205274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}