{"id":1961,"date":"2016-04-07T17:30:04","date_gmt":"2016-04-07T08:30:04","guid":{"rendered":"http:\/\/www.nightmare-yk.com\/?p=1961"},"modified":"2016-04-07T17:32:48","modified_gmt":"2016-04-07T08:32:48","slug":"snortsam-%e4%b8%8d%e6%ad%a3%e4%be%b5%e5%85%a5%e5%af%be%e5%bf%9c","status":"publish","type":"post","link":"http:\/\/www.nightmare-yk.com\/?p=1961","title":{"rendered":"snortsam -\u4e0d\u6b63\u4fb5\u5165\u5bfe\u5fdc-"},"content":{"rendered":"<p>\u4e45\u3005\u306e\u6280\u8853\u30e1\u30e2\u3067\u3059\u3002<\/p>\n<p>\u30b5\u30fc\u30d0\u306b\u4e0d\u6b63\u306a\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u969b\u3001\u81ea\u52d5\u3067\u62d2\u5426\u3057\u3066\u304f\u308c\u308b\u3068\u3042\u308a\u304c\u305f\u3044\u3067\u3059\u3088\u306d(o^\u2207^o)\uff89<br \/>\nsnort\u3068snortsam\u3092\u4f7f\u3044\u3001\u81ea\u52d5\u306biptables\u306b\u62d2\u5426\u306e\u8a2d\u5b9a\u3092\u6295\u5165\u3059\u308b\u3053\u3068\u3067\u3067\u304d\u3061\u3083\u3044\u307e\u3059(*\uff9f\u25bd\uff9f)\uff89<\/p>\n<p>\u4ee5\u4e0b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u307e\u3059<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># yum install epel-release libtool automake flex flex-devel bison libpcap-devel pcre-devel libdnet-devel zlib-devel<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snort\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u5fc5\u8981\u306adaq\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># cd \/tmp\r\n# tar zxf daq-2.0.6.tar.gz\r\n# cd daq-2.0.6\r\n# .\/configure\r\n# make\r\n# make install<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snortsam\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># cd \/tmp\r\n# tar zxf snortsam-src-2.70.tar.gz\r\n# cd snortsam\r\n# chmod +x makesnortsam.sh\r\n# .\/makesnortsam.sh\r\n# cp -p snortsam \/usr\/local\/bin\/<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snortsam\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># cp -p conf\/snortsam.conf.sample \/etc\/snortsam.conf<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snort\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># cd \/tmp\r\n# gunzip snortsam-2.9.5.3-2.diff.gz\r\n# tar zxf snort-2.9.5.3.tar.gz\r\n# cd snort-2.9.5.3\r\n# patch -p1 < ..\/snortsam-2.9.5.3-2.diff\r\n# chmod +x autojunk.sh\r\n# .\/autojunk.sh\r\n# .\/configure\r\n# make\r\n# make install<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snort\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># mkdir \/etc\/snort\r\n# chmod 700 \/etc\/snort\r\n# cd etc\r\n# cp classification.config snort.conf reference.config threshold.conf *.map \/etc\/snort\r\n# touch \/etc\/snort\/rules\/white_list.rules\r\n# touch \/etc\/snort\/rules\/black_list.rules\r\n# mkdir -p \/usr\/local\/lib\/snort_dynamicrules<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snort\u306e\u30eb\u30fc\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># cd \/tmp\r\n# tar zxf snortrules-snapshot-2953.tar.gz\r\n# cp -rp so_rules\/ \/etc\/snort\/\r\n# cp -rp rules\/ \/etc\/snort\/\r\n# cp -rp preproc_rules \/etc\/snort\/\r\n\r\n# tar zxf community-rules.tar.gz\r\n# cd community-rules\r\n# cp -p community.rules \/etc\/snort\/rules\/<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snort\u306e\u30ed\u30b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># mkdir \/var\/log\/snort<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snort\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u3001https:\/\/\u30b5\u30fc\u30d0IP\/DETECTION-TEST\u3068\u3044\u3046URL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5834\u5408\u306b\u30011\u5206\u9593\u63a5\u7d9a\u3092\u62d2\u5426\u3059\u308b\u8a2d\u5b9a\u3092\u3057\u307e\u3057\u305f\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># cp -p \/etc\/snort\/snort.conf \/etc\/snort\/snort.conf.org\r\n# vi \/etc\/snort\/snort.conf\r\n\uff5e\u5185\u5bb9\u3092\u5909\u66f4\r\n# diff \/etc\/snort\/snort.conf.org \/etc\/snort\/snort.conf\r\n104,106c105,107\r\n< var RULE_PATH ..\/rules\r\n< var SO_RULE_PATH ..\/so_rules\r\n< var PREPROC_RULE_PATH ..\/preproc_rules\r\n---\r\n> var RULE_PATH rules\r\n> var SO_RULE_PATH so_rules\r\n> var PREPROC_RULE_PATH preproc_rules\r\n113,114c114,115\r\n< var WHITE_LIST_PATH ..\/rules\r\n< var BLACK_LIST_PATH ..\/rules\r\n---\r\n> var WHITE_LIST_PATH rules\r\n> var BLACK_LIST_PATH rules\r\n726a728,732\r\n> output alert_fwsam: localhost:898\/password\r\n> alert tcp any any -> any 80 (msg:\"web detection test\"; content:\"DETECTION-TEST\";nocase; sid:1000000; fwsam: src, 1 minutes;)<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snortsam\u306e\u8a2d\u5b9a\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># vi \/etc\/snortsam.conf\r\n\uff5e\u5185\u5bb9\u3092\u5909\u66f4\r\n# diff \/tmp\/snortsam\/conf\/snortsam.conf.sample \/etc\/snortsam.conf\r\n41a42\r\n> defaultkey password\r\n67a69\r\n> accept localhost, password\r\n248a251,252\r\n> logfile \/var\/log\/snortsam.log\r\n>\r\n263a268,269\r\n> loglevel 2\r\n>\r\n659a666,667\r\n> iptables eth0 log<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>\u624b\u9806\u901a\u308a\u306b\u3084\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u3055\u307b\u3069\u96e3\u3057\u304f\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\uff01\uff01<br \/>\n\u3067\u306f\u3001\u5b9f\u969b\u306e\u52d5\u4f5c\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046(*\u00b4\u2207\uff40*)<\/p>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u624b\u52d5\u3067snort\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># snort -c \/etc\/snort\/snort.conf -l \/var\/log\/snort -k none -A fast<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>snortsam\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre># snortsam \/etc\/snortsam.conf<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>iptables\u306e\u8a2d\u5b9a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre>Chain INPUT (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0           state RELATED,ESTABLISHED\r\nACCEPT     icmp --  0.0.0.0\/0            0.0.0.0\/0\r\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0\r\nACCEPT     tcp  --  0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:22\r\nACCEPT     tcp  --  0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:80\r\nREJECT     all  --  0.0.0.0\/0            0.0.0.0\/0           reject-with icmp-host-prohibited\r\n\r\nChain FORWARD (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nREJECT     all  --  0.0.0.0\/0            0.0.0.0\/0           reject-with icmp-host-prohibited\r\n\r\nChain OUTPUT (policy ACCEPT)\r\ntarget     prot opt source               destination<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>\u8a72\u5f53\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3092\u3057\u305f\u5834\u5408\u3001iptables\u306e\u30eb\u30fc\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n192.168.8.10\u306e\u30a2\u30af\u30bb\u30b9\u3092DROP\u3059\u308b\u30eb\u30fc\u30eb\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre>Chain INPUT (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nDROP       all  --  0.0.0.0\/0            192.168.8.10\r\nDROP       all  --  192.168.8.10         0.0.0.0\/0\r\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0           state RELATED,ESTABLISHED\r\nACCEPT     icmp --  0.0.0.0\/0            0.0.0.0\/0\r\nACCEPT     all  --  0.0.0.0\/0            0.0.0.0\/0\r\nACCEPT     tcp  --  0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:22\r\nACCEPT     tcp  --  0.0.0.0\/0            0.0.0.0\/0           state NEW tcp dpt:80\r\nREJECT     all  --  0.0.0.0\/0            0.0.0.0\/0           reject-with icmp-host-prohibited\r\n\r\nChain FORWARD (policy ACCEPT)\r\ntarget     prot opt source               destination\r\nDROP       all  --  0.0.0.0\/0            192.168.8.10\r\nDROP       all  --  192.168.8.10         0.0.0.0\/0\r\nREJECT     all  --  0.0.0.0\/0            0.0.0.0\/0           reject-with icmp-host-prohibited\r\n\r\nChain OUTPUT (policy ACCEPT)\r\ntarget     prot opt source               destination<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>\u30ed\u30b0\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre>Blocking host 10.1.1.114 completely for 60 seconds (Sig_ID: 1000000).<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>\u3061\u306a\u307f\u306b\u3001\u4eca\u56de\u306e\u8a2d\u5b9a\u306f\u30011\u5206\u9593\u306e\u5236\u9650\u3092\u3064\u3051\u305f\u305f\u3081\u30011\u5206\u7d4c\u3063\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ed\u30b0\u3092\u51fa\u529b\u3057\u3066\u3001DROP\u306e\u5236\u9650\u3092\u89e3\u9664\u3057\u307e\u3059\u3002<\/p>\n<table style=\"table-layout:fixed;\">\n<tr>\n<td>\n<div style=\"overflow-x:auto;\">\n<pre>Removing 60 sec complete block for host 10.1.1.114.\r\nInfo: UnBlocking ip 10.1.1.114<\/pre>\n<\/p><\/div>\n<\/td>\n<\/tr>\n<\/table>\n<p>\u3044\u308d\u3044\u308d\u306a\u5236\u9650\u304c\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u4e00\u5ea6\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"http:\/\/www.nightmare-yk.com\/?p=1961\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"http:\/\/www.nightmare-yk.com\/?p=1961\" ><\/g:plusone><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4e45\u3005\u306e\u6280\u8853\u30e1\u30e2\u3067\u3059\u3002 \u30b5\u30fc\u30d0\u306b\u4e0d\u6b63\u306a\u30a2\u30af\u30bb\u30b9\u304c\u3042\u3063\u305f\u969b\u3001\u81ea\u52d5\u3067\u62d2\u5426\u3057\u3066\u304f\u308c\u308b\u3068\u3042\u308a\u304c\u305f\u3044\u3067\u3059\u3088\u306d(o^\u2207^o)\uff89 snort\u3068snortsam\u3092\u4f7f\u3044\u3001\u81ea\u52d5\u306biptables\u306b\u62d2\u5426\u306e\u8a2d\u5b9a\u3092\u6295\u5165\u3059\u308b\u3053\u3068\u3067\u3067\u304d\u3061\u3083\u3044\u307e\u3059(*\uff9f\u25bd\uff9f)\uff89 \u4ee5\u4e0b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002 \u307e\u305a\u3001\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1970,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[21,22,299,300,302,301],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.nightmare-yk.com\/wp-content\/uploads\/2016\/04\/b6743695471502888c024c7ad56ef1dd.jpg?fit=730%2C350","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/posts\/1961"}],"collection":[{"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1961"}],"version-history":[{"count":5,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/posts\/1961\/revisions"}],"predecessor-version":[{"id":1973,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/posts\/1961\/revisions\/1973"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=\/wp\/v2\/media\/1970"}],"wp:attachment":[{"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1961"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.nightmare-yk.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}