Skip to content

Packages

SightHouse was designed with modularity in mind, so each component is designed as a package that performs a particular task, such as getting new data from a specific site, compiling a project, or analyzing it to produce function signatures that will later be used in the frontend.

How to

SightHouse packages can be installed in different ways using this command:

# Using a directory
$ sighthouse package install /path/to/package-dir
# Or a tar.gz archive
$ sighthouse package install /path/to/package.tar.gz
# Or a core package
$ sighthouse package install "Name of the core package"
  • If a directory is given, it must point to a valid directory with at least two files: __init__.py, which is the entrypoint of the package, and package.yml, which contains the package's metadata.

  • If a tar.gz file is given, it must have been bundled with the sighthouse package export command.

  • If a string is given, SightHouse will search its "core package" list, that is, the one bundled within the sighthouse-pipeline Python package.

Once installed, the packages can be listed using the following command:

$ sighthouse package list
Installed  Name             Version  Description
Yes        Git Scrapper     1.0.0    Scrapper for Git projects
Yes        Ghidra Analyzer  1.0.0    Extract signatures from binaries using Ghidra

You can list all packages, including the core ones, by adding the -a switch:

$ sighthouse package list -a
Installed  Name                     Version  Description
Yes        Git Scrapper             1.0.0    Scrapper for Git projects
Yes        Ghidra Analyzer          1.0.0    Extract signatures from binaries using Ghidra
No         Linux Kernel Compiler    1.0.1    Compiler for the Linux Kernel
No         Autotools Compiler       1.0.1    Compiler for Autotools projects
No         Cmake Compiler           1.0.0    Compiler for Cmake projects
No         PlatformIo Scrapper      1.0.0    Scrapper for PlatformIo projects
No         uClibc Preprocessor      1.0.0    Preprocessor for the uClibc library
No         uClibc Compiler          1.0.1    Compiler for the uClibc library
No         Upload Scrapper          1.0.0    Scrapper to upload binaries directly to the analyzer
No         PlatformIo Preprocessor  1.0.0    Preprocessor for PlatformIo projects
No         PlatformIo Compiler      1.0.0    Compiler for PlatformIo projects

An installed package can be run using:

$ sighthouse package run "Package Name" [ARGS...]

Here is an example:

$ sighthouse package run 'Ghidra Analyzer' \
  -w redis://localhost:6379/ \
  -r s3://localhost:9000/uploads \
  -g /opt/ghidra_11.4.1_PUBLIC
[INFO/MainProcess] Connected to redis://:**@localhost:6379//
[INFO/MainProcess] mingle: searching for neighbors
[INFO/MainProcess] mingle: sync with 3 nodes
[INFO/MainProcess] mingle: sync complete
[INFO/MainProcess] celery@0jqzYhKNkwH9OMQF ready.

Most of the packages require at least two arguments: - -r / --repo: A URL pointing to a shared repository where workers can store and retrieve files. You can use an S3-compatible backend, or a local directory if all your workers live on the same machine. - -w / --worker: A URL pointing to a Redis queue, which allows workers to get and retrieve jobs.

An installed package can be easily shared using the export command:

$ sighthouse package export "Ghidra Analyzer" -o ghidra-analyzer.tar.gz

And finally, a package can be uninstalled using this command:

$ sighthouse package uninstall "Ghidra Analyzer"

Available packages

For now, the following packages are available:

Name Version Author Description
Autotools Compiler 1.0.1 Sighthouse Core Team Compiler for Autotools projects
Cmake Compiler 1.0.0 Sighthouse Core Team Compiler for Cmake projects
Ghidra Analyzer 1.0.0 Sighthouse Core Team Extract signatures from binaries using Ghidra
Git Scrapper 1.0.0 Sighthouse Core Team Scrapper for Git projects
Linux Kernel Compiler 1.0.1 Sighthouse Core Team Compiler for the Linux Kernel
PlatformIo Compiler 1.0.0 Sighthouse Core Team Compiler for PlatformIo projects
PlatformIo Preprocessor 1.0.0 Sighthouse Core Team Preprocessor for PlatformIo projects
PlatformIo Scrapper 1.0.0 Sighthouse Core Team Scrapper for PlatformIo projects
Upload Scrapper 1.0.0 Sighthouse Core Team Scrapper to upload binaries directly to the analyzer
uClibc Compiler 1.0.1 Sighthouse Core Team Compiler for the uClibc library
uClibc Preprocessor 1.0.0 Sighthouse Core Team Preprocessor for the uClibc library

Below are the descriptions of all the available SightHouse packages and how they can be used.

Autotools Compiler

AutotoolsCompiler is a compiler worker that will attempt to build projects using the Autotools build suite. It starts by running autogen.sh/autoreconf, then runs ./configure, and finally runs make.

The worker accepts the following arguments:

