{"id":361,"date":"2023-03-31T21:09:33","date_gmt":"2023-03-31T12:09:33","guid":{"rendered":"https:\/\/www.wiseitservice.co.jp\/?p=361"},"modified":"2023-03-31T21:15:34","modified_gmt":"2023-03-31T12:15:34","slug":"tor-%e5%87%ba%e5%8f%a3ip%e3%81%ae%e3%83%aa%e3%82%b9%e3%83%88%e5%8c%96%e3%81%a8%e3%83%96%e3%83%ad%e3%83%83%e3%82%af","status":"publish","type":"post","link":"https:\/\/www.wiseitservice.co.jp\/?p=361","title":{"rendered":"Tor \u51fa\u53e3IP\u306e\u30ea\u30b9\u30c8\u5316\u3068\u30d6\u30ed\u30c3\u30af"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u3000Tor(The Onion Router)\u3068\u547c\u3070\u308c\u308b\u533f\u540d\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e\u30eb\u30fc\u30bf\u30fc\u304c\u5b58\u5728\u3059\u308b\u3002\u533f\u540d\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306fFrom IP\u3092\u30eb\u30fc\u30bf\u30fc\u3067\u6697\u53f7\u5316\u3059\u308b\u3053\u3068\u3067\u96a0\u853d\u3057\u3001\u63a5\u7d9a\u5148\u306e\u30b5\u30fc\u30d0\u306b\u306fTor\u306e\u51fa\u53e3IP\u304cFrom\u3068\u3057\u3066\u8a18\u9332\u3055\u308c\u308b\u4ed5\u7d44\u307f\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u533f\u540d\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u305d\u306e\u7269\u304c\u60aa\u3068\u8a00\u3046\u308f\u3051\u3067\u306f\u7121\u3044\u304c\u3001\u30b5\u30a4\u30d0\u30fc\u72af\u7f6a\u306b\u5229\u7528\u3055\u308c\u308b\u3053\u3068\u3082\u591a\u304f\u3001\u5229\u7528\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3057\u305f\u3044\u3068\u8003\u3048\u308b\u30b1\u30fc\u30b9\u3082\u3042\u308b\u3002<br>\u3000\u305d\u3046\u3044\u3063\u305f\u3053\u3068\u304b\u3089\u3001\u533f\u540d\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u51fa\u53e3IP\u30a2\u30c9\u30ec\u30b9\u30ea\u30b9\u30c8\u3092\u751f\u6210\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3057\u305f\u3002<br>\u3000Tor\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306eWeb\u30b5\u30a4\u30c8\u304b\u3089\u51fa\u53e3IP\u30a2\u30c9\u30ec\u30b9\u306e\u30ea\u30b9\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u69d8\u306b\u4e0d\u8981\u306a\u60c5\u5831\u3082\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3002\u3053\u306e\u4e2d\u304b\u3089ExitAddress\u306eIP\u90e8\u5206\u3060\u3051\u3092\u629c\u304d\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DFA97DED4CE79FF6F31DAF917C2810CCE8729E9D\nPublished 2023-03-30 12:50:52\nLastStatus 2023-03-31 08:00:00\nExitAddress 45.61.185.83 2023-03-31 08:01:12\nExitNode D04317BF5C7694CE5914E17CBECFAAC88348579D\nPublished 2023-03-31 00:45:49\nLastStatus 2023-03-31 11:00:00\nExitAddress 185.220.101.18 2023-03-31 11:24:31\nExitNode 359068C031765892420A672F28D506C41341AA73\nPublished 2023-03-31 00:34:24\nLastStatus 2023-03-31 11:00:00\nExitAddress 185.194.142.90 2023-03-31 11:23:43\nExitNode E375CD23D60C2291BD04E97CBF4E7BA90E3E54E2\nPublished 2023-03-31 03:08:42\nLastStatus 2023-03-31 10:00:00\nExitAddress 109.70.100.73 2023-03-31 10:09:36<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u7121\u52a0\u5de5\u306e\u30c7\u30fc\u30bf\u3067\u306f\u4f7f\u3044\u306b\u304f\u3044\u305f\u3081\u3001\u3053\u308c\u3092\u6b63\u898f\u8868\u73fe\u3092\u99c6\u4f7f\u3057\u3066\u4e0d\u8981\u306a\u30c7\u30fc\u30bf\u3092\u524a\u9664\u3059\u308b\u3002\u3084\u3063\u3066\u3044\u308b\u4e8b\u306f\u7c21\u5358\u3067 ExitAddress \u3068\u8a18\u8f09\u3055\u308c\u305f\u884c\u3092 sed \u30b3\u30de\u30f3\u30c9\u3067\u52a0\u5de5\u3057IP\u30a2\u30c9\u30ec\u30b9\u306e\u307f\u3092\u629c\u304d\u51fa\u3059\u3002\u629c\u304d\u51fa\u3057\u305fIP\u30a2\u30c9\u30ec\u30b9\u3092\u30d5\u30a1\u30a4\u30eb\u306b\u66f8\u304d\u51fa\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/bash\n\nmv -f toriplist.txt toriplist.old\n\ntoriplist=`curl https:\/\/check.torproject.org\/exit-addresses` \n\nif &#91; $? -ne 0 ]; then\n  mv -f toriplist.old toriplist.txt\n  exit 1\nfi\n\necho \"${toriplist}\" | grep \"ExitAddress\" | while read line; do\n  ip=`echo \"${line}\" | sed -e \"s\/^ExitAddress \\(&#91;0-9]\\{1,3\\}\\.&#91;0-9]\\{1,3\\}\\.&#91;0-9]\\{1,3\\}\\.&#91;0-9]\\{1,3\\}\\).*\/\\1\/g\"`\n  echo \"${ip}\" &gt;&gt; toriplist.txt\ndone<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u4e0a\u8a18\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u5f97\u3089\u308c\u308b\u30c7\u30fc\u30bf\u306f\u7d14\u7c8b\u306aIP\u30a2\u30c9\u30ec\u30b9\u3060\u3051\u306e\u30ea\u30b9\u30c8\u3067\u3042\u308b\u305f\u3081\u3001Firewall\u3068\u9023\u643a\u3059\u308b\u306a\u3069\u81ea\u7531\u306b\u5229\u7528\u3057\u3066\u6b32\u3057\u3044\u3002<br>\u3000\u30d7\u30ed\u30ad\u30b7\u914d\u4e0b\u306e\u74b0\u5883\u3067\u306f curl \u30b3\u30de\u30f3\u30c9\u306e\u30aa\u30d7\u30b7\u30e7\u30f3 -x \u3067\u30d7\u30ed\u30ad\u30b7\u3092\u6307\u5b9a\u3059\u308b\u69d8\u306b\u3059\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/bash\n\nmv -f toriplist.txt toriplist.old\n\ntoriplist=`curl https:\/\/check.torproject.org\/exit-addresses <strong>-x px.example.com<\/strong>` \n\nif &#91; $? -ne 0 ]; then\n  mv -f toriplist.old toriplist.txt\n  exit 1\nfi\n\necho \"${toriplist}\" | grep \"ExitAddress\" | while read line; do\n  ip=`echo \"${line}\" | sed -e \"s\/^ExitAddress \\(&#91;0-9]\\{1,3\\}\\.&#91;0-9]\\{1,3\\}\\.&#91;0-9]\\{1,3\\}\\.&#91;0-9]\\{1,3\\}\\).*\/\\1\/g\"`\n  echo \"${ip}\" &gt;&gt; toriplist.txt\ndone<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000Tor \u306e\u51fa\u53e3IP\u306e\u30ea\u30b9\u30c8\u3092\u624b\u306b\u5165\u308c\u308b\u3053\u3068\u304c\u51fa\u6765\u305f\u3089\u6b21\u306b\u3092\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3084UTM\u306b\u9069\u7528\u3057\u307e\u3059\u3002\u9069\u7528\u65b9\u6cd5\u306b\u95a2\u3057\u3066\u306f\u69d8\u3005\u3042\u308b\u304c\u3001Google Cloud Platform (GCI) \u306b\u4f5c\u6210\u3057\u305f Linux(Debian) \u306e\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb (ufw) \u306b\u9069\u7528\u3057\u3066\u307f\u305f\u306e\u3067\u4f8b\u3092\u6319\u3052\u308b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># cat toriplist.txt | grep -v \"^$\" | sed -r -e \"s\/^(&#91;0-9]{1,3}.&#91;0-9]{1,3}.&#91;0-9]{1,3}.&#91;0-9]{1,3})$\/ufw deny from \\1\/g\" &gt; denytorip.sh\n# chmod 755 denytorip.sh\n# .\/denytorip.sh\n# ufw status numbered\nStatus: active\nTo Action From -- ------ ----\n&#91; 1] 22\/tcp ALLOW IN Anywhere\n&#91; 2] Anywhere DENY IN 45.61.185.83\n&#91; 3] Anywhere DENY IN 185.220.101.18\n&#91; 4] Anywhere DENY IN 185.194.142.90\n&#91; 5] 22\/tcp (v6) ALLOW IN Anywhere (v6)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u4f59\u8ac7\u3060\u304cTor\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u51fa\u53e3IP\u30a2\u30c9\u30ec\u30b9\u306e\u30ea\u30b9\u30c8\u306f\u91cd\u8907\u3057\u3066\u3044\u308b\u3088\u3046\u3060\u3002\u5b9f\u969b\u306b\u5229\u7528\u3059\u308b\u969b\u306f sort \u3057\u3066\u304b\u3089 uniq \u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3059\u308b\u306a\u3069\u3001\u91cd\u8907\u6392\u9664\u3057\u3066\u5229\u7528\u3059\u308b\u306e\u304c\u671b\u307e\u3057\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000Tor(The Onion Router)\u3068\u547c\u3070\u308c\u308b\u533f\u540d\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306e\u30eb\u30fc\u30bf\u30fc\u304c\u5b58\u5728\u3059\u308b\u3002\u533f\u540d\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306fFrom IP\u3092\u30eb\u30fc\u30bf\u30fc\u3067\u6697\u53f7\u5316\u3059\u308b\u3053\u3068\u3067\u96a0\u853d\u3057\u3001\u63a5\u7d9a\u5148\u306e\u30b5\u30fc\u30d0\u306b\u306fTor\u306e\u51fa\u53e3IP\u304cFrom\u3068 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[17],"class_list":["post-361","post","type-post","status-publish","format-standard","hentry","category-tech","tag-17"],"_links":{"self":[{"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=361"}],"version-history":[{"count":12,"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions"}],"predecessor-version":[{"id":374,"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=\/wp\/v2\/posts\/361\/revisions\/374"}],"wp:attachment":[{"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiseitservice.co.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}