AFOS-NG

AFOS-NG

What is AFOS-NG Package Manager? AFOS-NG vs APT, AFOS-NG Usage, How to create custom AFOS-NG repository

What is AFOS-NG?

AFOS-NG is a package manager specifically designed for installing and managing Hacking tools.

Written in C, AFOS-NG has relatively simple code following KISS (Keep It Simple, Stupid!).

It is perfectly aligned with the HARD-BASED and SFB (Simple, Fast, Bullshitless) guidelines.

AFOS-NG vs APT

AFOS-NG should not be compared to APT in any way, the 2 tools have completely different purposes and work completely differently.

In fact, in ANDRAX-NG we use APT to update and install packages in the “core” of the platform while AFOS-NG takes care of installing and keeping the hacking tools up to date.

Having said that, let’s take a look at a few points…

APT is a great package manager but for the average user… for Hacking? Not really!

It is extremely complex to create and maintain a repository, package versions… not to mention that APT has a very poor dependency system because packages are precompiled…

PRE-Compiled vs Source Code

APT works with precompiled packages, i.e. everything you install has been compiled on someone else’s machine, which can lead to many problems such as: incompatibility, performance loss, dependency failure… Backdoors; Like the backdoor in liblzma (xz) that affected all Kali Linux users and probably sent several of them to jail!

AFOS-NG, on the other hand, works from source (it can also work in precompiled mode in very special cases!) This means that the source code of the package is downloaded to your machine and then compiled, ensuring that everything works properly and the runtime processes are updated by compilers to promote maximum performance.

Repository

APT is not repository friendly… if you want to create an APT repository, you have to spend a lot of time, a big server with a lot of bandwidth, at least 10Gbps, and pray that everything works without problems… Just search; “how to create a repository for APT” and check how much headache you will have!

And that’s not even considering that you’re going to have to compile hundreds of packages just to satisfy the dependencies…

AFOS-NG uses GIT-based repositories, i.e. you can create a repository on GITHUB or any other platform!

With AFOS-NG, you have the practicality and flexibility to create your own repository or customize an existing git repository! This is REAL freedom!

AFOS-NG Usage

AFOS-NG usage is pretty simple!

AFOS-NG Help

AFOS-NG Packages on REPO

The AFOS-NG repository list file is located at: /opt/AFOS/afos.list in ANDRAX-NG container each line is treated as a different repository.

If this file does not exist, AFOS-NG will use the url that is hardcoded in the source code.

All packages in the repository can be easily listed by AFOS-NG. Just use the --repo (-r) flag:

AFOS-NG Repo list

List Installed Packages

You can use the --list (-l) flag to list the packages that are currently installed (by AFOS-NG).

AFOS-NG list installed packages

Install packages

To install packages using AFOS-NG you can use --install or simply -i only the first argument will be treated, the others will be ignored.

Update packages

AFOS-NG update system is a little different from other package managers, --update is used only to list the packages that are available for update in the repository.

You can use --install to install the update (AFOS-NG doesn’t care if it’s already installed) or use --update-all to update all packages automatically.

Custom Repository

AFOS-NG is based on the GIT protocol, so the first step in creating an AFOS-NG repository is to create a GIT repository, which will be the database and the Online Source Control.

This may sound a bit complex at first glance, but you’ll find that it’s actually quite simple.

Check the official AFOS Repository on GITHUB.

repository/afos.yaml is the file that stores the data of all packages available in the repository. It’s a YAML-based structure.

Here’s an example of how the NMAP package is structured in this file:

  - name: nmap
    version: 7.95.0
    description: Advanced Network Mapper
    categories:
    - Information Gathering
    - Scanning
    repo_url: github.com/snakesec/nmap
    original_repo_url: nmap.org/download.html

AFOSBUILD.sh

Every AFOS repository needs to have an “AFOSBUILD.sh” file in its root, this file is responsible for storing all the instructions for compiling, installing… the package.