{"id":2599,"date":"2016-05-13T00:04:51","date_gmt":"2016-05-12T15:04:51","guid":{"rendered":"http:\/\/tech.akat.info\/?p=2599"},"modified":"2017-01-10T00:52:26","modified_gmt":"2017-01-09T15:52:26","slug":"vuls-debian8","status":"publish","type":"post","link":"https:\/\/tech.akat.info\/?p=2599","title":{"rendered":"Vuls + debian8"},"content":{"rendered":"<p><a href=\"http:\/\/qiita.com\/sadayuki-matsuno\/items\/0bb8bb1689425bb9a21c\">\u3042\u306a\u305f\u306e\u30b5\u30fc\u30d0\u306f\u672c\u5f53\u306b\u5b89\u5168\u3067\u3059\u304b\uff1f\u4eca\u3082\u3063\u3068\u3082\u30a4\u30b1\u3066\u308b\u8106\u5f31\u6027\u691c\u77e5\u30c4\u30fc\u30ebVuls\u3092\u4f7f\u3063\u3066\u307f\u305f<\/a>\u3088\u308a<\/p>\n<h1>\u6ce8\u610f\u4e8b\u9805<\/h1>\n<p>2017\u5e741\u6708\u73fe\u5728\u3001\u4ee5\u4e0b\u65b9\u6cd5\u3067\u5b9f\u65bd\u3059\u308b\u3068<br \/>\ngo get github.com\/kotakanbe\/go-cve-dictionary<br \/>\n\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u3068\u306a\u308a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u306a\u3044\u3002<\/p>\n<p>==============(\u4e0a\u8a18\u65b9\u6cd5)<br \/>\npackage context: unrecognized import path &#8220;context&#8221; (import path does not begin with hostname)<br \/>\n==============(go-cve-dictionary\u3092\u624b\u52d5\u3067make\u3057\u3088\u3046\u3068\u3057\u305f\u3068\u304d)<br \/>\ngo install -ldflags &#8220;-X &#8216;main.version=v0.1.0&#8217; -X &#8216;main.revision=7eb1f1a'&#8221;<br \/>\nmain.go:4:2: cannot find package &#8220;context&#8221; in any of:<br \/>\n        \/root\/go\/src\/github.com\/kotakanbe\/go-cve-dictionary\/vendor\/context (vendor tree)<br \/>\n        \/usr\/lib\/go\/src\/context (from $GOROOT)<br \/>\n        \/root\/go\/src\/context (from $GOPATH)<br \/>\nMakefile:39: recipe for target &#8216;install&#8217; failed<br \/>\nmake: *** [install] Error 1<br \/>\n==============<\/p>\n<p>&#8220;context&#8221;\u30d1\u30c3\u30b1\u30fc\u30b8\uff1f\u5468\u308a\u3067\u30a8\u30e9\u30fc\u3068\u306a\u308b\u6a21\u69d8\u3002<br \/>\nvuls\u306ego\u306e\u63a8\u5968\u30d0\u30fc\u30b8\u30e7\u30f3\u304c1.7.1\u4ee5\u4e0a\u3068\u306a\u3063\u3066\u3044\u308b\u305f\u3081<br \/>\ngo\u306f\u8a18\u4e8b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u6700\u65b0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u3002<\/p>\n<h1>Vuls(Vulnerability Scanner)\u3068\u306f<\/h1>\n<p>\u30fb\u8106\u5f31\u6027\u691c\u77e5\u30c4\u30fc\u30eb<br \/>\n\u30fbgolang\u88fd\u306e\u8106\u5f31\u6027\u691c\u77e5\u30c4\u30fc\u30eb<br \/>\n\u30fbUbuntu,Debian,CentOS,Amazon Linux,RHEL\u306b\u5bfe\u5fdc<\/p>\n<h1>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5<\/h1>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n### \u5fc5\u9808\u30bd\u30d5\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb ###\r\nroot@hostname:\/home\/shimizu# aptitude install sqlite3 gcc git \r\nroot@hostname:\/home\/shimizu# aptitude install software-properties-common\r\n...\r\nroot@hostname:\/home\/shimizu# add-apt-repository ppa:ubuntu-lxc\/lxd-stable\r\nroot@hostname:\/home\/shimizu# vi \/etc\/apt\/sources.list.d\/ubuntu-lxc-lxd-stable-jessie.list\r\n# jessie \u2192 trusty \u306b\u5909\u66f4\u3057\u305f\r\nroot@hostname:\/home\/shimizu# aptitude update\r\n...\r\nroot@hostname:\/home\/shimizu# aptitude install golang-go\r\n\r\nroot@hostname:\/home\/shimizu# sqlite3 --version\r\n3.8.7.1 2014-10-29 13:59:56 3b7b72c4685aa5cf5e675c2c47ebec10d9704221\r\nroot@hostname:\/home\/shimizu# gcc -dumpversion\r\n4.9.2\r\nroot@hostname:\/home\/shimizu# git --version\r\ngit version 2.1.4\r\nroot@hostname:\/home\/shimizu# go version\r\ngo version go1.6 linux\/amd64\r\n\r\n### cve\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3055\u305b\u308b ###\r\nroot@hostname:\/home\/shimizu# mkdir \/var\/log\/vuls\r\nroot@hostname:\/home\/shimizu# chmod 700 \/var\/log\/vuls\r\nroot@hostname:\/home\/shimizu# mkdir \/usr\/local\/src\/vuls\r\nroot@hostname:\/home\/shimizu# mkdir \/usr\/local\/go\r\nroot@hostname:\/home\/shimizu# cat \/etc\/profile.d\/goenv.sh\r\nexport GOROOT=\/usr\/lib\/go\r\nexport GOPATH=$HOME\/go\r\nexport PATH=$PATH:$GOROOT\/bin:$GOPATH\/bin\r\nroot@hostname:\/home\/shimizu# source \/etc\/profile.d\/goenv.sh\r\nroot@hostname:\/home\/shimizu# go get github.com\/kotakanbe\/go-cve-dictionary\r\n...\r\nroot@hostname:\/home\/shimizu# for i in {2002..2016}; do go-cve-dictionary fetchnvd -years $i; done\r\n 0 \/ 1 &#x5B;--------------------------------------------------]   0.00%&#x5B;May  9 01:22:38]  INFO Fetching... https:\/\/static.nvd.nist.gov\/feeds\/xml\/cve\/nvdcve-2.0-2002.xml.gz\r\n...\r\n&#x5B;May  9 01:38:52]  INFO Refreshed 1533 Nvds.\r\n\r\nroot@hostname:\/home\/shimizu# go-cve-dictionary server\r\n&#x5B;May 10 00:05:32]  INFO Opening DB. datafile: \/home\/shimizu\/cve.sqlite3\r\n&#x5B;May 10 00:05:32]  INFO Migrating DB\r\n&#x5B;May 10 00:05:34]  INFO Starting HTTP Sever...\r\n&#x5B;May 10 00:05:34]  INFO Listening on 127.0.0.1:1323\r\n...\r\n\r\n### vuls\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb ###\r\nroot@hostname:\/home\/shimizu# go get github.com\/future-architect\/vuls\r\n\r\n<\/pre>\n<h2>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6ce8\u610f\u70b9<\/h2>\n<h3>go 1.6 on debian8<\/h3>\n<p>\u30a8\u30e9\u30fc  http:\/\/ppa.launchpad.net jessie\/main Sources<br \/>\n  404  Not Found<br \/>\n\u30a8\u30e9\u30fc  http:\/\/ppa.launchpad.net jessie\/main amd64 Packages<br \/>\n  404  Not Found<\/p>\n<p>\/etc\/apt\/sources.list.d\/ubuntu-lxc-lxd-stable-jessie.list \u306e jessie\u3092trusty\u306b\u5909\u66f4\u3057\u306a\u3044\u3068\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc<\/p>\n<h3>import path does not begin with hostname<\/h3>\n<p>\u516c\u5f0f\u306e\u901a\u308a GOROOT=\/usr\/local\/go \u3068\u3059\u308b\u3068debian\u3067\u306f\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u3068\u306a\u308a\u5148\u306b\u9032\u3081\u306a\u3044<\/p>\n<p>root@hostname:\/home\/shimizu# go get github.com\/kotakanbe\/go-cve-dictionary<br \/>\npackage flag: unrecognized import path &#8220;flag&#8221; (import path does not begin with hostname)<br \/>\npackage fmt: unrecognized import path &#8220;fmt&#8221; (import path does not begin with hostname)<br \/>\npackage errors: unrecognized import path &#8220;errors&#8221; (import path does not begin with hostname)<br \/>\npackage sync: unrecognized import path &#8220;sync&#8221; (import path does not begin with hostname)<br \/>\npackage time: unrecognized import path &#8220;time&#8221; (import path does not begin with hostname)<br \/>\npackage io: unrecognized import path &#8220;io&#8221; (import path does not begin with hostname)<br \/>\npackage os: unrecognized import path &#8220;os&#8221; (import path does not begin with hostname)<br \/>\npackage path: unrecognized import path &#8220;path&#8221; (import path does not begin with hostname)<br \/>\npackage sort: unrecognized import path &#8220;sort&#8221; (import path does not begin with hostname)<br \/>\n&#8230;<\/p>\n<h3>GOPATH<\/h3>\n<p>\/etc\/profile.d\/goenv.sh \u306e\u8a2d\u5b9a\u3092\u305b\u305a\u306b\u3001GOPATH\u3060\u3051\u6307\u5b9a\u3059\u308b\u3068\u4ee5\u4e0b\u30a8\u30e9\u30fc\u3068\u306a\u308a\u306f\u307e\u3063\u305f<br \/>\n# github.com\/jinzhu\/gorm<br \/>\nsrc\/github.com\/jinzhu\/gorm\/utils.go:137: syntax error: unexpected range, expecting {<\/p>\n<h3>vuls\u3092\u5b9f\u884c\u3059\u308b<\/h3>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nroot@hostname:\/home\/shimizu# mkdir \/root\/vuls\r\nroot@hostname:\/home\/shimizu# cd \/root\/vuls\/\r\nroot@hostname:~\/vuls# cat config.toml\r\n&#x5B;servers]\r\n\r\n&#x5B;servers.server1]\r\nhost         = &quot;127.0.0.1&quot;\r\nport        = &quot;2022&quot;\r\nuser        = &quot;vulsuser&quot;\r\nkeyPath     = &quot;\/home\/vulsuser\/.ssh\/id_rsa&quot;\r\n\r\nroot@hostname:~\/vuls# vuls prepare -ask-sudo-password\r\nsudo password: ********\r\nINFO&#x5B;0012] Start Preparing (config: \/root\/vuls\/config.toml)\r\n&#x5B;May 10 01:13:27]  INFO &#x5B;localhost] Detecting OS...\r\n&#x5B;May 10 01:13:27]  INFO &#x5B;localhost] (1\/1) Successfully detected. server1: debian 8.4\r\n&#x5B;May 10 01:13:27]  INFO &#x5B;localhost] Installing...\r\n&#x5B;May 10 01:13:27]  INFO &#x5B;server1:2022] apt-get update...\r\n&#x5B;May 10 01:13:59]  INFO &#x5B;server1:2022] Installed: aptitude\r\n&#x5B;May 10 01:13:59]  INFO &#x5B;localhost] Success\r\n\r\nroot@hostname:~\/vuls# vuls scan -ask-sudo-password -lang=ja\r\nsudo password: ********\r\nINFO&#x5B;0003] Start scanning (config: \/root\/vuls\/config.toml)\r\n&#x5B;May 10 01:14:52]  INFO &#x5B;localhost] Validating Config...\r\n&#x5B;May 10 01:14:52]  INFO &#x5B;localhost] Detecting the type of OS...\r\n&#x5B;May 10 01:14:52]  INFO &#x5B;localhost] (1\/1) Successfully detected. server1: debian 8.4\r\n&#x5B;May 10 01:14:52]  INFO &#x5B;localhost] Scanning vulnerabilities...\r\n&#x5B;May 10 01:14:52]  INFO &#x5B;localhost] Check required packages for scanning...\r\n&#x5B;May 10 01:14:52]  INFO &#x5B;localhost] Scanning vulnerable OS packages...\r\n&#x5B;May 10 01:15:22]  INFO &#x5B;server1:2022] Fetching CVE details...\r\n&#x5B;May 10 01:15:22]  INFO &#x5B;server1:2022] Done\r\n&#x5B;May 10 01:15:22]  INFO &#x5B;localhost] Scanning vulnerable software specified in the CPE...\r\n&#x5B;May 10 01:15:22]  INFO &#x5B;localhost] Reporting...\r\n\r\nserver1 (debian 8.4)\r\n====================\r\nNo unsecure packages.\r\n\r\n&#x5B;May 10 01:15:22]  INFO &#x5B;localhost] Insert to DB...\r\n\r\n### \u7d50\u679c\u3092\u8868\u793a\u3059\u308b ###\r\nroot@hostname:~\/vuls# vuls tui\r\n<\/pre>\n<h1>\u53c2\u8003URL<\/h1>\n<p><a href=\"https:\/\/github.com\/golang\/go\/wiki\/Ubuntu\">Install package golang<\/a><br \/>\n<a href=\"http:\/\/stackoverflow.com\/questions\/20458796\/unrecognized-import-path-with-go-get\">\u201cunrecognized import path\u201d with go get<\/a><br \/>\n<a href=\"http:\/\/zacodesign.net\/blog\/?p=2828\">\u8a71\u984c\u306e\u8106\u5f31\u6027\u691c\u77e5\u30c4\u30fc\u30ebVULS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3001\u4f7f\u7528\u65b9\u6cd5\u306e\u7d39\u4ecb<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3042\u306a\u305f\u306e\u30b5\u30fc\u30d0\u306f\u672c\u5f53\u306b\u5b89\u5168\u3067\u3059\u304b\uff1f\u4eca\u3082\u3063\u3068\u3082\u30a4\u30b1\u3066\u308b\u8106\u5f31\u6027\u691c\u77e5\u30c4\u30fc\u30ebVuls\u3092\u4f7f\u3063\u3066\u307f\u305f\u3088\u308a \u6ce8\u610f\u4e8b\u9805 2017\u5e741\u6708\u73fe\u5728\u3001\u4ee5\u4e0b\u65b9\u6cd5\u3067\u5b9f\u65bd\u3059\u308b\u3068 go get github.com\/kotakanbe\/go-cve-di [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[37],"tags":[],"_links":{"self":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/2599"}],"collection":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2599"}],"version-history":[{"count":3,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/2599\/revisions"}],"predecessor-version":[{"id":2693,"href":"https:\/\/tech.akat.info\/index.php?rest_route=\/wp\/v2\/posts\/2599\/revisions\/2693"}],"wp:attachment":[{"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tech.akat.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}