最后更新于2024年5月16日星期四18:08:07 GMT

By Dr. 迈克·科恩和卡洛斯·坎托

Rapid7非常兴奋地宣布版本0.7.迅猛龙2现在可以完全下载.

在这篇文章中,我们将讨论一些有趣的新功能.

EWF Support

Velociraptor has introduced the ability to analyze dead disk images in the past. Although we don’t need to analyze disk images very often, it comes up occasionally.

Previously, Velociraptor only supported analysis of DD images (AKA “Raw images”). 大多数人使用标准采集软件来获取图像, 它使用通用的EWF格式来压缩它们.

In this 0.7.2 release, Velociraptor supports EWF (AKA E01) format using the ewf accessor. 这使得迅猛龙能够分析E01图像集.

要分析死磁盘映像,请使用以下步骤:

  1. Create a remapping configuration that maps the disk accessors into the E01 image. 这会自动将查看文件系统的VQL函数转移到映像中,而不是使用主机的文件系统. 在这个版本中,您只需将——add_windows_disk选项指向EWF磁盘集的第一个磁盘(其他部分预计位于同一目录中,并将自动加载)。.
    The following creates a remapping file by recognizing the windows partition in the disk image.

velociraptor-v0美元.72 - rc1 - linux - amd64 deaddisk
——add_windows_disk = / tmp / e01 /形象.E01 / tmp /重新映射.yaml -v

2. 接下来,我们用重新映射文件启动一个客户端. This causes any VQL queries that access the filesystem to come from the image instead of the host. 除此之外, 客户端看起来像一个普通的客户端,将像任何其他客户端一样连接到Velociraptor服务器. 为了确保该客户端是惟一的,您可以将回写位置(存储客户端id的位置)覆盖到一个新文件.

velociraptor-v0美元.72-rc1-linux-amd64——remap /tmp/ remmapping.yaml
——配置~ /客户端.config.Yaml客户端
--config.client-writeback-linux = / tmp /重新映射.writeback.yaml

允许重新映射客户端使用SSH访问器

有时我们不能在远程系统上部署Velociraptor客户端. (For example, 它可能是像嵌入式Linux系统这样的边缘设备,或者它可能不被迅猛龙直接支持.)

In version 0.7.1, Velociraptor引入了ssh访问器,它允许VQL查询使用远程ssh连接访问远程文件.

这个版本增加了以类似于上面的死磁盘映像方法的方式应用重新映射的功能,以运行通过SSH连接到远程系统并通过sftp协议模拟文件系统访问的虚拟客户端.

要使用此功能,您可以编写一个映射ssh访问器的重新映射文件,而不是文件和auto访问器:

remappings:

  • 类型:权限
    permissions:

    • COLLECT_CLIENT
    • FILESYSTEM_READ
    • READ_RESULTS
    • MACHINE_STATE
  • 类型:模拟
    os: linux
    主机名:RemoteSSH

  • type: mount
    scope: |
    LET SSH_CONFIG <= dict(hostname='localhost:22',
    用户名= '测试',
    private_key = read_file(文件名= ' / home /测试/.ssh/id_rsa'))

    from:
    accessor: ssh

    "on":
    访问器:汽车
    path_type: linux

  • type: mount
    scope: |
    LET SSH_CONFIG <= dict(hostname='localhost:22',
    用户名= '测试',
    private_key = read_file(文件名= ' / home /测试/.ssh/id_rsa'))

    from:
    accessor: ssh

    "on":
    访问器:文件
    path_type: linux

Now you can start a client with this remapping file to virtualize access to the remote system via SSH.

velociraptor-v0美元.——remap /tmp/remap_ssh . conf.yaml
——配置客户端.config.Yaml客户端
--config.client-writeback-linux = / tmp /重新映射.writeback_ssh.yaml
--config.client-local-buffer-disk-size = 0

GUI Changes

GUI在这个版本中得到了显著的改进.

撤消/重做笔记本单元格

Velociraptor offers an easy way to experiment and explore data with VQL queries in the notebook interface. Naturally, exploring the data requires going back and forth between different VQL queries.

在本新闻稿中, Velociraptor保留每个VQL单元的多个版本(默认为5个),因此当用户探索不同的查询时,他们可以轻松地撤消和重做查询. This makes exploring data much quicker as you can go back to a previous version instantly.

狩猎视图GUI现在分页

以前,狩猎是在一个有限大小的表格中呈现的. 在这个版本中,搜索表是可分页和可搜索/可排序的. 这使得狩猎表与界面中的其他表保持一致,并允许在系统中查看无限数量的狩猎.

保密管理

许多迅猛龙插件需要秘密操作. 例如, ssh accessor requires a private key or password to log into the remote system. Similarly the s3 or smb accessors require credentials to upload to the remote file servers. 通过http_client()插件建立的许多连接都需要授权-例如发送Slack消息或查询远程服务(如Virus Total)的API密钥.