args:
  compiler_variants:
    <name>:
      cc: ...
      cflags: ...
      configure_extra_args: ...
Additional arguments can be passed to ./configure using configure_extra_args.

Here is an example:

args:
  compiler_variants:
    arm-O1:
      cc: arm-linux-gnueabi-gcc
      cflags: -O1
      configure_extra_args: --host=arm-linux-gnueabi

Cmake Compiler

CmakeCompiler is a compiler worker that will attempt to build CMake-based projects, mainly targeting C/C++ codebases.

The worker accepts the following arguments:

args:
  compiler_variants:
    <name>:
      cc: ...
      cflags: ...
      cxx: ...
      cxxflags: ...
      cmake_extra_args: ...
Additional arguments can be passed to cmake using cmake_extra_args.

Here is an example:

args:
  compiler_variants:
    x86-O0:
      cc: gcc
      cflags: -O0
      cxx: g++
      cxxflags: -std=c++17
      cmake_extra_args: -G Ninja -DBUILD_SHARED_LIBS=ON

Ghidra Analyzer

The GhidraAnalyzer package allows you to analyze binaries and extract function signatures using two different function signature schemes: FunctionID and BSim. It only parses formats that Ghidra knows how to load automatically: ELF, PE and Mach-O.

The worker accepts the following arguments:

args:
  urls:
    - ...
  bsim:
    min_instructions: ...
    max_instructions: ...
  fidb:
    min_instructions: ...
    max_instructions: ...

Here is an example:

args:
  urls:
    - postgresql://user@bsim_postgres:5432/bsim
  bsim:
    min_instructions: 10
    max_instructions: 0
  fidb:
    min_instructions: 2
    max_instructions: 0

Git Scrapper

The GitScrapper worker allows you to download Git repositories and push them into the pipeline. The worker will attempt to clone the given repositories (repositories are assumed to be reachable without authentication) and then send a copy of the source directory into the pipeline for each branch. Branches must correspond to a valid commit or tag, suitable for git checkout <branch>.

The worker accepts the following arguments:

args:
  repositories:
    - name: ...
      url: ...
      submodule: ...
      branches:
        - ...

Here is an example:

args:
  repositories:
    - name: mbedTLS
      url: https://github.com/Mbed-TLS/mbedtls
      submodule: true
      branches:
        - mbedtls-4.0.0
        - mbedtls-3.0.0
        - mbedtls-2.0.0

Linux Kernel Compiler

The LinuxKernelCompiler is a very naive kernel compiler that will attempt to compile the Linux kernel sources on a best-effort basis. It will first run make defconfig, then attempt to compile using make all.

The worker accepts the following arguments:

args:
  compiler_variants:
    <name>:
      cc: ...
      cflags: ...

Here is an example:

args:
  compiler_variants:
    aarch64-O0:
      cc: aarch64-linux-gnu-gcc
      cflags: -O0

PlatformIo Compiler

The PlatformIoCompiler is a compiler relying on the PlatformIO build system (pio). PlatformIO is a software aggregator platform for embedded projects. It allows you to describe the compilation steps using a platformio.ini file.

The worker doesn't need any arguments, but it requires projects with a platformio.ini file.

PlatformIo Preprocessor

The PlatformIoPreprocessor is a preprocessor module intended for PlatformIO, but it is currently a work in progress.

The worker doesn't need any arguments.

PlatformIo Scrapper

The PlatformIoScrapper is a scraper relying on the PlatformIO build system (pio). PlatformIO is a software aggregator platform for embedded projects.

The worker doesn't need any arguments.

The worker can be run with or without indexing. If enabled, it will periodically poll PlatformIO for new packages to scrape and store them in its internal database before sending them into the pipeline. If indexing is off, it will send any projects from the internal database that weren't already sent, and then stop.

Upload Scrapper

The UploadScrapper is a generic upload worker that allows you to send a given directory into the pipeline. Its main purpose is to send already compiled programs directly to the analyzers.

The worker accepts the following arguments:

args:
  files:
    - path: ...
      origin: ...
      name: ...
      version: ...

Here is an example:

args:
  files:
    - path: /lib/x86_64-linux-gnu/libcrypto.so.3
      origin: https://github.com/openssl/openssl
      name: libcrypto
      version: 3.0.22

uClibc Compiler

The uClibcCompiler is a compiler module that will attempt to build uClibc. It expects the sources to contain kernel headers corresponding to the targeted architecture. These headers should have been retrieved using the uClibcPreprocessor.

The worker accepts the following arguments:

args:
  compiler_variants:
    <name>:
      cc: ...
      cflags: ...

Here is an example:

args:
  compiler_variants:
    arm-O1:
      cc: arm-linux-gnueabi-gcc
      cflags: -O1

uClibc Preprocessor

The uClibcPreprocessor is a preprocessor module that will download the kernel headers required for building uClibc.

The worker doesn't need any arguments.