{"id":200854,"date":"2013-11-05T15:30:03","date_gmt":"2013-11-05T11:30:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=200854"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=200854","title":{"rendered":"<span class=\"post_title\">\u0418\u0437\u0443\u0447\u0430\u0435\u043c netfilter: \u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0439 match-\u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u0431\u0430\u0437\u0435 xt_string \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u044f\u0434\u0440\u0430. \u0412\u0441\u0451 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0451\u043b:  <\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/138328\/\">\u0423\u0447\u0438\u043c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430 (Netfilter) \u0438\u043b\u0438 \u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u0434\u043b\u044f HTTPS<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/26391\/\">\u00abLinux Kernel Hacking \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e!\u00bb \u0438\u043b\u0438 \u00ab\u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e?\u00bb<\/a><\/li>\n<li>\u0415\u0449\u0451 2-3 \u0441\u0442\u0430\u0442\u044c\u0438<\/li>\n<\/ul>\n<p>  \u0412\u0441\u0435\u0433\u0434\u0430 \u0443\u0434\u0438\u0432\u043b\u044f\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0434\u0438, \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0437\u043d\u0430\u044e\u0449\u0438\u0435 C, \u0431\u043e\u044f\u0442\u0441\u044f \u0438 \u0438\u0437\u0431\u0435\u0433\u0430\u044e\u0442 \u0434\u0430\u0436\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u044f\u0434\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043e\u043d \u043d\u0430 60% \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0443\u0436 \u0441\u043b\u043e\u0436\u043d\u044b\u0439). \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043b\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 netfilter \u0438 iptables.<\/p>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043e\u043d\u0438, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u044f\u0434\u0440\u0430, \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044f\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0432 \u043d\u043e\u0432\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<h4>\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c<\/h4>\n<p>  \u041a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c iptables \u043d\u0430 \u0431\u0430\u0437\u0435 xt_string. Xt_string \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c netfilter, \u0443\u043c\u0435\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0430\u0439\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u043c\u0443, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0430\u0439\u0442 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041d\u0443, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f GPL, \u0442\u043e \u0447\u0442\u043e \u043c\u0435\u0448\u0430\u0435\u0442 \u0435\u043c\u0443 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0434\u0430\u0442\u044c?<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0442\u0430\u043a\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u044b \u0438 \u0437\u0430\u043f\u0438\u043b\u0438\u043c, \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e xt_wildstring, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <s>\u0434\u043b\u044f \u0442\u043e\u043b\u0441\u0442\u043e\u0433\u043e \u043f\u0438\u0430\u0440\u0430<\/s>\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"bash\">iptables -I FORWARD -p tcp --dport 80 --tcp-flags ACK,PSH ACK,PSH -m wildstring --wildstring &quot;reductor*price*carbonsoft.ru&quot; -j DROP. <\/code><\/pre>\n<p>  \u041f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043d\u0430\u0447\u043d\u0443 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0441 \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<br \/>  \u0421\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u2014 \u044d\u0442\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u0438\u0441\u0430\u043b\u0441\u044f \u043d\u0435 \u043f\u043e\u0434 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d, \u0430 \u043b\u0438\u0448\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u044f\u0434\u0440\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0447\u0443\u0442\u043e\u0447\u043a\u0443 \u0433\u043b\u0443\u0431\u0436\u0435 \u0441 netfilter.<\/p>\n<h4>\u041a\u0440\u0430\u0442\u043a\u043e \u043f\u0440\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e netfilter \u0438 iptables<\/h4>\n<p>  \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043c\u043e\u0434\u0443\u043b\u044c iptables \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u2014 kernelspace \u0438 userspace. \u0412 kernelspace \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430 Linux, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041e\u043d-\u0442\u043e \u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 iptables. \u0412 userspace \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0443\u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044c iptables, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u044f\u0434\u0440\u0443 Linux.<\/p>\n<p>  \u041c\u043e\u0434\u0443\u043b\u0438 netfilter \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0442\u0440\u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438:  <\/p>\n<ul>\n<li>\u0425\u0443\u043a\u0438 \u2014 \u043f\u043e \u0441\u0443\u0442\u0438 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0435 \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043f\u0443\u0442\u0438 \u043f\u0430\u043a\u0435\u0442\u0430 \u0441\u043a\u0432\u043e\u0437\u044c \u044f\u0434\u0440\u043e<\/li>\n<li>\u041c\u0430\u0442\u0447\u0438 \u2014 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 true \u0438\u043b\u0438 false, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a \u043a\u0430\u043a\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043f\u0430\u043a\u0435\u0442<\/li>\n<li>\u0422\u0430\u0440\u0433\u0435\u0442\u044b \u2014 \u043c\u043e\u0434\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u044f\u0442 \u043d\u0430\u0434 \u043f\u0430\u043a\u0435\u0442\u043e\u043c \u043d\u0435\u043a\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435, \u0441\u0430\u043c\u044b\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 \u2014 ACCEPT \/ DROP, \u0445\u043e\u0442\u044f \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0438\u0445 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435<\/li>\n<\/ul>\n<p>  <\/p>\n<h5>\u0413\u0434\u0435 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u044d\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u0438:<\/h5>\n<p>  Netfilter \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u044f\u0434\u0440\u0430 Linux \u0438 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 2.6.32 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u0445:<br \/>  \/usr\/src\/linux\/net\/netfilter\/ \u2014 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e match-\u043c\u043e\u0434\u0443\u043b\u0435\u0439.<br \/>  \/usr\/src\/linux\/net\/ipv4\/netfilter\/ \u2014 \u0447\u0430\u0441\u0442\u044c target-\u043c\u043e\u0434\u0443\u043b\u0435\u0439.<br \/>  \/usr\/src\/linux\/include\/linux\/netfilter\/ \u2014 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438 \u0442\u0435\u0445 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439.<\/p>\n<p>  \u041c\u043e\u0434\u0443\u043b\u0438 iptables \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435<br \/>  \/usr\/src\/iptables\/extensions\/<\/p>\n<p>  \u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 kernelspace \u0438 userspace \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043b\u0443\u0447\u0448\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b.<\/p>\n<h4>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043e\u0442 \u0442\u0435\u043e\u0440\u0438\u0438 \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h4>\n<p>  \u041c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0442\u044c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434, \u043d\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e GPL \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438. \u0412\u043e\u0437\u044c\u043c\u0451\u043c \u043c\u043e\u0434\u0443\u043b\u044c xt_string \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u044f\u0434\u0440\u0430 CentOS 6, \u043a\u0430\u043a \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<p>  \u041f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0438 \u0441\u0442\u0435\u043d\u0434\u0430 \u0432\u044b\u0448\u043b\u043e \u0431\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u0440\u044b\u043b \u0435\u0451 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0435\u0442 \u043d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0438\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043a \u0442\u043e\u043c\u0443, \u0433\u0434\u0435 \u0438 \u0447\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u2014 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043f\u043e\u0434 \u043d\u0435\u0433\u043e.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0441\u0442\u0435\u043d\u0434\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<\/b><\/p>\n<div class=\"spoiler_text\">\n<h5>\u0413\u043e\u0442\u043e\u0432\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438<\/h5>\n<p>  \u0414\u0430, \u043c\u043d\u043e\u0433\u0438\u0435 \u043c\u0435\u0447\u0442\u0430\u044e\u0442 \u043e\u0431 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 IDE \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 Linux Kernel. \u041d\u043e, \u0443\u0432\u044b \u0438 \u0430\u0445, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u044f \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u043b. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043f\u0440\u0438\u0447\u0438\u043d \u0442\u043e\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u2014 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0435\u0433\u0444\u043e\u043b\u0442\u0430 \u0432 \u044f\u0434\u0440\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c Kernel Panic \u0438 \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0435\u0441\u043b\u0438 \u043f\u0430\u043d\u0438\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0451\u0442 \u043d\u0430 \u043d\u0430\u0448\u0435\u0439 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u043b\u0438\u0431\u043e \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0441\u0442\u0435\u043d\u0434\u0435, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043a\u043e\u0434 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0435 \u0436\u0435\u043b\u0435\u0437\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u0435\u043d, \u0442\u0430\u043a \u0447\u0442\u043e \u0441\u0442\u0430\u0432\u0438\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0438.<\/p>\n<h5>\u0421\u0442\u0430\u0432\u0438\u043c CentOS \u043d\u0430 \u0434\u0432\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b<\/h5>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0448 \u043c\u043e\u0437\u0433 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u043b \u0432\u043e \u0432\u0440\u0435\u043c\u044f Kernel Panic \u043f\u0440\u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u0430\u0445, \u0430 \u043e\u043d\u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u0431\u0443\u0434\u0443\u0442, \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0434\u0432\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433 \u043a \u0434\u0440\u0443\u0433\u0443. \u041e\u0434\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u044f, \u0430 \u0432\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0435\u043d\u0434\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<h5>\u041d\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 linux \u0438 iptables<\/h5>\n<p>  \u041a\u0441\u0442\u0430\u0442\u0438, \u043d\u0430 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0435 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0445 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c.<\/p>\n<pre><code class=\"bash\">yum install git ncurses-devel make gcc rpm-build indent <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0435\u0431\u0435 \u0432 \u0437\u0430\u043a\u043b\u0430\u0434\u043a\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0435\u0432 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0435\u0433\u043e \u043f\u043e\u0434 CentOS \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430:<\/p>\n<p>  <a href=\"http:\/\/vault.centos.org\/6.4\/os\/Source\/SPackages\/\">http:\/\/vault.centos.org\/6.4\/os\/Source\/SPackages\/<\/a><\/p>\n<p>  \u041e\u0442\u0441\u044e\u0434\u0430 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0440\u0430\u0442\u044c src.rpm \u044f\u0434\u0440\u0430 Linux \u0438 Iptables.<\/p>\n<pre><code class=\"bash\">rpm -i http:\/\/vault.centos.org\/6.4\/os\/Source\/SPackages\/kernel-2.6.32-358.el6.src. rpm -i http:\/\/vault.centos.org\/6.4\/os\/Source\/SPackages\/iptables-1.4.7-9.el6.src.rpm <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0438\u0434\u0451\u043c \u0432 \/root\/rpmbuild\/SPECS\/ \u0438 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0441 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0442\u0447\u0435\u0439 \u043e\u0442 CentOS.<\/p>\n<pre><code class=\"bash\">rpmbuild -bp iptables.spec rpmbuild -bp kernel.spec <\/code><\/pre>\n<p>  \u0412 \/root\/rpmbuild\/BUILD\/ \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0438 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438 \u044f\u0434\u0440\u0430 Linux \u0438 iptables.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u044f\u0434\u0440\u043e \u0446\u0435\u043b\u0438\u043a\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043f\u043a\u0443 net\/netfilter\/ \u043f\u0440\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043d\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0438 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u043e\u0441\u0442\u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0438\u043c\u043b\u0438\u043d\u043a\u0438:<\/p>\n<pre><code class=\"bash\">ln -s \/root\/rpmbuild\/BUILD\/kernel-2.6.32-358.el6\/linux-2.6.32-358.el6.x86_64\/ \/usr\/src\/linux ln -s \/root\/rpmbuild\/BUILD\/iptables-1.4.7\/ \/usr\/src\/iptables\/ <\/code><\/pre>\n<p>  \u0418\u0434\u0451\u043c \u0432 \/usr\/src\/linux. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433.<\/p>\n<pre><code class=\"bash\">make menuconfig <\/code><\/pre>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0451 \u044f\u0434\u0440\u043e.<\/p>\n<pre><code class=\"bash\">make prepare make -j 3  make modules_install <\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0441\u0451 \u0432 GIT-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0443 \u043c\u0435\u043d\u044f \u043e\u043d \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 ~\/GIT\/wildstring\/.<\/p>\n<h5>\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0435\u043d\u0434\u0430 \u043f\u0440\u0438 kernel panic<\/h5>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u2013 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \/proc\/sys\/kernel\/panic \u0432 2. \u041d\u043e \u0432\u044b\u0432\u043e\u0434 \u043f\u0430\u043d\u0438\u043a\u0438 \u043d\u0430\u043c \u0432\u0430\u0436\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u043d\u0430 \u0445\u043e\u0441\u0442-\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432 \u0434\u0443\u0445\u0435:<\/p>\n<pre><code class=\"bash\">name=centos_test ip=&lt;ip_\u0441\u0442\u0435\u043d\u0434\u0430&gt; while true; do \tif ! ping -qc 1 $ip; then \t\tvirt-viewer $name \t\tsleep 2 \t\tscrot \t\tvirsh destroy $name \t\tvirsh start $name \t\tsleep 60 \tfi done <\/code><\/pre>\n<h5>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0434\u0443\u043b\u044f<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">#!\/bin\/bash  test_wildstring() { \tiptables -F OUTPUT \trmmod xt_wildstring \tinsmod xt_wildstring \tiptables -I OUTPUT -p tcp \u2013dport 80 -m wildstring \u201copensource*carbonsoft\u201d -j DROP \twget -t 1 -T 1 http:\/\/carbonsoft.ru\/opensource\/ \tIptables -nvL OUTPUT }  test_wildstring  if [ \u201c$1\u201d = 'while' ]; then \twhile true; do \t\ttest_wildstring \t\tsleep 1 \tdone fi <\/code><\/pre>\n<p>  \u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u044e\u0437\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  \u0415\u0434\u0438\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a:  <\/p>\n<pre><code class=\"bash\">.\/test_wildstring.sh <\/code><\/pre>\n<p>  \u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b:  <\/p>\n<pre><code class=\"bash\">.\/test_wildstring.sh while <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h5>\u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c string \u0438\u0437 linux \u0438 iptables<\/h5>\n<p>  \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0443\u0436\u043d\u044b\u0435 \u043d\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u0438 \u0438 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 \u043d\u0430\u0448 \u0440\u0435\u043f\u043e\u0437\u0442\u043e\u0440\u0438\u0439.<\/p>\n<pre><code class=\"bash\">cp -v \/usr\/src\/linux\/net\/netfilter\/xt_string.c ~\/GIT\/wildstring\/xt_wildstring.c mkdir -p ~\/GIT\/wildstring\/include\/linux\/netfilter\/ cp -v \/usr\/src\/linux\/include\/linux\/netfilter\/xt_string.h ~\/GIT\/wildstring\/include\/linux\/netfilter\/xt_wildstring.h <\/code><\/pre>\n<h5>\u041f\u0438\u0448\u0435\u043c Makefile<\/h5>\n<p>  \u041e\u043f\u0438\u0448\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u044f \u044f\u0434\u0440\u0430, \u043c\u043e\u0434\u0443\u043b\u044f iptables, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u043f\u043e\u0434\u0447\u0438\u0441\u0442\u043a\u0443 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043f\u0430\u043f\u043a\u0438 \u0438 \u0435\u0449\u0451 \u043f\u0430\u0440\u0443 \u0446\u0435\u043b\u0435\u0439.<\/p>\n<pre><code class=\"cmake\">obj-m += xt_wildstring.o  all: module lib  module: \tcp include\/linux\/netfilter\/xt_wildstring.h \/usr\/src\/linux\/include\/linux\/netfilter\/xt_wildstring.h \tmake -C \/lib\/modules\/2.6.32\/build M=$(PWD) modules lib: \tcp libxt_wildstring.c \/usr\/src\/\/iptables\/extensions \tcp include\/linux\/netfilter\/xt_wildstring.h \/usr\/src\/iptables\/include\/linux\/netfilter\/xt_wildstring.h \tmake -C \/usr\/src\/iptables\/extensions \tcp \/usr\/src\/iptables\/extensions\/libxt_wildstring.so libxt_wildstring.so userspace: \tgcc userspace_wildstring.c -o userspace \t.\/userspace \trm -f userspace install: \tscp xt_wildstring.ko root@10.90.140.160: \tscp libxt_wildstring.so root@10.90.140.160:\/lib64\/xtables-1.4.7\/ clean: \trm -f *~ *.ko *.so *.mod.c *.ko.unsigned *.o modules.order Module.symvers indent: \tLindent *.c include\/linux\/netfilter\/xt_wildstring.h <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043a Makefile:  <\/p>\n<ul>\n<li>2.6.32 \u2014 \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0434\u0438\u043b\u0438, \u0442\u0430\u043a \u043a\u0430\u043a uname -r = 2.6.32-358.0.1.el6.x86_64, \u0430 \u044d\u0442\u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435\u0442, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0441\u0438\u043c\u043b\u0438\u043d\u043a \u0441\u0438\u043c\u043b\u0438\u043d\u043a \/lib\/modules\/2.6.32-358.0.1.el6.x86_64\/build \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442.<\/li>\n<li>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u043d\u0435 \u0433\u0443\u0440\u0443 makefile, \u0438 \u043d\u0435 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c libxt_wildstring.so \u0442\u0430\u043a, \u043a\u0430\u043a xt_wildstring.ko, \u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0435 \u0437\u0430\u043c\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u0443 \u0446\u0435\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 bash-\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438.<\/li>\n<li>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b scp \u0432 \u0446\u0435\u043b\u0438 install \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u0435\u0437 \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 SSH-\u043a\u043b\u044e\u0447\u0438 \u0438 \u043f\u043e\u0434\u043a\u0438\u043d\u0443\u0442\u044c \u0438\u0445 \u043a \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c\u0443 \u0441\u0442\u0435\u043d\u0434\u0443.<\/li>\n<li>\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Lindent \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \/usr\/src\/linux\/scripts\/Lindent \u0432 \/usr\/local\/bin, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432 \u044f\u0434\u0440\u0435 Linux, \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0443\u0441\u0442\u0430\u0432\u043e\u043c \u0432 \u0447\u0443\u0436\u043e\u0439 \u043c\u043e\u043d\u0430\u0441\u0442\u044b\u0440\u044c \u043d\u0435 \u0445\u043e\u0434\u044f\u0442. \u041b\u0443\u0447\u0448\u0435 \u0434\u0430\u0436\u0435 \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c.<\/li>\n<\/ul>\n<h5>\u0423\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0435\u0435 \u0432 .gitignore<\/h5>\n<p>  Untracked-\u0444\u0430\u0439\u043b\u044b \u0432 git status \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u044e\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c ~\/GIT\/wildstring\/.gitignore:<\/p>\n<p>  *.o<br \/>  *.so<br \/>  .*<br \/>  *.ko<br \/>  *.ko.unsigned<br \/>  modules.order<br \/>  Module.symvers<br \/>  *.mod.c<br \/>  !.gitignore<\/p>\n<h5>\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0432 wildstring<\/h5>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432\u0430\u043b \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u043e\u043c, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438 \u0432\u0441\u0435 \u0435\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 string \u043d\u0430 wildstring. \u0412\u0430\u0436\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u2014 \u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0451: \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0438 userspace \u043c\u043e\u0434\u0443\u043b\u044c, \u0438 kernelspace \u043c\u043e\u0434\u0443\u043b\u044c. \u0412 \u044d\u0442\u043e\u043c \u0434\u0435\u043b\u0435 grep \u0441\u043f\u0430\u0441\u0451\u0442 \u043e\u0442\u0446\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u0439 \u0434\u0435\u043c\u043e\u043a\u0440\u0430\u0442\u0438\u0438:<\/p>\n<pre><code class=\"bash\">grep -ri string xt_wildstring.c | grep -vi wildstring <\/code><\/pre>\n<h5>\u0420\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 match info<\/h5>\n<p>  \u0418 \u0441\u043d\u043e\u0432\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438: \u043a\u0430\u0436\u0434\u044b\u0439 match-\u043c\u043e\u0434\u0443\u043b\u044c \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 match-info, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0438\u0437 userspace. \u041e\u043d\u0430 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 (<a href=\"https:\/\/github.com\/carbonsoft\/wildstring\/blob\/master\/include\/linux\/netfilter\/xt_wildstring.h\">xt_wildstring.h<\/a>). <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 xt_string.h \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#ifndef _XT_STRING_H #define _XT_STRING_H  #include &lt;linux\/types.h&gt;  #define XT_STRING_MAX_PATTERN_SIZE 128 #define XT_STRING_MAX_ALGO_NAME_SIZE 16  enum { \tXT_STRING_FLAG_INVERT\t\t= 0x01, \tXT_STRING_FLAG_IGNORECASE\t= 0x02 };  struct xt_string_info { \t__u16 from_offset; \/\/\u0441\u0434\u0432\u0438\u0433 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u2013 \u043e\u0442\u043a\u0443\u0434\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a. \t__u16 to_offset; \/\/\u0441\u0434\u0432\u0438\u0433 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u2013 \u0434\u043e \u043a\u0443\u0434\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a. \tchar\talgo[XT_STRING_MAX_ALGO_NAME_SIZE]; \/\/\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \tchar \tpattern[XT_STRING_MAX_PATTERN_SIZE]; \/\/\u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0438\u0449\u0435\u043c, \u0448\u0430\u0431\u043b\u043e\u043d. \t__u8 patlen; \/\/\u0434\u043b\u0438\u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u0430, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \tunion { \t\tstruct { \t\t\t__u8 invert; \/\/\u0444\u043b\u0430\u0433 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044f ! -m string \u2013string \u201csomething\u201d \t\t} v0;  \t\tstruct { \t\t\t__u8 flags; \/\/\u043d\u0435 \u043f\u043e\u043c\u043d\u044e \u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e \u044d\u0442\u043e. \t\t} v1; \t} u;  \t\/* Used internally by the kernel  \t * \u043a\u043e\u043d\u0444\u0438\u0433 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430. \t *\u0432\u043e\u043e\u0431\u0449\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0435 \u043f\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0435, \u043d\u043e \u043a\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0447\u0442\u043e \t *\u043a\u043e\u043d\u0444\u0438\u0433\u043e\u043c\u0430\u043d\u0438\u0435\u0439 \u0441\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e java-\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b? \t *\u0432\u043e\u0437\u0440\u0430\u0434\u0443\u0435\u043c\u0441\u044f \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043e\u043d \u043d\u0435 \u0432 xml. \t *\/ \tstruct ts_config __attribute__((al  &lt;a href=&quot;https:\/\/github.com\/carbonsoft\/wildstring\/blob\/master\/include\/linux\/netfilter\/xt_wildstring.h&quot;&gt;\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u043d\u0430 github.&lt;\/a&gt;igned(8))) *config;  };  #endif \/*_XT_STRING_H*\/ <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<p>  \u0420\u0430\u0437\u043c\u043d\u043e\u0436\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b xt_wildstring_info \u0432 xt_wildstring.h<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438, \u0430 \u043d\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u043a\u0430\u043a \u0432 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0442\u043e\u0440\u043e\u0439 \u0438 \u0442\u0440\u0435\u0442\u0438\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u0448\u0430\u0431\u043b\u043e\u043d \u0431\u0435\u0437 \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u0435\u043a. \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u044b \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a + \u043f\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u0442\u0430\u043b\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">#ifndef _XT_WILDSTRING_H #define _XT_WILDSTRING_H  #include &lt;linux\/types.h&gt;  #define XT_WILDSTRING_MAX_PATTERN_SIZE 128 #define XT_WILDSTRING_MAX_ALGO_NAME_SIZE 16  enum { \tXT_WILDSTRING_FLAG_INVERT\t\t= 0x01, \tXT_WILDSTRING_FLAG_IGNORECASE\t= 0x02 };  struct xt_wildstring_info { \t__u16 from_offset; \t__u16 to_offset; \tchar\talgo[XT_WILDSTRING_MAX_ALGO_NAME_SIZE]; \tchar \tpattern[XT_WILDSTRING_MAX_PATTERN_SIZE]; \t\/* \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0448\u0430\u0431\u043b\u043e\u043d\u044b *\/ \tchar \t*pattern_part1; \tchar \t*pattern_part2; \tchar \t*pattern_part3; \t__u8 patlen; \t\/* \u0434\u043b\u0438\u043d\u044b \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 *\/ \t__u8 patlen_part1; \t__u8 patlen_part2; \t__u8 patlen_part3; \tunion { \t\tstruct { \t\t\t__u8 invert; \t\t} v0;  \t\tstruct { \t\t\t__u8 flags; \t\t} v1; \t} u;  \t\/* Used internally by the kernel *\/ \t\/* \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u043f\u043e \u0438\u0434\u0435\u0435 \u0443\u0436\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d *\/ \tstruct ts_config __attribute__((aligned(8))) *config; \tstruct ts_config __attribute__((aligned(8))) *config_part1; \tstruct ts_config __attribute__((aligned(8))) *config_part2; \tstruct ts_config __attribute__((aligned(8))) *config_part3; }; #endif <\/code><\/pre>\n<h5>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 \u0445\u0435\u0434\u0435\u0440\u0430<\/h5>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a <a href=\"https:\/\/github.com\/carbonsoft\/wildstring\/blob\/master\/xt_wildstring.c\">xt_wildstring.c<\/a>.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432 \u0445\u0435\u0434\u0435\u0440 \u043f\u043e\u0440\u0430 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0432\u0435\u0434\u0451\u043c \u0434\u043e \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0443 \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043e\u043f\u044f\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u2013 \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 match-\u043c\u043e\u0434\u0443\u043b\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b:<\/p>\n<ul>\n<li>init \u2013 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438 \u0435\u0433\u043e \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0435;<\/li>\n<li>exit \u2013 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438 \u0435\u0433\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435;<\/li>\n<li>mt \u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0430\u044f \u043f\u0430\u043a\u0435\u0442;<\/li>\n<li>mt_check \u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0430\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430;<\/li>\n<li>mt_destroy \u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u043e\u0434\u0447\u0438\u0449\u0430\u044e\u0449\u0430\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430;<\/li>\n<li>mt_reg \u2014 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 mt_check, mt \u0438 mt_destroy + \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043c\u043e\u0434\u0443\u043b\u0435;<\/li>\n<\/ul>\n<p>  \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u043c xt_string \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  \u0412 string_mt_check (\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 ts_config, (ts \u2013 text search). \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0430\u043a\u0435\u0442\u0430 (skb_find_text) \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0451 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430. \u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0439 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 (\u0444\u0443\u043d\u043a\u0446\u0438\u044f string_mt_destroy) \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 textsearch_destroy, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0446\u0435\u043f\u043e\u0447\u043a\u0438.<\/p>\n<h5>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0443 textsearch_prepare \u0432 xt_wildstring_check<\/h5>\n<p>  \u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c \u043a\u0430\u043a \u0447\u0442\u043e-\u0442\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u2014 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e wildstring_mt, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u043f\u0430\u043a\u0435\u0442\u0430 \u043f\u0440\u0438 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0438\u0431\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u043e\u0438\u0442 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u043e\u043d\u0435\u043c\u043d\u043e\u0433\u0443, \u0430 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u0442 \u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u0442, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u0432\u0430\u0436\u043d\u0430.<\/p>\n<pre><code class=\"cpp\">static bool wildstring_mt(const struct sk_buff *skb, const struct xt_match_param *par) { \treturn false; #if 0 \t... #endif } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043d\u0430\u0448\u0438 ts_conf \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 xt_wildstring_check, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 iptables. \u0421\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0440\u043e\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0438 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u043d\u0435\u043c\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 strsep, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0435\u0439\u0441\u044f \u0440\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u0431\u043e\u0440\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0415\u0441\u043b\u0438 \u0442\u043e\u043a\u0435\u043d \u043d\u0430\u0448\u0451\u043b\u0441\u044f \u2014 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u0438\u043d\u0443 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430.<\/p>\n<pre><code class=\"cpp\">s = (char *) conf-&gt;pattern; conf-&gt;pattern_part1 = strsep(&s, delim); if (!conf-&gt;pattern_part1) \treturn false; \/\/\u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c conf-&gt;patlen_part1 = strlen(conf-&gt;pattern_part1); ts_conf = textsearch_prepare(conf-&gt;algo, conf-&gt;pattern_part1, \t\tconf-&gt;patlen_part1, GFP_KERNEL, flags); if (IS_ERR(ts_conf)) \treturn false; conf-&gt;config_part1 = ts_conf; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 ts_conf \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438, \u0441 \u0442\u043e\u0439 \u043b\u0438\u0448\u044c \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 pattern \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043f\u0443\u0441\u0442\u044b\u043c \u2014 \u0442\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c true, \u0442\u043e \u0435\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u0432.<\/p>\n<h5>\u0418 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u043c \u0438\u0445 \u0432 wildstring_mt_destroy<\/h5>\n<p>  \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 iptables. \u0414\u043b\u044f \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0440\u0430\u0437\u043c\u043d\u043e\u0436\u0438\u043c destroy.<\/p>\n<pre><code class=\"cpp\">static void wildstring_mt_destroy(const struct xt_mtdtor_param *par) { \tstruct xt_wildstring_info *conf = WILDSTRING_TEXT_PRIV(par-&gt;matchinfo);  \tif (conf-&gt;pattern_part1) \t\ttextsearch_destroy(conf-&gt;config_part1); \tif (conf-&gt;pattern_part2) \t\ttextsearch_destroy(conf-&gt;config_part2); \tif (conf-&gt;pattern_part3) \t\ttextsearch_destroy(conf-&gt;config_part3); } <\/code><\/pre>\n<h5>\u0414\u043e\u0432\u043e\u0434\u0438\u043c \u0434\u043e \u0443\u043c\u0430 match<\/h5>\n<p>  \u0418 \u0432\u043e\u0442 \u043c\u043e\u0434\u0443\u043b\u044c \u0441\u0442\u0430\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f-\u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f, \u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f-\u0443\u0434\u0430\u043b\u044f\u0442\u044c\u0441\u044f, \u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 Kernel Panic. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 wildstring_mt \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043d\u0435\u0451 \u043f\u043e\u0438\u0441\u043a \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432.<br \/>  \u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u0438\u043d\u044b \u0441\u0434\u0432\u0438\u0433\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u0443\u044e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n<pre><code class=\"cpp\">unsigned int skb_find = 0; <\/code><\/pre>\n<p>  \u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0441\u0430\u043c\u043e\u0435 \u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435 tmp_from_offset \u0438\u043b\u0438 wildstring_from_offset, \u043d\u043e \u0432\u0441\u0451 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u0445 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435, \u0442\u0430\u043a \u0447\u0442\u043e, \u0443\u0432\u044b, \u043f\u043e\u0437\u0434\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430, \u043c\u044b \u0435\u0433\u043e \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043c \u043d\u0430\u0448\u0435\u0439 \u043d\u043e\u0432\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0438 \u0435\u0441\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u2014 \u0432\u0435\u0440\u043d\u0451\u043c false, \u0438 \u0442\u0430\u043a \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c.<\/p>\n<pre><code class=\"cpp\">memset(&state, 0, sizeof(struct ts_state)); skb_find = skb_find_text((struct sk_buff *)skb, conf-&gt;from_offset, \t\tconf-&gt;to_offset, conf-&gt;config_part1, &state); if (skb_find == UINT_MAX) \treturn false; <\/code><\/pre>\n<p>  \u0418 \u0442\u0430\u043a \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u0434\u043b\u044f config_part2 \u0438 config_part3, \u0441 \u0442\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u0435\u0439, \u0447\u0442\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 pattern_part2 \u0438 pattern_part3 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c true.<\/p>\n<h5>\u0414\u043e\u0431\u0438\u0432\u0430\u0435\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c<\/h5>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043b\u0435\u0447\u0438\u043c \u0432\u0441\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438. \u0412\u043e\u043e\u0431\u0449\u0435 \u043b\u0443\u0447\u0448\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u043e, \u0438 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u043e\u0434\u0443\u043b\u044f \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0438\u043b\u0438 \u043c\u044b \u043d\u0435 \u0437\u0430\u043c\u0435\u0442\u0438\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043b\u0443\u0447\u0438\u043b\u0441\u044f kernel panic. \u0414\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0441\u0442\u043e\u0438\u0442 \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0446\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0430 \u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u043e\u0439 \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 userspace \u0443\u0442\u0438\u043b\u0438\u0442. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0443\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043d\u0430 \u0441\u0442\u0435\u043d\u0434\u0435, \u0432\u0435\u0434\u044c, \u043a\u0430\u043a \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u2014 \u043a\u0430\u043a\u043e\u0439 \u0431\u044b \u0445\u043e\u0440\u043e\u0448\u0435\u0439 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0432\u0435\u0449\u044c \u0432\u043d\u0443\u0442\u0440\u0438, \u0435\u0441\u043b\u0438 \u0435\u0439 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u2014 \u0435\u0439 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0422\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043d\u0430 \u043f\u0430\u0440\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e wget \u0438\u043b\u0438 curl. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 HTTP-\u043f\u0430\u043a\u0435\u0442\u0435 GET \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 HOST, \u0438 \u0448\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0437\u0430\u0434\u043e\u043c \u043d\u0430\u043f\u0435\u0440\u0451\u0434:  <\/p>\n<ul>\n<li>\u00absomething*html*example.com\u00bb<\/li>\n<li>\u00abpron*avi*yoursite\u00bb<\/li>\n<li>\u00abreductor*scheme*carbonsoft.ru\u00bb<\/li>\n<\/ul>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e:<\/p>\n<pre><code class=\"bash\">iptables -I OUTPUT -p tcp \u2013dport 80 -m wildstring \u201creductor*scheme*carbonsoft\u201d -j DROP <\/code><\/pre>\n<p>  \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0443:<\/p>\n<p>  wget -t 1 -T 1 <a href=\"http:\/\/www.carbonsoft.ru\/products\/reductor\/carbon-reductor\/#scheme\">http:\/\/www.carbonsoft.ru\/products\/reductor\/carbon-reductor\/#scheme<\/a><\/p>\n<p>  \u0411\u0438\u043d\u0433\u043e \u2014 \u043c\u044b \u043e\u0431\u043b\u043e\u043c\u0430\u043b\u0438\u0441\u044c \u0438 iptables -nvL OUTPUT \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 \u0441\u043f\u0438\u0441\u043a\u0438?<\/h4>\n<p>  \u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 <a href=\"http:\/\/bash.im\/quote\/403306\">\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043a\u043b\u0438\u043a\u043d\u0435\u0442, \u0434\u0430 \u0447\u0442\u043e \u0442\u0430\u043c, \u0437\u0430\u043e\u0440\u0451\u0442<\/a> \u2014 \u043c\u043e\u043b \u0437\u0430\u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043a\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\/\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432 \u043d\u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043a\u0443, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 pattern, patlen \u0438 config, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0441\u043f\u0438\u0441\u043a\u0443 for_each_entry. \u041d\u043e \u2014 \u0446\u0435\u043b\u044c\u044e \u0441\u0442\u0430\u0442\u044c\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0443\u043b\u044f netfilter, \u0430 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u0432 \u044f\u0434\u0440\u0435 linux \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0430 \u0431\u044b \u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c. \u041d\u0443 \u0438 \u043a \u0442\u043e\u043c\u0443 \u0436\u0435, \u043d\u0430\u0434\u043e \u0436\u0435 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044e \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0439.<\/p>\n<h4>\u0417\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432\u043e\u0442 \u043c\u044b \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438 \u044f\u0434\u0440\u0430 \u0434\u043b\u044f netfilter, \u0440\u0430\u0437\u0432\u0435 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e?<br \/>  \u0412\u043e\u043e\u0431\u0449\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f HTTP, \u043d\u043e \u0438 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u043f\u043e\u0437\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c \u0432 <a href=\"http:\/\/www.carbonsoft.ru\/opensource\/?utm_source=habrahabr&amp;utm_medium=article&amp;utm_content=wildstring&amp;utm_campaign=habr&amp;utm_url=http:\/\/habrahabr.ru\/\">\u0440\u0430\u0437\u0434\u0435\u043b\u0435 opensource \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0430\u0439\u0442\u0435<\/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\/company\/carbonsoft\/blog\/200854\/\"> http:\/\/habrahabr.ru\/company\/carbonsoft\/blog\/200854\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u043d\u0430 \u0445\u0430\u0431\u0440\u0435 \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u044f\u0434\u0440\u0430. \u0412\u0441\u0451 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0451\u043b:  <\/p>\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/138328\/\">\u0423\u0447\u0438\u043c\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c \u044f\u0434\u0440\u0430 (Netfilter) \u0438\u043b\u0438 \u041f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u0434\u043b\u044f HTTPS<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/26391\/\">\u00abLinux Kernel Hacking \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e!\u00bb \u0438\u043b\u0438 \u00ab\u0413\u0434\u0435 \u043d\u0430\u0439\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e?\u00bb<\/a><\/li>\n<li>\u0415\u0449\u0451 2-3 \u0441\u0442\u0430\u0442\u044c\u0438<\/li>\n<\/ul>\n<p>  \u0412\u0441\u0435\u0433\u0434\u0430 \u0443\u0434\u0438\u0432\u043b\u044f\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u043b\u044e\u0434\u0438, \u0431\u043e\u043b\u0435\u0435-\u043c\u0435\u043d\u0435\u0435 \u0437\u043d\u0430\u044e\u0449\u0438\u0435 C, \u0431\u043e\u044f\u0442\u0441\u044f \u0438 \u0438\u0437\u0431\u0435\u0433\u0430\u044e\u0442 \u0434\u0430\u0436\u0435 \u0447\u0438\u0442\u0430\u0442\u044c \u044f\u0434\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u0430\u043a \u0431\u0443\u0434\u0442\u043e \u043e\u043d \u043d\u0430 60% \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0443\u0436 \u0441\u043b\u043e\u0436\u043d\u044b\u0439). \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0435\u0440\u0438\u044e \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u043b\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 netfilter \u0438 iptables.<\/p>\n<p>  \u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043e\u043d\u0438, \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u043e\u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u044f\u0434\u0440\u0430, \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u0435\u043b\u0435\u0439 \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u044e\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0442\u044f\u0442 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0431\u044f \u0432 \u043d\u043e\u0432\u043e\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438.<\/p>\n<h4>\u0427\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c<\/h4>\n<p>  \u041a\u0430\u043a \u0441\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c iptables \u043d\u0430 \u0431\u0430\u0437\u0435 xt_string. Xt_string \u2014 \u044d\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c netfilter, \u0443\u043c\u0435\u0435\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0430\u0439\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u043c\u0443, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0430\u0439\u0442 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041d\u0443, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f GPL, \u0442\u043e \u0447\u0442\u043e \u043c\u0435\u0448\u0430\u0435\u0442 \u0435\u043c\u0443 \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0434\u0430\u0442\u044c?  <\/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-200854","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/200854","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=200854"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/200854\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}