Previously, plugins that required credentials needed those credentials to be passed as arguments to the plugin. 例如, upload_s3() 插件需要将AWS S3凭据作为参数传入.

这给Velociraptor工件编写者带来了一个问题:如何以不向Velociraptor GUI的每个用户公开凭据的方式安全地向VQL查询提供凭据? 如果凭据作为参数传递给工件,那么它们将在查询日志和请求中可见, etc.

此版本将secret作为VQL中的第一类概念引入. Secret是给定名称的特定数据对象(键/值对),用于配置某些插件的凭据:

  1. 秘密有一个名字,我们在插件中使用它来指代它.
  2. Secrets have a type to ensure their data makes sense to the intended plugin. For example a secret needs certain fields for consumption by the s3 accessor or the http_client() plugin.
  3. 秘密与某些用户共享(或公开). 这将控制谁可以在GUI中使用该密钥.
  4. GUI非常小心,不允许VQL直接读取机密. 这些秘密由VQL插件在内部使用,不向VQL用户公开(如笔记本或工件)。.

Let’s work through an example of how Secrets can be managed within Velociraptor. 在本例中,我们为ssh访问器存储凭据,以允许用户在笔记本中glob()远程文件系统.

首先,我们将从欢迎页面中选择manage server secrets.

接下来,我们将选择SSH PrivateKey密钥类型并添加一个新密钥.

This will use the secret template that corresponds to the SSH private keys. GUI中显示了可接受的字段,并且还为GUI显示了验证VQL条件,以确保正确填充了密钥. We will name the secret DevMachine to remind us that this secret allows access to our development system. Note that the hostname requires both the IP address (or dns name) and the port.

接下来,我们将与一些GUI用户分享这些秘密

We can view the list of users that are able to use the secret within the GUI

现在我们可以通过简单地引用它的名字来使用新的秘密:

这不仅更安全,而且也更方便,因为我们不需要记住每个秘密的细节就可以使用它. For example, http_client()插件将填充URL字段, headers, cookies etc directly from the secret without us needing to bother with the details.

WARNING: Although secrets 是否通过阻止用户直接访问机密内容来控制对原始凭证的访问, 这些秘密仍然被写入磁盘. This means that GUI users with direct filesystem access can simply read the secrets from the disk.

我们建议不要向不受信任的用户授予诸如EXECVE或Filesystem Read之类的提升服务器权限,因为它可以绕过对机密设置的安全措施.

服务器的改进

实现了基于Websocket的通信机制

Velociraptor和一些较老的远程DFIR框架(如GRR)之间最重要的区别之一是Velociraptor保持一个常数, 低延迟连接到服务器. This allows Velociraptor clients to respond immediately without needing to wait for polling on the server.

In order to enhance compatibility between multiple network configurations like MITM proxies, 透明代理等.在美国,迅猛龙一直坚持使用简单的基于HTTP的通信协议. 保持持续的联系, 迅猛龙使用长轮询法, 保持HTTP POST操作长时间打开.

However as the Internet evolves and newer protocols become commonly used by major sites, 旧的基于HTTP的通信方法被证明更难以使用. For example, 我们发现某些第7层负载平衡器通过在连接中引入缓冲来干扰长轮询方法. 这严重降低了客户机和服务器之间的通信(在这种情况下,Velociraptor退回到轮询方法)。.

另一方面, 现代协议得到了更广泛的应用, 所以我们发现现代负载平衡器和代理已经支持标准的低延迟通信协议,如Web Sockets.

In the 0.7.2 release, Velociraptor introduces support for websockets as a communications protocol. websocket协议是为客户端和服务器之间的低延迟和低开销的连续通信方法而设计的(并且已经被大多数主要的社交媒体平台所使用), for example). Therefore, this new method should be better supported by network infrastructure as well as being more efficient.

To use the new websocket protocol, simply set the client’s server URL to have wss:// scheme:

Client:
server_urls:

您可以同时使用http和wss url, Velociraptor will switch from one to the other scheme if one becomes unavailable.

动态DNS提供商

Velociraptor has the capability to adjust DNS records by itself (AKA Dynamic DNS). This saves users the hassle of managing a dedicated dynamic DNS service such as ddclient).

传统上,我们使用谷歌域名作为默认的动态DNS提供商, but Google has decided to shut down this service abruptly forcing us to switch to alternative providers.

The 0.7.2 release has now switched to CloudFlare as our default preferred Dynamic DNS provider. 我们还添加了noip.Com作为第二选择.

