Skip to content
lex0tanil edited this page Oct 8, 2018 · 3 revisions

Installing hostapd-mana

You can install hostapd-mana by either downloading the source and compiling it or by grabbing a pre-compiled binary.

Binaries

Bleeding Edge Auto Builds

Every time a new new commit is made to the source on GitHub, the code is automatically built into x86 64bit ELF Ubuntu binaries. You can download them from hostapd-mana AWS CodeBuild

These binaries, while the most up to date, are the most likely to have bugs.

GitHub Releases

Each release on GitHub is accompanied by a set of binaries. You can grab those from hostapd-mana releases

These binaries are updated less often, but have fewer bugs.

Distribution Packages

hostapd-mana is currently distributed in Kali Linux via the mana-toolkit package. The command: apt-get install mana-toolkit Will grab it for you. Kali insisted on putting things in weird places, so the resulting two hostapd-mana binaries will be in:

/usr/lib/mana-toolkit/hostapd
/usr/lib/mana-toolkit/hostapd_cli

Historically, these binaries are updated very infrequently, and I usually don’t recommend them.

Compiling from Source

Compiling hostapd-mana has the exact same prerequisites as compiling the normal hostapd source and consists of the following high level steps:

  • Grab the source

  • Install the build toolchain, ssl (libssl) and netlink (libnl) dependencies

  • Run make with your favourite C compiler (the Travis-CI builds use gcc and clang so you’ll know they work)

  • Grab the fresh hostapd and hostapd_cli binaries

By default, hostapd-mana has been configured to use the newer netlink libraries (libnl), rather than the older ones, and so the instructions below assume this. You can change this in the hostapd/.config file.

Ubuntu

apt-get --yes install build-essential git libnl-genl-3-dev libssl-dev 
git clone https://github.com/sensepost/hostapd-mana
cd hostapd-mana
make -C hostapd

Kali

The only difference between Kali and Ubuntu is the pkg-config package.

apt-get --yes install build-essential pkg-config git libnl-genl-3-dev libssl-dev 
git clone https://github.com/sensepost/hostapd-mana
cd hostapd-mana
make -C hostapd

Alpine

apk add build-base openssl-dev libnl3-dev linux-headers git
git clone https://github.com/sensepost/hostapd-mana
cd hostapd-mana
make -C hostapd

Automated Builds

There are several automated build methods that can be used.

Docker

These can be used as part of a multi-stage build by using a commands such as the following later in the Dockerfile:

COPY --from=builder /hostapd-mana/hostapd-mana/hostapd/hostapd /usr/local/bin/
COPY --from=builder /hostapd-mana/hostapd-mana/hostapd/hostapd_cli /usr/local/bin/

Alternatively, you can copy them to a host volume.

Alpine

FROM alpine:latest as builder
RUN apk update && apk add \
  build-base \
  openssl-dev \
  libnl3-dev \
  linux-headers \
  git \
&& rm -rf /var/cache/apk/*
WORKDIR /hostapd-mana/
RUN git clone --depth=1 https://github.com/sensepost/hostapd-mana
RUN make -j7 -C hostapd-mana/hostapd

Kali Linux

FROM kalilinux/kali-linux-docker as builder
RUN apt-get update && apt-get install -y \
  build-essential \
  pkg-config \
  git \
  libnl-genl-3-dev \
  libssl-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /hostapd-mana/
RUN git clone --depth=1 https://github.com/sensepost/hostapd-mana
RUN make -j7 -C hostapd-mana/hostapd

Travis-CI

hostapd-mana’s .travis.yml file has:

language: c
compiler:
    - clang
    - gcc
script: make -C hostapd
addons:
  apt:
    packages:
    - libnl-genl-3-dev
    - libssl-dev

AWS CodeBuild

hostapd-mana’s buildspec.yml file has:

version: 0.2
# Ubuntu for AWS CodeBuild

phases:
  install:
    commands:
      - echo Entering install phase
      - apt-get update
      - apt-get --yes install libnl-genl-3-dev libssl-dev git build-essential
  pre_build:
    commands:
      - echo Entering prebuild phase
      - git checkout hostapd-2.6
  build:
    commands:
      - echo Entering buid phase
      - make -C hostapd
artifacts:
  files:
    - hostapd/hostapd
    - hostapd/hostapd_cli
  discard-paths: yes