TSUBOCK★LABO-ツボックラボ-

とあるセキュリティエンジニアの技術メモブログ

MENU

OSSのRSSリーダー「TinyTinyRSS」のAPIを触ってみる

前回記事の続き、今回はTinyTinyRSSのAPIを触ってみようと思います。

環境構築の方法は前回の記事をどーぞ!

www.tsubock-lab.xyz

APIがある

TinyTinyRSSではAPIが公開されています。

ApiReference - Tiny Tiny RSS

APIでRSS情報を収集してシステムと連携するなんて使い方もできそうですね。ちょっとAPIについても触ってみたいと思います。

APIの有効化

TinyTinyRSSはそのままではAPIを使用することができないので、APIの有効化を行う必要があります。右上のハンバーガーメニューから設定を選択します。

f:id:panda-loves-smile:20200718015412p:plain
TinyTinyRSS - API有効化設定01

設定タブの全体の中に[APIを有効にする]があります。初期状態はチェックされていない状態なので、チェックを入れます。

f:id:panda-loves-smile:20200718015716p:plain
TinyTinyRSS - API有効化設定02

設定を保存すればAPIが使用できるようになります。

ログイン

TinyTinyRSSにログインします。ログインAPIにはuserpasswordをリクエストします。レスポンスでsession_idを取得することができます。

  • request
$ curl -d '{"op":"login", "user":"admin", "password":"password"}' http://localhost:8280/tt-rss/api/
  • response
{"seq":0,
 "status":0,
 "content":
 {"session_id":"7cugckd3jophsejqiti152js6i",
  "api_level":14}
}

feedを取得する

購読feedの一覧を取得します。"sid"はログイン時に取得したsession_idを入力します。

  • request
$ curl -d '{"sid":"7cugckd3jophsejqiti152js6i", "op":"getFeeds"}' http://localhost:8280/tt-rss/api/
  • response
{
  "seq": 0,
  "status": 0,
  "content": [
    {
      "feed_url": "https://www.tsubock-lab.xyz/rss",
      "title": "TSUBOCK★LABO-ツボックラボ-",
      "id": 2,
      "unread": 28,
      "has_icon": true,
      "cat_id": 0,
      "last_updated": 1594999471,
      "order_id": 0
    },
    {
      "feed_url": "https://tt-rss.org/forum/rss.php",
      "title": "Tiny Tiny RSS: Forum",
      "id": 1,
      "unread": 0,
      "has_icon": true,
      "cat_id": 0,
      "last_updated": 1594999836,
      "order_id": 0
    }
  ]
}

未読件数を取得する

未読件数を取得します。

  • request
$ curl -d '{"sid":"7cugckd3jophsejqiti152js6i", "op":"getUnread"}' http://localhost:8280/tt-rss/api/
  • response
{
  "seq": 0,
  "status": 0,
  "content": {
    "unread": 28
  }
}

"unread"件数については購読Feed一覧でも取得できるので、そちらを使った方が楽かも??

見出しを取得する

購読Feedに対しての見出し一覧を取得します。引数は公式を確認すると色々ありますが、とりあえず簡単なところで"feed_id"を指定してみます。先ほどgetFeedsで取得した購読Feed一覧の中からツボックラボの見出しを取得してみたいと思います。全ての記事を取得するとレスポンスが見ずらいので、とりあえずlimitパラメータで3件を指定して取得してみます。

  • request
$ curl -d '{"sid":"7cugckd3jophsejqiti152js6i", "op":"getHeadlines", "feed_id":2, "limit": 3}' http://localhost:8280/tt-rss/api/
  • response
{
  "seq": 0,
  "status": 0,
  "content": [
    {
      "id": 37,
      "guid": "{\"ver\":2,\"uid\":1,\"hash\":\"SHA1:007c305d328340a5da6bf782c05e29bf499bc122\"}",
      "unread": true,
      "marked": false,
      "published": false,
      "updated": 1594563364,
      "is_updated": false,
      "title": "PlantUMLでシーケンス図を描いてみる",
      "link": "https://www.tsubock-lab.xyz/entry/2020/07/12/231604?utm_source=feed",
      "feed_id": 2,
      "tags": [
        "plantuml"
      ],
      "labels": [],
      "feed_title": "TSUBOCK★LABO-ツボックラボ-",
      "comments_count": 0,
      "comments_link": "",
      "always_display_attachments": false,
      "author": "",
      "score": 0,
      "note": null,
      "lang": "",
      "content": "",
      "flavor_image": "https://cdn-ak.f.st-hatena.com/images/fotolife/p/panda-loves-smile/20200712/20200712231427.png",
      "flavor_stream": ""
    },
    {
      "id": 38,
      "guid": "{\"ver\":2,\"uid\":1,\"hash\":\"SHA1:7d392d739eaec739f22cd2d396c91b58c8bc9732\"}",
      "unread": true,
      "marked": false,
      "published": false,
      "updated": 1594388340,
      "is_updated": false,
      "title": "OSSハニーポット「Cowrie」を触ってみた",
      "link": "https://www.tsubock-lab.xyz/entry/2020/07/10/223900?utm_source=feed",
      "feed_id": 2,
      "tags": [
        ""
      ],
      "labels": [],
      "feed_title": "TSUBOCK★LABO-ツボックラボ-",
      "comments_count": 0,
      "comments_link": "",
      "always_display_attachments": false,
      "author": "",
      "score": 0,
      "note": null,
      "lang": "",
      "content": "",
      "flavor_image": "https://cdn.user.blog.st-hatena.com/default_entry_og_image/126415417/1592406732551062",
      "flavor_stream": ""
    },
    {
      "id": 39,
      "guid": "{\"ver\":2,\"uid\":1,\"hash\":\"SHA1:c48e49ebedf0464716627cf6d0c38b6c414e4b7f\"}",
      "unread": true,
      "marked": false,
      "published": false,
      "updated": 1593960548,
      "is_updated": false,
      "title": "二要素認証のワンタイムパスワードをPythonで自動生成処理してみる",
      "link": "https://www.tsubock-lab.xyz/entry/2020/07/05/234908?utm_source=feed",
      "feed_id": 2,
      "tags": [
        ""
      ],
      "labels": [],
      "feed_title": "TSUBOCK★LABO-ツボックラボ-",
      "comments_count": 0,
      "comments_link": "",
      "always_display_attachments": false,
      "author": "",
      "score": 0,
      "note": null,
      "lang": "",
      "content": "",
      "flavor_image": "https://cdn.user.blog.st-hatena.com/default_entry_og_image/126415417/1592406732551062",
      "flavor_stream": ""
    }
  ]
}

最新から降順で3件取得できました。取得したレスポンスの"content":の中の"id"が記事のIDになります。次は記事を取得してみましょう。

更新記事を取得する

getHeadlineで取得した"id"一覧から特定の記事のみを取得します。今回は先ほど取得した3件のうち、2件目のものを取得してみます。

  • request
$ curl -d '{"sid":"7cugckd3jophsejqiti152js6i", "op":"getArticle", "article_id": 38}' http://localhost:8280/tt-rss/api/
  • response
{
  "seq": 0,
  "status": 0,
  "content": [
    {
      "id": 38,
      "guid": "{\"ver\":2,\"uid\":1,\"hash\":\"SHA1:7d392d739eaec739f22cd2d396c91b58c8bc9732\"}",
      "title": "OSSハニーポット「Cowrie」を触ってみた",
      "link": "https://www.tsubock-lab.xyz/entry/2020/07/10/223900?utm_source=feed",
      "labels": [],
      "unread": true,
      "marked": false,
      "published": false,
      "comments": "",
      "author": "",
      "updated": 1594388340,
      "feed_id": 2,
      "attachments": [
        {
          "id": 2,
          "0": 2,
          "content_url": "https://cdn.user.blog.st-hatena.com/default_entry_og_image/126415417/1592406732551062",
          "1": "https://cdn.user.blog.st-hatena.com/default_entry_og_image/126415417/1592406732551062",
          "content_type": "image/png",
          "2": "image/png",
          "title": "",
          "3": "",
          "duration": "0",
          "4": "0",
          "width": 0,
          "5": 0,
          "height": 0,
          "6": 0,
          "post_id": 38,
          "7": 38
        }
      ],
      "score": 0,
      "feed_title": "TSUBOCK★LABO-ツボックラボ-",
      "note": null,
      "lang": "",
      "content": "<p>&#12469;&#12452;&#12496;&#12540;&#12475;&#12461;&#12517;&#12522;&#12486;&#12451;&#12398;&#24773;&#22577;&#21454;&#38598;&#12398;&#19968;&#12388;&#12391;&#12300;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12301;&#12392;&#12356;&#12358;&#25216;&#34899;&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;&#20170;&#22238;&#12399;&#26989;&#21209;&#20013;&#12395;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12395;&#12388;&#12356;&#12390;&#35519;&#12409;&#12390;&#12356;&#12427;&#20013;&#12391;&#12398;&#35226;&#26360;&#12392;&#12375;&#12390;&#26412;&#35352;&#20107;&#12434;&#27531;&#12375;&#12390;&#12362;&#12365;&#12414;&#12377;&#12290;</p>\n\n<h2>&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12392;&#12399;</h2>\n\n<p>&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12399;&#33030;&#24369;&#24615;&#12398;&#12354;&#12427;&#12469;&#12540;&#12499;&#12473;&#12434;&#23455;&#38555;&#12395;&#12289;&#12414;&#12383;&#12399;&#30097;&#20284;&#30340;&#12395;&#21205;&#12363;&#12375;&#12390;&#19981;&#27491;&#12450;&#12463;&#12475;&#12473;&#12434;&#21463;&#12369;&#20184;&#12369;&#12427;&#12383;&#12417;&#12398;&#12471;&#12473;&#12486;&#12512;&#12391;&#12377;&#12290;&#25915;&#25731;&#32773;&#12399;&#19981;&#27491;&#12450;&#12463;&#12475;&#12473;&#12364;&#25104;&#21151;&#12377;&#12427;&#12392;&#12289;&#27096;&#12293;&#12394;&#25163;&#27861;&#12391;&#25915;&#25731;&#12434;&#35430;&#34892;&#12375;&#12390;&#12365;&#12414;&#12377;&#12290;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12399;&#25915;&#25731;&#35430;&#34892;&#12434;&#12525;&#12464;&#12392;&#12375;&#12390;&#35352;&#37682;&#12375;&#12289;&#25915;&#25731;&#26041;&#27861;&#12394;&#12393;&#12434;&#21454;&#38598;&#12377;&#12427;&#30446;&#30340;&#12391;&#35373;&#32622;&#12375;&#12414;&#12377;&#12290;</p>\n\n<p>&#21454;&#38598;&#26041;&#27861;&#12392;&#12375;&#12390;&#12399;&#22823;&#12365;&#12367;&#20998;&#12369;&#12390;&#12289;</p>\n\n<ul>\n<li>&#23455;&#38555;&#12395;&#33030;&#24369;&#24615;&#12398;&#12354;&#12427;&#12469;&#12540;&#12499;&#12473;&#12434;&#22806;&#37096;&#20844;&#38283;&#12375;&#12390;&#25915;&#25731;&#12434;&#24453;&#12385;&#21463;&#12369;&#12427;<strong>&#39640;&#23550;&#35441;&#22411;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;</strong></li>\n<li>&#33030;&#24369;&#24615;&#12398;&#12354;&#12427;&#12469;&#12540;&#12499;&#12473;&#12434;&#12456;&#12511;&#12517;&#12524;&#12540;&#12488;&#12375;&#12289;&#22806;&#37096;&#20844;&#38283;&#12375;&#12390;&#25915;&#25731;&#12434;&#24453;&#12385;&#21463;&#12369;&#12427;<strong>&#20302;&#23550;&#35441;&#22411;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;</strong></li>\n</ul>\n\n\n<p>&#12364;&#12354;&#12426;&#12414;&#12377;&#12290;</p>\n\n<p><strong>&#39640;&#23550;&#35441;&#22411;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;</strong>&#12391;&#12399;&#26412;&#29289;&#12398;&#33030;&#24369;&#24615;&#12398;&#12354;&#12427;&#12469;&#12540;&#12499;&#12473;&#12434;&#20844;&#38283;&#12377;&#12427;&#12371;&#12392;&#12391;&#12289;&#12424;&#12426;&#35443;&#32048;&#12394;&#12525;&#12464;&#24773;&#22577;&#12434;&#21454;&#38598;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12364;&#12289;&#21516;&#26178;&#12395;&#24863;&#26579;&#12522;&#12473;&#12463;&#12418;&#39640;&#12356;&#12398;&#12364;&#29305;&#24500;&#12391;&#12377;&#12290;</p>\n\n<p><strong>&#20302;&#23550;&#35441;&#22411;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;</strong>&#12391;&#12399;&#12456;&#12511;&#12517;&#12524;&#12540;&#12488;&#12373;&#12428;&#12383;&#12469;&#12540;&#12499;&#12473;&#12434;&#20844;&#38283;&#12377;&#12427;&#12383;&#12417;&#12289;&#25915;&#25731;&#12434;&#21463;&#12369;&#12390;&#12418;&#12456;&#12511;&#12517;&#12524;&#12540;&#12488;&#12375;&#12383;&#31684;&#22258;&#20197;&#19978;&#12395;&#25915;&#25731;&#12434;&#21463;&#12369;&#12394;&#12356;&#12383;&#12417;&#12289;&#39640;&#23550;&#35441;&#22411;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12395;&#27604;&#12409;&#12427;&#12392;&#23433;&#20840;&#12395;&#36939;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12364;&#12289;&#12456;&#12511;&#12517;&#12524;&#12540;&#12488;&#12375;&#12383;&#31684;&#22258;&#12391;&#12375;&#12363;&#12525;&#12464;&#24773;&#22577;&#12398;&#21454;&#38598;&#12434;&#34892;&#12358;&#12371;&#12392;&#12364;&#12391;&#12365;&#12394;&#12356;&#12383;&#12417;&#12289;&#24773;&#22577;&#37327;&#12364;&#23569;&#12394;&#12367;&#12394;&#12387;&#12390;&#12375;&#12414;&#12356;&#12414;&#12377;&#12290;</p>\n\n<p>&#20170;&#22238;&#12399;&#21454;&#38598;&#12391;&#12365;&#12427;&#24773;&#22577;&#12399;&#23569;&#12394;&#12356;&#12369;&#12393;&#12289;&#27604;&#36611;&#30340;&#23433;&#20840;&#12395;&#36939;&#29992;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12427;&#20302;&#23550;&#35441;&#22411;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12398;&#12358;&#12385;SSH/Telnet&#29305;&#21270;&#12398;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12391;&#12354;&#12427;Cowrie&#12395;&#12388;&#12356;&#12390;&#35302;&#12387;&#12390;&#12356;&#12365;&#12383;&#12356;&#12392;&#24605;&#12356;&#12414;&#12377;&#12290;</p>\n\n<h2>Cowrie&#12392;&#12399;</h2>\n\n<p>Cowrie&#12399;SSH/Telnet&#12395;&#29305;&#21270;&#12375;&#12383;OSS&#12398;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12463;&#12521;&#12452;&#12450;&#12531;&#12488;&#12290;SSH(Port22)&#12392;Telnet(23)&#12398;&#12469;&#12540;&#12499;&#12473;&#12434;&#30097;&#20284;&#30340;&#12395;&#31435;&#12385;&#19978;&#12370;&#12390;&#12289;&#12450;&#12463;&#12475;&#12473;&#12375;&#12390;&#12365;&#12383;&#20154;&#12398;&#21205;&#20316;&#12434;&#12525;&#12464;&#12392;&#12375;&#12390;&#21454;&#38598;&#12377;&#12427;&#12503;&#12525;&#12464;&#12521;&#12512;&#12391;&#12377;&#12290;&#12371;&#12428;&#12395;&#12424;&#12426;&#12289;&#25915;&#25731;&#32773;&#12364;SSH&#12391;&#25509;&#32154;&#35430;&#34892;&#12377;&#12427;&#12392;&#12365;&#12398;&#12450;&#12459;&#12454;&#12531;&#12488;&#24773;&#22577;&#12420;&#12525;&#12464;&#12452;&#12531;&#24460;&#12395;&#23455;&#34892;&#12377;&#12427;&#12467;&#12510;&#12531;&#12489;&#12434;&#21454;&#38598;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p>\n\n<p>&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12375;&#12390;&#21205;&#12363;&#12377;&#12371;&#12392;&#12418;&#12391;&#12365;&#12414;&#12377;&#12364;&#12289;Docker&#12467;&#12531;&#12486;&#12490;&#12364;&#20844;&#38283;&#12373;&#12428;&#12390;&#12356;&#12427;&#12398;&#12391;&#12289;&#23455;&#38555;&#12395;&#31435;&#12385;&#19978;&#12370;&#12390;&#35302;&#12387;&#12390;&#12415;&#12383;&#12356;&#12392;&#24605;&#12356;&#12414;&#12377;&#12290;</p>\n\n<h2>&#20107;&#21069;&#28310;&#20633;</h2>\n\n<p>Docker&#12467;&#12531;&#12486;&#12490;&#12391;&#36215;&#21205;&#12377;&#12427;&#12383;&#12417;&#12289;&#20107;&#21069;&#12395;Docker&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#12434;&#12375;&#12390;&#12362;&#12356;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p>\n\n<p>Docker&#12398;&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;&#26041;&#27861;&#12399;&#19979;&#35352;&#12398;&#35352;&#20107;&#12434;&#21442;&#32771;&#12395;&#12393;&#12358;&#12382;&#12290;</p>\n\n<h2>&#12452;&#12531;&#12473;&#12488;&#12540;&#12523;</h2>\n\n<p>&#20844;&#38283;&#12373;&#12428;&#12390;&#12356;&#12427;Docker&#12467;&#12531;&#12486;&#12490;&#12398;&#12522;&#12509;&#12472;&#12488;&#12522;&#12434;&#25351;&#23450;&#12375;&#12390;<code>docker pull</code>&#12434;&#34892;&#12356;&#12414;&#12377;&#12290;</p>\n\n<pre>$ docker pull cowrie/cowrie\n</pre>\n\n\n<p>&#12371;&#12428;&#12391;&#21205;&#12363;&#12377;&#28310;&#20633;&#12399;&#23436;&#20102;&#12391;&#12377;&#12290;</p>\n\n<h2>&#36215;&#21205;&#12375;&#12390;&#12415;&#12427;</h2>\n\n<p>&#23455;&#38555;&#12395;Cowrie&#12398;&#12467;&#12531;&#12486;&#12490;&#12434;&#36215;&#21205;&#12375;&#12390;&#12415;&#12383;&#12356;&#12392;&#24605;&#12356;&#12414;&#12377;&#12290;</p>\n\n<p>&#19979;&#35352;&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p>\n\n<pre>$ docker run <span>-p</span> 2222:2222/tcp cowrie/cowrie\n</pre>\n\n\n<p>&#36215;&#21205;&#12364;&#23436;&#20102;&#12377;&#12427;&#12392;&#19979;&#35352;&#12398;&#12424;&#12358;&#12394;&#12525;&#12464;&#12364;&#20986;&#21147;&#12373;&#12428;&#12414;&#12377;&#12290;</p>\n\n<pre>Join the Cowrie community at: https://www.cowrie.org/slack/\n\nUsing default Python virtual environment <span>\"</span><span>/cowrie/cowrie-env</span><span>\"</span>\nversion check\nStarting cowrie: <span>[</span>twistd   --umask<span>=</span><span>0022</span> --pidfile<span>=</span> <span>-l</span> - cowrie <span>-n]</span>...\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> Python Version <span>3</span>.<span>7</span>.<span>3</span> <span>(</span><span>default, Dec </span><span>20</span><span> </span><span>2019</span><span>, 18:57:59</span><span>)</span> <span>[</span>GCC <span>8</span>.<span>3</span>.<span>0</span><span>]</span>\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> Twisted Version <span>20</span>.<span>3</span>.<span>0</span>\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> Loaded output engine: jsonlog\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>twisted.scripts._twistd_unix.UnixAppLogger#info<span>]</span> twistd <span>20</span>.<span>3</span>.<span>0</span> <span>(</span><span>/cowrie/cowrie-env/bin/python3 </span><span>3</span><span>.</span><span>7</span><span>.</span><span>3</span><span>)</span> starting up.\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>twisted.scripts._twistd_unix.UnixAppLogger#info<span>]</span> reactor class: twisted.internet.epollreactor.EPollReactor.\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> CowrieSSHFactory starting on <span>2222</span>\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>cowrie.ssh.factory.CowrieSSHFactory#info<span>]</span> Starting factory <span>&lt;</span>cowrie.ssh.factory.CowrieSSHFactory object at 0x7fd16a5c7f9<span>8&gt;</span>\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> Generating new RSA keypair...\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> Generating new DSA keypair...\n2020-07-09T17:28:13+<span>0000</span> <span>[</span>-<span>]</span> Ready to accept SSH connections\n</pre>\n\n\n<p><code>Ready to accept SSH connections</code>&#12392;&#34920;&#31034;&#12373;&#12428;&#12383;&#12425;Cowrie&#12364;&#31435;&#12385;&#19978;&#12364;&#12387;&#12383;&#35388;&#25312;&#12391;&#12377;&#12290;</p>\n\n<h2>&#12450;&#12463;&#12475;&#12473;&#12375;&#12390;&#12415;&#12427;</h2>\n\n<p>&#12381;&#12428;&#12391;&#12399;&#23455;&#38555;&#12395;Cowrie&#12395;&#12450;&#12463;&#12475;&#12473;&#12375;&#12390;&#12415;&#12414;&#12375;&#12423;&#12358;&#12290;docker&#12434;&#31435;&#12385;&#19978;&#12370;&#12390;&#12356;&#12427;&#12467;&#12531;&#12477;&#12540;&#12523;&#12392;&#12399;&#21029;&#12398;&#12467;&#12531;&#12477;&#12540;&#12523;&#12434;&#31435;&#12385;&#19978;&#12370;&#12390;&#12367;&#12384;&#12373;&#12356;&#12290;</p>\n\n<p>docker&#12467;&#12531;&#12486;&#12490;&#12395;SSH&#12391;&#12450;&#12463;&#12475;&#12473;&#12375;&#12390;&#12415;&#12414;&#12377;&#12290;docker&#36215;&#21205;&#12398;&#26178;&#12395;Port2222&#12434;&#12509;&#12540;&#12488;&#12501;&#12457;&#12527;&#12540;&#12489;&#12377;&#12427;&#12424;&#12358;&#12395;&#36215;&#21205;&#12375;&#12390;&#12356;&#12427;&#12398;&#12391;&#12289;Port2222&#12395;&#23550;&#12375;&#12390;&#12525;&#12464;&#12452;&#12531;&#12434;&#12375;&#12390;&#12415;&#12414;&#12377;&#12290;</p>\n\n<pre>$ ssh <span>-p</span> <span>2222</span> root@localhost\nroot@localhost<span>'</span><span>s password:</span>\n\n<span>The programs included with the Debian GNU/Linux system are free software;</span>\n<span>the exact distribution terms for each program are described in the</span>\n<span>individual files in /usr/share/doc/*/copyright.</span>\n\n<span>Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent</span>\n<span>permitted by applicable law.</span>\n<span>root@svr04:~#</span>\n</pre>\n\n\n<p>&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#27714;&#12417;&#12425;&#12428;&#12427;&#12398;&#12391;&#12377;&#12364;&#12289;&#12371;&#12371;&#12391;&#12399;&#12450;&#12459;&#12454;&#12531;&#12488;&#12392;&#21516;&#12376;&#25991;&#23383;&#21015;&#12391;&#12394;&#12369;&#12428;&#12400;&#12289;&#12393;&#12435;&#12394;&#12497;&#12473;&#12527;&#12540;&#12489;&#12434;&#20837;&#12428;&#12390;&#12418;&#12525;&#12464;&#12452;&#12531;&#12364;&#25104;&#21151;&#12375;&#12414;&#12377;&#12290;</p>\n\n<p>&#12525;&#12464;&#12452;&#12531;&#24460;&#12289;Cowrie&#20596;&#12398;&#12525;&#12464;&#12434;&#35211;&#12390;&#12415;&#12414;&#12375;&#12423;&#12358;&#12290;</p>\n\n<pre>2020-07-10T13:14:51+<span>0000</span> <span>[</span>cowrie.ssh.factory.CowrieSSHFactory<span>]</span> New connection: <span>172</span>.<span>17</span>.<span>0</span>.1:38570 <span>(</span><span>172</span><span>.</span><span>17</span><span>.</span><span>0</span><span>.2:2222</span><span>)</span> <span>[</span>session: 2780b89da733<span>]</span>\n2020-07-10T13:14:51+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>1</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Remote SSH version: b<span>'</span><span>SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3</span><span>'</span>\n</pre>\n\n\n<p>&#12525;&#12464;&#12363;&#12425;&#30906;&#35469;&#12391;&#12365;&#12427;&#12398;&#12399;&#12289;Remote SSH&#12375;&#12390;&#12365;&#12383;&#12469;&#12540;&#12496;&#12398;IP&#12289;SSH&#12463;&#12521;&#12452;&#12450;&#12531;&#12488;&#12398;&#12496;&#12540;&#12472;&#12519;&#12531;&#12289;&#12525;&#12464;&#12452;&#12531;&#12375;&#12390;&#12365;&#12383;&#12469;&#12540;&#12496;&#12398;&#12459;&#12540;&#12493;&#12523;&#12496;&#12540;&#12472;&#12519;&#12531;&#12364;&#21462;&#24471;&#12391;&#12365;&#12414;&#12377;&#12290;</p>\n\n<p>RemoteSSH&#12375;&#12390;&#12365;&#12383;&#12469;&#12540;&#12496;&#12364;&#20837;&#21147;&#12375;&#12390;&#12365;&#12383;&#12525;&#12464;&#12452;&#12531;&#12450;&#12459;&#12454;&#12531;&#12488;&#65295;&#12525;&#12464;&#12452;&#12531;&#12497;&#12473;&#12527;&#12540;&#12489;&#12418;</p>\n\n<pre>2020-07-10T13:15:00+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>1</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> login attempt <span>[</span>b<span>'</span><span>root</span><span>'</span>/b<span>'</span><span>password</span><span>']</span> succeeded\n</pre>\n\n\n<p>&#19978;&#35352;&#12398;&#36890;&#12426;&#12289;&#20024;&#12431;&#12363;&#12426;&#12391;&#12377;&#12290;</p>\n\n<p>RemoteSSH&#20596;&#12391;&#12525;&#12464;&#12452;&#12531;&#12375;&#12390;&#12289;<code>whoami</code>&#12420;<code>id</code>&#12289;<code>uname -a</code>&#12394;&#12393;&#12391;&#24773;&#22577;&#12434;&#21462;&#24471;&#12375;&#12383;&#12426;&#12289;netcat&#12467;&#12510;&#12531;&#12489;&#12434;&#23455;&#34892;&#12375;&#12390;&#12525;&#12464;&#12450;&#12454;&#12488;&#12375;&#12390;&#12415;&#12414;&#12377;&#12290;</p>\n\n<p>RemoteSSH&#20596;&#12398;&#12467;&#12531;&#12477;&#12540;&#12523;&#12391;&#12399;&#27425;&#12398;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;</p>\n\n<pre>$ ssh <span>-p</span> <span>2222</span> root@localhost\nroot@localhost<span>'</span><span>s password:</span>\n\n<span>The programs included with the Debian GNU/Linux system are free software;</span>\n<span>the exact distribution terms for each program are described in the</span>\n<span>individual files in /usr/share/doc/*/copyright.</span>\n\n<span>Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent</span>\n<span>permitted by applicable law.</span>\n<span>root@svr04:~# whoami</span>\n<span>root</span>\n<span>root@svr04:~# id</span>\n<span>uid=0(root) gid=0(root) groups=0(root)</span>\n<span>root@svr04:~# uname -a</span>\n<span>Linux svr04 3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux</span>\n<span>root@svr04:~#</span>\n<span>root@svr04:~#</span>\n<span>root@svr04:~# nc</span>\n<span>This is nc from the netcat-openbsd package. An alternative nc is available</span>\n<span>in the netcat-traditional package.</span>\n<span>usage: nc [-46bCDdhjklnrStUuvZz] [-I length] [-i interval] [-O length]</span>\n<span>          [-P proxy_username] [-p source_port] [-q seconds] [-s source]</span>\n<span>          [-T toskeyword] [-V rtable] [-w timeout] [-X proxy_protocol]</span>\n<span>          [-x proxy_address[:port]] [destination] [port]</span>\n<span>root@svr04:~#</span>\n<span>root@svr04:~#</span>\n<span>root@svr04:~# exit</span>\n<span>Connection to localhost closed.</span>\n</pre>\n\n\n<p>Cowrie&#20596;&#12391;&#12399;&#27425;&#12398;&#12424;&#12358;&#12395;&#12394;&#12426;&#12414;&#12377;&#12290;</p>\n\n<pre>2020-07-10T13:25:48+<span>0000</span> <span>[</span>cowrie.ssh.factory.CowrieSSHFactory<span>]</span> No moduli, no diffie-hellman-group-exchange-sha1\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>cowrie.ssh.factory.CowrieSSHFactory<span>]</span> No moduli, no diffie-hellman-group-exchange-sha256\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>cowrie.ssh.factory.CowrieSSHFactory<span>]</span> New connection: <span>172</span>.<span>17</span>.<span>0</span>.1:38578 <span>(</span><span>172</span><span>.</span><span>17</span><span>.</span><span>0</span><span>.2:2222</span><span>)</span> <span>[</span>session: 1731957be020<span>]</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Remote SSH version: b<span>'</span><span>SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> SSH client hassh fingerprint: 06046964c022c6407d15a27b12a6a4fb\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> kex alg, key alg: b<span>'</span><span>curve25519-sha256</span><span>'</span> b<span>'</span><span>ssh-rsa</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> outgoing: b<span>'</span><span>aes128-ctr</span><span>'</span> b<span>'</span><span>hmac-sha2-512</span><span>'</span> b<span>'</span><span>none</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> incoming: b<span>'</span><span>aes128-ctr</span><span>'</span> b<span>'</span><span>hmac-sha2-512</span><span>'</span> b<span>'</span><span>none</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> NEW KEYS\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> starting service b<span>'</span><span>ssh-userauth</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> b<span>'</span><span>root</span><span>'</span> trying auth b<span>'</span><span>none</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> b<span>'</span><span>root</span><span>'</span> trying auth b<span>'</span><span>publickey</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> public key attempt <span>for</span> user b<span>'</span><span>root</span><span>'</span> of <span>type</span> b<span>'</span><span>ssh-rsa</span><span>'</span> with fingerprint bc:62:6b:16:0a:40:b6:58:a7:99:e7:ad:1a:9e:e4:4e\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> b<span>'</span><span>root</span><span>'</span> failed auth b<span>'</span><span>publickey</span><span>'</span>\n2020-07-10T13:25:48+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> reason: <span>(</span><span>'</span><span>Incorrect signature</span><span>'</span>, None<span>)</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> b<span>'</span><span>root</span><span>'</span> trying auth b<span>'</span><span>password</span><span>'</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Could not <span>read</span> etc/userdb.txt, default database activated\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> login attempt <span>[</span>b<span>'</span><span>root</span><span>'</span>/b<span>'</span><span>password</span><span>']</span> succeeded\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Initialized emulated server as architecture: linux-x64-lsb\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> b<span>'</span><span>root</span><span>'</span> authenticated with b<span>'</span><span>password</span><span>'</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-userauth</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> starting service b<span>'</span><span>ssh-connection</span><span>'</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> got channel b<span>'</span><span>session</span><span>'</span> request\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> channel open\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> got global b<span>'</span><span>no-more-sessions@openssh.com</span><span>'</span> request\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> pty request: b<span>'</span><span>xterm-256color</span><span>'</span> <span>(</span><span>54</span>, <span>202</span>, <span>0</span>, <span>0</span><span>)</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Terminal Size: <span>202</span> <span>54</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> request_env: b<span>'</span><span>LANG</span><span>'=</span>b<span>'</span><span>C.UTF-8</span><span>'</span>\n2020-07-10T13:25:51+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> getting shell\n2020-07-10T13:25:55+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD: whoami\n2020-07-10T13:25:55+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Command found: whoami\n2020-07-10T13:25:56+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD: id\n2020-07-10T13:25:56+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Command found: id\n2020-07-10T13:25:59+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD: uname <span>-a</span>\n2020-07-10T13:25:59+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Command found: uname <span>-a</span>\n2020-07-10T13:26:01+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD:\n2020-07-10T13:26:01+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD:\n2020-07-10T13:26:03+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD: nc\n2020-07-10T13:26:03+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Command found: nc\n2020-07-10T13:26:04+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD:\n2020-07-10T13:26:04+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD:\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> CMD: <span>exit</span>\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Command found: <span>exit</span>\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> exitCode: <span>0</span>\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> sending request b<span>'</span><span>exit-status</span><span>'</span>\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Closing TTY Log: var/lib/cowrie/tty/b5377bf3fdd31e29a30f8f18a4835d9f439157f591eafef456b563055e59a28e after <span>13</span> seconds\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> sending close <span>0</span>\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>SSHChannel session (<span>0</span>) on SSHService b<span>'</span><span>ssh-connection</span><span>'</span> on HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> remote close\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Got remote error, code <span>11</span> reason: b<span>'</span><span>disconnected by user</span><span>'</span>\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> avatar root logging out\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> connection lost\n2020-07-10T13:26:05+<span>0000</span> <span>[</span>HoneyPotSSHTransport,<span>3</span>,<span>172</span>.<span>17</span>.<span>0</span>.<span>1</span><span>]</span> Connection lost after <span>16</span> seconds\n</pre>\n\n\n<p><code>CMD: hogehoge</code>&#12392;&#12394;&#12387;&#12390;&#12356;&#12427;&#37096;&#20998;&#12364;Remote SSH&#20596;&#12391;&#20837;&#21147;&#12373;&#12428;&#12383;&#12467;&#12510;&#12531;&#12489;&#12391;&#12377;&#12290;&#12371;&#12398;&#12424;&#12358;&#12394;&#24418;&#12391;&#12289;&#25915;&#25731;&#12375;&#12390;&#12365;&#12383;&#12392;&#12365;&#12395;&#20837;&#21147;&#12373;&#12428;&#12383;&#12467;&#12510;&#12531;&#12489;&#12434;&#21454;&#38598;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;</p>\n\n<p>&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12391;&#12399;&#12371;&#12398;&#12424;&#12358;&#12395;&#25915;&#25731;&#12434;&#21463;&#12369;&#12383;&#12392;&#12365;&#12398;&#12525;&#12464;&#24773;&#22577;&#12394;&#12393;&#12434;&#21454;&#38598;&#12377;&#12427;&#12371;&#12392;&#12364;&#12391;&#12365;&#12414;&#12377;&#12290;&#19990;&#12398;&#20013;&#12398;&#33394;&#12293;&#12394;&#12469;&#12540;&#12499;&#12473;&#12434;&#12456;&#12511;&#12517;&#12524;&#12540;&#12488;&#12391;&#12365;&#12427;&#12495;&#12491;&#12540;&#12509;&#12483;&#12488;&#12364;&#33394;&#12293;&#12354;&#12427;&#12398;&#12391;&#12289;&#35519;&#12409;&#12388;&#12388;&#26412;&#12502;&#12525;&#12464;&#12395;&#27531;&#12375;&#12390;&#12356;&#12365;&#12383;&#12356;&#12392;&#24605;&#12356;&#12414;&#12377;&#12290;</p>\n\n<h2>&#21442;&#32771;</h2>\n\n<p><a href=\"https://ja.wikipedia.org/wiki/%E3%83%8F%E3%83%8B%E3%83%BC%E3%83%9D%E3%83%83%E3%83%88\" rel=\"noopener noreferrer\" target=\"_blank\">&#12495;&#12491;&#12540;&#12509;&#12483;&#12488; - Wikipedia</a></p>"
    }
  ]
}

記事が取得・・・できたのかもしれないのですが、"content"が化けちゃってうまく取得できないですね・・・

変換すれば読めるのかもしれないですが、どうやってやったらいいのでしょうか・・・(調べ中。。。)

ログアウト

とりあえず、ログインしたセッションを終了します。

  • request
$ curl -d '{"sid":"7cugckd3jophsejqiti152js6i" ,"op":"logout"}' http://localhost:8280/tt-rss/api/
  • response
{
  "seq": 0,
  "status": 0,
  "content": {
    "status": "OK"
  }
}

TinyTinyRSSをAPIで操作してみました。APIで操作できると特定キーワードの必要な記事を自動で収集したりできそうです。

Contentが化けちゃってる件は調査中です・・・!どうやったらいいかわかる人いたら教えてください。。。( ノД`)シクシク…

参考:

TinyTinyRSS(公式)

ApiReference - Tiny Tiny RSS

TinyTinyRSS 試してみた - golangの日記