LoginSignup
3
0

More than 5 years have passed since last update.

osqueryが便利

Last updated at Posted at 2017-08-13

osqueryはFacebookが開発しているSQLベースの攻撃/侵入検出ツールです。
SQLベースのクエリで情報が取得できるのでかなり使い勝手が良いです。

環境

  • macOS Sierra

インストール

Homebrewでosqueryをインストールできます。

$ brew install osquery

起動

osqueryiを起動します。

$ osqueryi
Using a virtual database. Need help, type '.help'
osquery>

SQLを書く

リッスンしているポートの一覧を取得してみます。

osquery> select * from listening_ports;
+------+-------+----------+--------+-----------+
| pid  | port  | protocol | family | address   |
+------+-------+----------+--------+-----------+
| 95   | 0     | 17       | 2      | 0.0.0.0   |
| 95   | 0     | 0        | 0      |           |
| 271  | 51047 | 17       | 2      | 0.0.0.0   |
| 565  | 27017 | 6        | 2      | 0.0.0.0   |
| 1855 | 3000  | 6        | 10     | ::1       |
| 1855 | 3000  | 6        | 2      | 127.0.0.1 |
| 7205 | 38069 | 6        | 2      | 127.0.0.1 |
+------+-------+----------+--------+-----------+

取得できる情報(テーブル)はこちらの公式に載っています。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0