Setting up CloudFlare as your preferred dynamic DNS provider requires the following steps:

  1. 注册CloudFlare并购买一个域名.
  2. Go to http://dash.cloudflare.com/profile/api-tokens 生成API令牌. 在API令牌模板中选择“编辑区域DNS”.

您需要在区域DNS上要求“编辑”权限,并包含您想要管理的特定区域名称. 区域名称是您购买的域名,e.g. “example.com”. 您将能够在该域下设置主机名.g. “velociraptor.example.com”.

使用这些信息,你现在可以创建dyndns配置:

Frontend:
....
dyn_dns:
类型:cloudflare
api_token: XXXYYYZZZ
zone_name:示例.com

确保前端.Hostname字段设置为要更新的正确主机名-例如

Frontend:
主机名:迅猛龙.example.com

这是要更新的主机名.

增强的代理支持

Velociraptor经常被部署到复杂的企业网络中. 这样的网络通常被Velociraptor需要支持的复杂控制(如MITM检查代理或自动代理配置)所锁定.

Velociraptor already supports MITM proxies but previously had inflexible proxy configuration. 代理可以设置或取消设置,但是对于为不同的url选择哪个代理没有更细粒度的控制. This makes it difficult to deploy on changing network topologies (such as roaming use).

The 0.7.2版本引入了更复杂的代理条件功能. It is now possible to specify which proxy to use for which URL based on a set of regular expressions:

Client:
proxy_config:
http: http://192.168.1.1:3128/
proxy_url_regexp:
"^http://www.google.com/": ""
"^http://.+example.com": "http://proxy.example.com:3128/"

上述配置意味着:

  1. 默认连接到http://192.168.1.1:31 128/所有url(包括http)
  2. 除了www.google.Com将直接连接到.
  3. 示例中的任何url.Com域名将通过http://proxy转发.example.com:3128

此代理配置可以应用于Client部分或Frontend部分,以控制服务器的配置.

Additionally, Velociraptor now supports a Proxy Auto Configuration (PAC) file. 如果指定了PAC文件, then the other configuration directives are ignored and all configuration comes from the PAC file. 也可以使用file:// URL方案从磁盘读取PAC文件, 甚至可以在配置文件中使用data: URL提供.

Client:
proxy_config:
pac: http://www.example.com/wpad.dat

注意,PAC文件显然必须可以在没有代理的情况下访问.

其他值得注意的功能

其他有趣的改进包括:

在MacOS上处理内存访问

在MacOS上,我们现在可以使用proc_yara()来扫描进程内存. 如果您的TCT配置文件授予get-task-allow,这应该可以工作, Proc_info-allow和task_for_pid-allow权限. 例如,以下列表是最少需要的:

com.apple.springboard.debugapplications get-task-allow proc_info-allow task_for_pid-allow

多部分上传到http_client()

Sometimes servers require uploaded files to be encoded using the mutipart/form method. 以前,通过在纯VQL字符串构建操作中构造相关请求,可以使用http_client()插件上传文件.

However this approach is limited by available memory and is not suitable for larger files. 对于用户来说,这也是不直观的.

这个版本将files参数添加到http_client()插件中. 这简化了上传多个文件,并在没有内存缓冲的情况下自动流式传输这些文件——允许以这种方式上传非常大的文件.

For example:

SELECT *
从http_client (
url='http://localhost:8002/test/',
方法=“文章”,
文件= dict(= '文件.. Txt ', key='file', path='/etc/passwd', accessor="file")

这里的文件可以是一个包含以下字段的字典数组:

  • file:将存储在服务器上的文件的名称
  • key:接收文件的表单元素的名称
  • path:这是一个我们打开并传入表单的OSPath对象.
  • accessor:路径所需的任何访问器.

Yara插件现在可以接受编译规则

yara()插件已升级为使用yara Version 4.5.0以及支持编译的yara规则. You can compile yara rules with the yarac compiler to produce a binary rule file. Simply pass the compiled binary data to the yara() plugin’s rules parameter.

WARNING: We do not recommend using compiled yara rules because of their practical limitations:

  1. 编译后的规则是不可移植的,必须在与创建它们的编译器完全相同的yara库版本上使用.5.0)
  2. 编译yara规则比文本规则大得多.

编译的yara规则与基于文本的规则相比没有任何好处, 除了反编译可能更复杂. This is primarily the reason to use compiled rules - to try to hide the rules (e.g. 出于商业原因).

Conclusions

版本中有更多的新特性和bug修复.7.2 release. If you’re interested in any of these new features, why not take Velociraptor for a spin by 从我们的发布页面下载? 它可以在GitHub上根据开源许可免费获得.

As always, please file bugs on the GitHub issue tracker or submit questions to our mailing list by emailing velociraptor-discuss@googlegroups.com. 你也可以直接在我们的 不和服务器.

Learn more about Velociraptor by visiting any of our web and social media channels below: