Osquery Linux (x86_64)系统-内网/无网络环境安装


前言

osquery是一个强大的系统信息查询程序,由于它是开源的,其对于不同系统各类信息的获取的方法,非常值得我们探索和学习,但在之前,我们首选要学会最基本的安装和使用它。

windows 和 linux在线安装方式 请自行查阅其他安装教程,本文是介绍相对比较复杂的内网/无网络环境安装


一、下载Osquery

1.进入官网地址:https://osquery.io/
2.选择DOWNLOAD
在这里插入图片描述
3.选择对应的版本下载,本示例系统为Ubuntu18.4 选择Linux(x86_64)
在这里插入图片描述
下载完即可得到下述文件
xxx

解压它得到下面这些文件
xxx

我们的目的是运行osquery,本次我们我们只需要运行交互程序osqueryi,我们找到osqueryi ,发现其是一个链接文件(快捷方式),且不能直接运行,因此我们还需要配置文件。
在这里插入图片描述
在这里插入图片描述

二、配置文件

我们解压出来的根文件夹其实是非常熟悉的 系统中本就存在,接下来就是将文件配置到系统的对应位置上。

依据下图去复制或创建对应的目录或文件,现在我们将下图各类文件和目录称为”目标文件域“,而我们已经下载解压的文件和目录称为”源文件域
在这里插入图片描述
源文件域若存在对应目标文件域的目录和文件,直接复制过去即可(利用cp),若不存在,需要到系统中对应的路径创建

其中源文件域中的目录结构也不都和目标文件域的目录结构一一对应,比如:目标文件域是"/usr/loacl/bin" 而源文件域是"/usr/bin",跳过了"local",那我们就要将bin 放置到"usr/local"下,一切都以目标文件域为准.

下述两行意思是左侧文件链接右侧文件,只要四个路径的文件从源文件域复制就可以了,不需要再重新建立链接
在这里插入图片描述

注意:目标文件域 的最后若存在"/"是文件夹路径,若不存在则为文件路径

三、运行Osquery

配置完成后,我们就可以在终端愉快的使用osquery了,输入osqueryi

在这里插入图片描述

.tables 查询所有可用表名

在这里插入图片描述

.all users 查看系统用户信息
在这里插入图片描述


四、总结

至此,我们就完成了Osquery Linux (x86_64)系统-内网/无网络环境的安装和基本使用,其中守护进程osqueryd暂时不启用,有兴趣的也可自行探索,各类查询语法的使用,也需要读者自行去学习。

最后,创作不易,最后希望大家点个赞和收藏支持一哈!

  • 5
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为什么会这样[user_mongo@nosql01 replicaset]$ cd /opt [user_mongo@nosql01 opt]$ ll total 0 drwxr-xr-x. 3 root root 25 Mar 16 17:08 servers drwxr-xr-x. 2 root root 51 Mar 16 17:10 software [user_mongo@nosql01 opt]$ tar -zxvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/MPL-2 tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/MPL-2: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/README tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/README: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos: Cannot open: No such file or directory tar: Exiting with failure status due to previous errors [user_mongo@nosql01 opt]$ tar -zcvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information.
06-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值