language
stringlengths
0
24
filename
stringlengths
9
214
code
stringlengths
99
9.93M
Shell Script
aircrack-ng/test/test-aircrack-ng-0018.sh
#!/bin/sh set -ef "${abs_builddir}/../aircrack-ng${EXEEXT}" \ ${AIRCRACK_NG_ARGS} \ -I 'c2ea9449c142e84a0479041702526532*0012bf77162d*0021e924a5e7*574c414e2d373731363938' \ -w "${abs_srcdir}/password-3.lst" \ -l /dev/null | \ ${GREP} "KEY FOUND" | ${GREP} "SP-91862D361" exit 0
Shell Script
aircrack-ng/test/test-aircrack-ng-0019.sh
#!/bin/sh set -ef "${abs_builddir}/../aircrack-ng${EXEEXT}" \ ${AIRCRACK_NG_ARGS} \ -w "${abs_srcdir}/pass.txt" \ "${abs_srcdir}/MOM1.cap" | \ ${GREP} 'KEY FOUND! \[ MOM12345 \]' exit 0
Shell Script
aircrack-ng/test/test-aircrack-ng-0020.sh
#!/bin/sh # -*- tcl -*- # The next line is executed by /bin/sh, but not expect \ exec ${EXPECT:=expect} "$0" ${1+"$@"} set abs_builddir $::env(abs_builddir) set abs_srcdir $::env(abs_srcdir) exit -onexit { exp_internal 1 exec rm -f pipe.cap } puts -nonewline "Aircrack-ng will tail PCAP files: " flush stdout ...
Shell Script
aircrack-ng/test/test-aircrack-ng-0021.sh
#!/bin/sh set -ef "${abs_builddir}/../aircrack-ng${EXEEXT}" \ -w "${abs_srcdir}/password.lst" \ "${abs_srcdir}/wpa2.eapol.cap" \ -a 2 \ -N $(mktemp -u) \ -e Harkonen \ -q | \ ${GREP} 'KEY FOUND! \[ 12345678 \]' exit 0
Shell Script
aircrack-ng/test/test-aircrack-ng-0022.sh
#!/bin/sh set -ef "${abs_builddir}/../aircrack-ng${EXEEXT}" \ ${AIRCRACK_NG_ARGS} \ -w "${abs_srcdir}/password.lst" \ -a 2 \ -e WLAN-2 \ -q "${abs_srcdir}/test23.pcap" | \ ${GREP} 'KEY FOUND! \[ 12345678 \]' exit 0
Shell Script
aircrack-ng/test/test-aircrack-ng-0023.sh
#!/bin/sh set -ef "${abs_builddir}/../aircrack-ng${EXEEXT}" \ ${AIRCRACK_NG_ARGS} \ -w "${abs_srcdir}/password.lst" \ -a 2 \ -e WLAN-2 \ -q "${abs_srcdir}/testm1m2m3.pcap" | \ ${GREP} 'KEY FOUND! \[ 12345678 \]' exit 0
Shell Script
aircrack-ng/test/test-aircrack-ng-0024.sh
#!/bin/sh set -ef "${abs_builddir}/../aircrack-ng${EXEEXT}" \ ${AIRCRACK_NG_ARGS} \ -w "${abs_srcdir}/password.lst" \ "${abs_srcdir}/pmkid-not-recognized.cap" 2>&1 | \ ${GREP} -F "8C:DE:F9:D0:B4:61" | \ ${GREP} -vF "PMKID" # Do NOT want to see a Enterprise PMKID here exit 0
Shell Script
aircrack-ng/test/test-airdecap-ng-0001.sh
#!/bin/sh set -ef "${abs_builddir}/../airdecap-ng${EXEEXT}" \ -e linksys \ -p dictionary \ "${abs_srcdir}/wpa2-psk-linksys.cap" \ -o /dev/null \ -c /dev/null | \ ${GREP} "decrypted WPA" | \ ${GREP} 25 exit 0
Shell Script
aircrack-ng/test/test-airdecap-ng-0002.sh
#!/bin/sh set -ef "${abs_builddir}/../airdecap-ng${EXEEXT}" \ -e linksys \ -p dictionary \ "${abs_srcdir}/wpa-psk-linksys.cap" \ -o /dev/null \ -c /dev/null | \ ${GREP} "decrypted WPA" | \ ${GREP} 53 exit 0
Shell Script
aircrack-ng/test/test-airdecap-ng-0003.sh
#!/bin/sh set -ef "${abs_builddir}/../airdecap-ng${EXEEXT}" \ -e test \ -p biscotte \ "${abs_srcdir}/wpa.cap" \ -o /dev/null \ -c /dev/null | \ ${GREP} "decrypted WPA" | \ ${GREP} 2 exit 0
Shell Script
aircrack-ng/test/test-airdecap-ng-0005.sh
#!/bin/sh MD5_BIN="md5sum" TMP_DEC=$(mktemp -u) TMP_MD5=$(mktemp -u) if type "md5" > /dev/null 2>/dev/null ; then MD5_BIN="md5 -q" fi airdecap_output=$("${abs_builddir}/../airdecap-ng${EXEEXT}" \ "${abs_srcdir}/capture_wds-01.cap" \ -e test1 \ -p 12345678 \ -b 00:11:22:00:00:00 \ -o ${TMP_DEC}) # shellcheck d...
Shell Script
aircrack-ng/test/test-airdecap-ng-0006.sh
#!/bin/sh # BSSID changing TMP_OUTPUT=$(mktemp -u) "${abs_builddir}/../airdecap-ng${EXEEXT}" \ "${abs_srcdir}/zn2i.pcap" \ -e dlink \ -p 12345678 \ -o /dev/null > ${TMP_OUTPUT} if [ "$(grep 'Number of decrypted WPA' ${TMP_OUTPUT} | awk '{print $6}')" != '1' ]; then echo "Failed decrypting" exit 1 fi exit 0
Shell Script
aircrack-ng/test/test-airdecap-ng.sh
#! /bin/sh # # Carlos Alberto Lopez Perez <clopez@igalia.com> # Thomas d'Otreppe <tdotreppe@aircrack-ng.org> - Support for sha1 and sh TESTDIR="$(dirname $0)" if [ "$(uname -s)" = 'OpenBSD' ]; then tmpdir="$(mktemp -d -t acng.XXXXXX)" else if test -f /etc/alpine-release; then tmpdir="$(mktemp -d -t acng.XX...
Shell Script
aircrack-ng/test/test-aireplay-ng-0001.sh
#!/bin/sh # Aireplay-ng fakeauth against hostapd if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present hostapd # Check for interfering processes airm...
Shell Script
aircrack-ng/test/test-aireplay-ng-0002.sh
#!/bin/sh # Aireplay-ng: broadcast deauth if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present tcpdump # Check for interfering processes airmon_ng_c...
Shell Script
aircrack-ng/test/test-aireplay-ng-0003.sh
#!/bin/sh # Aireplay-ng: directed deauth if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present tcpdump # Check for interfering processes airmon_ng_ch...
Shell Script
aircrack-ng/test/test-aireplay-ng-0004.sh
#!/bin/sh # Aireplay-ng: injection test if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present hostapd # Check for interfering processes airmon_ng_che...
Shell Script
aircrack-ng/test/test-aireplay-ng-0005.sh
#!/bin/sh # Aireplay-ng: Injection test with bitrate if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present hostapd # Check for interfering processes ...
Shell Script
aircrack-ng/test/test-aireplay-ng-0006.sh
#!/bin/sh # Aireplay-ng: deauth test with reason code if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present tcpdump # Check for interfering processes...
Shell Script
aircrack-ng/test/test-aireplay-ng-0007.sh
#!/bin/sh # Aireplay-ng/Airodump-ng: Fake auth on shared WEP key if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd ...
Shell Script
aircrack-ng/test/test-aireplay-ng-0008.sh
#!/bin/sh # Aireplay-ng/Airodump-ng: Fake auth on a 5GHz channel if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd...
Shell Script
aircrack-ng/test/test-airodump-ng-0001.sh
#!/bin/sh # Airodump-ng: Check base files generated are good if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen # Check for interfering pro...
Shell Script
aircrack-ng/test/test-airodump-ng-0002.sh
#!/bin/sh # Airodump-ng: Test WPA3 detection if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd # Check for interfe...
Shell Script
aircrack-ng/test/test-airodump-ng-0003.sh
#!/bin/sh # Airodump-ng: Test WPA3 (OWE) detection if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd # Check for i...
Shell Script
aircrack-ng/test/test-airodump-ng-0004.sh
#!/bin/sh # Airodump-ng: Test WPA2 detection if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd # Check for interfe...
Shell Script
aircrack-ng/test/test-airodump-ng-0005.sh
#!/bin/sh # Airodump-ng: Test WPA PSK TKIP detection if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd # Check for...
Shell Script
aircrack-ng/test/test-airodump-ng-0006.sh
#!/bin/sh # Airodump-ng: Test WPA2 PSK TKIP detection if test ! -z "${CI}"; then exit 77; fi # Load helper functions . "${abs_builddir}/../test/int-test-common.sh" # Check root check_root # Check all required tools are installed check_airmon_ng_deps_present is_tool_present screen is_tool_present hostapd # Check fo...
Shell Script
aircrack-ng/test/test-airolib-sqlite.sh
#! /bin/sh # # Carlos Alberto Lopez Perez <clopez@igalia.com> # TESTDIR="$(dirname $0)" if test -f /etc/alpine-release -o "$(uname -s)" = "OpenBSD"; then tmpfile="$(mktemp -u -t acng.XXXXXX)" else tmpfile="$(mktemp -u -t acng.XXXX)" fi # Clean on exit trap "rm -fr "${tmpdir}"" INT QUIT SEGV PIPE ALRM TERM EXIT ...
Shell Script
aircrack-ng/test/test-alltools.sh
#!/bin/sh test_tool() { TOOL_PATH="${top_builddir}/src/${1}${EXEEXT}" if [ -f "${TOOL_PATH}" ]; then "${TOOL_PATH}" # Anything greater than 1 indicates it does not # exist or did not run properly (crash) [ $? -gt 1 ] && exit 1 fi } test_tool airbase-ng test_tool aircrack-ng test_tool airdecap-ng test_tool ...
Inno Setup Script
aircrack-ng/test/test-env.sh.in
#!/bin/sh abs_builddir="@abs_builddir@"; export abs_builddir abs_srcdir="@abs_srcdir@"; export abs_srcdir top_builddir="@top_builddir@"; export top_builddir top_srcdir="@top_srcdir@"; export top_srcdir EXEEXT="@EXEEXT@"; export EXEEXT EXPECT="@EXPECT@"; export EXPECT AIRCRACK_LIBEXEC_PATH="@abs_top_builddir@/src"; ...
C
aircrack-ng/test/test-hex_string_to_array.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <string.h> #include <stdio.h> #include "aircrack-ng/support/common.h" int main(int nbarg, char * argv[]) { #define OUT_LEN 1024 unsigned char out[OUT_LEN]; int out_bytes, i; if (nbarg != 2) { printf("Missing parameter\n"); return 1; } for (i = 0; i...
Shell Script
aircrack-ng/test/test-hex_string_to_array.sh
#! /bin/sh ./test-hex_string_to_array >/dev/null 2>/dev/null RET=$? if [ ${RET} -ne 1 ]; then "Hex string test fail. Expected return value of 1 (missing parameter), got ${RET} with no parameter." exit 1 fi echo "Test Hex string to array with empty string: failure - Test successful" hex_failing_test() { ./test-hex_...
Shell Script
aircrack-ng/test/test-wpaclean-0001.sh
#!/bin/sh set -ef if test ! -e "${top_builddir}/wpaclean${EXEEXT}"; then echo "Skipped: $0" exit 0 fi "${top_builddir}/wpaclean${EXEEXT}" \ "$(basename $0).out.log" \ "${abs_srcdir}/wpaclean_crash.pcap" exit 0
Shell Script
aircrack-ng/test/test-wpaclean-0002.sh
#!/bin/sh set -ef if test ! -e "${top_builddir}/wpaclean${EXEEXT}"; then echo "Skipped: $0" exit 0 fi "${top_builddir}/wpaclean${EXEEXT}" \ "$(basename $0).out.log" \ "${abs_srcdir}/wpa.cap" | \ ${GREP} 'Net 00:0d:93:eb:b0:8c test' rm -f "$(basename $0).out.log" exit 0
Python
aircrack-ng/test/verify_inject.py
#!/usr/bin/env python # Usage: https://github.com/aircrack-ng/aircrack-ng/pull/21 from scapy.all import * conf.verbf = 1 interface = "at0" rpkt = Ether( dst = "[AP mac]", src = "[STA mac]" )/\ IP( dst = "[AP ip]", src = "[STA ip]" )/\ UDP( )/\ DNS(rd=1,qd=DNSQR(qname="www.aircrack-ng.org")) sen...
Include
aircrack-ng/test/cryptounittest/Makefile.inc
# Aircrack-ng # # Copyright (C) 2017-2022 Joseph Benden <joe@benden.us> # # Autotool support was written by: Joseph Benden <joe@benden.us> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eithe...
aircrack-ng/test/cryptounittest/README
This tests are meant to ensure that all functions of aircrack-ng where OpenSSL code is used [1] perform exactly the same (same input=>same output) when running with OpenSSL or with the alternative crypto (Libgcrypt+sha1-git) To run the tests with OpenSSL (useful for ensuring that the tests are still valid): ...
C
aircrack-ng/test/cryptounittest/test-calc-mic.c
/* * * test-calc-mic.c * * Copyright (C) 2012 Carlos Alberto Lopez Perez <clopez@igalia.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (...
C
aircrack-ng/test/cryptounittest/test-calc-pmk.c
/* * * test-calc-pmk.c * * Copyright (C) 2012 Carlos Alberto Lopez Perez <clopez@igalia.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (...
C
aircrack-ng/test/cryptounittest/test-calc-ptk.c
/* * * test-calc-ptk.c * * Copyright (C) 2012 Carlos Alberto Lopez Perez <clopez@igalia.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (...
C
aircrack-ng/test/cryptounittest/test-cipher-arcfour.c
/** * \file test-cipher-arcfour.c * * \brief The ARCFOUR stream cipher unit-tests * * \warning ARCFOUR is considered a weak cipher and its use constitutes a * security risk! We recommend considering stronger ciphers instead! * * \copyright 2022 Joseph Benden <joe@benden.us> * * \license ...
C
aircrack-ng/test/cryptounittest/test-decrypt-ccmp.c
/* * * test-decrypt-ccmp.c * * Copyright (C) 2012 Carlos Alberto Lopez Perez <clopez@igalia.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or ...
C
aircrack-ng/test/cryptounittest/test-digest-md5.c
/** * \file test-digest-md5.c * * \brief The MD5 message digest unit-tests * * \warning MD5 is considered a weak message digest and its use constitutes a * security risk! We recommend considering stronger message digests * instead! * * \copyright 2022 Joseph Benden <joe@benden....
C
aircrack-ng/test/cryptounittest/test-digest-sha1.c
/** * \file test-digest-sha1.c * * \brief The SHA-1 message digest unit-tests * * \warning SHA-1 is considered a weak message digest and its use constitutes a * security risk! We recommend considering stronger message digests * instead! * * \copyright 2022 Joseph Benden <joe@be...
C
aircrack-ng/test/cryptounittest/test-encrypt-ccmp.c
/* * * test-encrypt-ccmp.c * * Copyright (C) 2015 Jorn van Engelen <spamme@quzart.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at you...
C
aircrack-ng/test/cryptounittest/test-encrypt-wep.c
/* * * test-encrypt-wep.c * * Copyright (C) 2012 Carlos Alberto Lopez Perez <clopez@igalia.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or ...
C
aircrack-ng/test/cryptounittest/test-kdf-pbkdf2-hmac-sha1.c
/** * \file test-kdf-pbkdf2-hmac-sha1.c * * \brief The PBKDF2 HMAC-SHA-1 unit-tests * * \warning SHA-1 is considered a weak message digest and its use constitutes * a security risk! We recommend considering stronger message digests * instead! * * \copyright 2022 Joseph Benden <...
C
aircrack-ng/test/cryptounittest/test-mac-hmac-md5.c
/** * \file test-mac-hmac-md5.c * * \brief The HMAC-MD5 message authentication code unit-tests * * \warning MD5 is considered a weak message digest and its use constitutes a * security risk! We recommend considering stronger message digests * instead! * * \copyright 2022 Joseph...
C
aircrack-ng/test/cryptounittest/test-mac-hmac-sha1.c
/** * \file test-mac-hmac-sha1.c * * \brief The HMAC-SHA-1 message authentication code unit-tests * * \warning SHA-1 is considered a weak message digest and its use constitutes a * security risk! We recommend considering stronger message digests * instead! * * \copyright 2022 J...
C
aircrack-ng/test/cryptounittest/test-mac-hmac-sha256.c
/** * \file test-mac-hmac-sha256.c * * \brief The HMAC-SHA-2-256 message authentication code unit-tests * * \copyright 2022 Joseph Benden <joe@benden.us> * * \license GPL-2.0-OR-LATER */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdint.h> #include <stdio.h> #include <string.h> #incl...
C/C++
aircrack-ng/test/cryptounittest/tests.h
/* * * tests.h * * Copyright (C) 2012 Carlos Alberto Lopez Perez <clopez@igalia.com> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your ...
Include
aircrack-ng/test/unit/Makefile.inc
# Aircrack-ng # # Copyright (C) 2018 Joseph Benden <joe@benden.us> # # Autotool support was written by: Joseph Benden <joe@benden.us> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either ver...
C
aircrack-ng/test/unit/test-calc-one-pmk.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <cmocka.h> #include <assert.h> #include <stdio.h> #include <stdlib.h> #include "aircrack-ng/ce-wpa/crypto_engine.h" #include "aircrack-ng/crypto/crypto.h" static void test_calc_one_pmk(void ** state)...
C
aircrack-ng/test/unit/test-circular-buffer.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <setjmp.h> #include <cmocka.h> #include "aircrack-ng/adt/circular_buffer.h" static void test_cbuf_init_and_empty(void ** state) { (void) state; // GIVEN #define size 64 uint8_...
C
aircrack-ng/test/unit/test-circular-queue.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <setjmp.h> #include <cmocka.h> #include "aircrack-ng/adt/circular_queue.h" static void test_cqueue_init_and_empty(void ** state) { (void) state; // GIVEN #define size 64 uint8...
C
aircrack-ng/test/unit/test-string-has-suffix.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <cmocka.h> #include "aircrack-ng/osdep/byteorder.h" #include "radiotap/platform.h" #include "aircrack-ng/support/common.h" static void test_radiotap_unaligned_access(void ** state) { (void) state; ...
C
aircrack-ng/test/unit/test-wpapsk-cmac.c
/* * Copyright (C) 2018 Joseph Benden <joe@benden.us> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This...
C
aircrack-ng/test/unit/test-wpapsk.c
#ifdef HAVE_CONFIG_H #include "config.h" #endif #include <stdarg.h> #include <stddef.h> #include <setjmp.h> #include <cmocka.h> #include <assert.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include "aircrack-ng/crypto/crypto.h" #include "aircrack-ng/support/common.h" #include "aircrack-ng/cpu/tr...
algo/.ansible-lint
skip_list: - yaml - '204' verbosity: 1 warn_list: - no-changed-when - no-handler - fqcn-builtins - var-spacing
algo/.dockerignore
.dockerignore .git .github .gitignore .travis.yml CONTRIBUTING.md Dockerfile README.md config.cfg configs docs .env logo.png tests CHANGELOG.md PULL_REQUEST_TEMPLATE.md Vagrantfile Makefile
algo/algo
#!/usr/bin/env bash set -e if [ -z ${VIRTUAL_ENV+x} ] then ACTIVATE_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.env/bin/activate" if [ -f "$ACTIVATE_SCRIPT" ] then # shellcheck source=/dev/null source "$ACTIVATE_SCRIPT" else echo "$ACTIVATE_SCRIPT not found. Did you follow document...
Shell Script
algo/algo-docker.sh
#!/usr/bin/env bash set -eEo pipefail ALGO_DIR="/algo" DATA_DIR="/data" umask 0077 usage() { retcode="${1:-0}" echo "To run algo from Docker:" echo "" echo "docker run --cap-drop=all -it -v <path to configurations>:"${DATA_DIR}" ghcr.io/trailofbits/algo:latest" echo "" exit ${retcode} } if ...
Shell Script
algo/algo-showenv.sh
#!/usr/bin/env bash # # Print information about Algo's invocation environment to aid in debugging. # This is normally called from Ansible right before a deployment gets underway. # Skip printing this header if we're just testing with no arguments. if [[ $# -gt 0 ]]; then echo "" echo "--> Please include the fo...
algo/ansible.cfg
[defaults] inventory = inventory pipelining = True retry_files_enabled = False host_key_checking = False timeout = 60 stdout_callback = default display_skipped_hosts = no force_valid_group_names = ignore [paramiko_connection] record_host_keys = False [ssh_connection] ssh_args = -o ControlMaster=auto -o ControlPersist...
Markdown
algo/CHANGELOG.md
## 1.2 [(Unreleased)](https://github.com/trailofbits/algo/tree/HEAD) ### Added - New provider CloudStack added [\#1420](https://github.com/trailofbits/algo/pull/1420) - Support for Ubuntu 20.04 [\#1782](https://github.com/trailofbits/algo/pull/1782) - Allow WireGuard to listen on port 53 [\#1594](https://github.com/tr...
YAML
algo/cloud.yml
--- - name: Provision the server hosts: localhost tags: always become: false vars_files: - config.cfg tasks: - block: - name: Local pre-tasks import_tasks: playbooks/cloud-pre.yml - name: Include a provisioning role include_role: name: "{{ 'local' if a...
algo/config.cfg
--- # This is the list of users to generate. # Every device must have a unique user. # You can add up to 65,534 new users over the lifetime of an AlgoVPN. # User names with leading 0's or containing only numbers should be escaped in double quotes, e.g. "000dan" or "123". # Email addresses are not allowed. users: - p...
Markdown
algo/CONTRIBUTING.md
### Filing New Issues * Check that your issue is not already described in the [FAQ](docs/faq.md), [troubleshooting](docs/troubleshooting.md) docs, or an [existing issue](https://github.com/trailofbits/algo/issues) * Did you remember to install the dependencies for your operating system prior to installing Algo? * We o...
YAML
algo/deploy_client.yml
--- - name: Configure the client hosts: localhost become: false vars_files: - config.cfg tasks: - name: Add the droplet to an inventory group add_host: name: "{{ client_ip }}" groups: client-host ansible_ssh_user: "{{ 'root' if client_ip == 'localhost' else ssh_user }}" ...
algo/Dockerfile
FROM python:3-alpine ARG VERSION="git" ARG PACKAGES="bash libffi openssh-client openssl rsync tini gcc libffi-dev linux-headers make musl-dev openssl-dev rust cargo" LABEL name="algo" \ version="${VERSION}" \ description="Set up a personal IPsec VPN in the cloud" \ maintainer="Trail of Bits <http://...
YAML
algo/input.yml
--- - name: Ask user for the input hosts: localhost tags: always vars: defaults: server_name: algo ondemand_cellular: false ondemand_wifi: false dns_adblocking: false ssh_tunneling: false store_pki: false providers_map: - { name: DigitalOcean, alias: digitalocean ...
Shell Script
algo/install.sh
#!/usr/bin/env sh set -ex METHOD="${1:-${METHOD:-cloud}}" ONDEMAND_CELLULAR="${2:-${ONDEMAND_CELLULAR:-false}}" ONDEMAND_WIFI="${3:-${ONDEMAND_WIFI:-false}}" ONDEMAND_WIFI_EXCLUDE="${4:-${ONDEMAND_WIFI_EXCLUDE:-_null}}" STORE_PKI="${5:-${STORE_PKI:-false}}" DNS_ADBLOCKING="${6:-${DNS_ADBLOCKING:-false}}" SSH_TUNNELIN...
algo/LICENSE
GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble Th...
YAML
algo/main.yml
--- - hosts: localhost become: false tasks: - name: Playbook dir stat stat: path: "{{ playbook_dir }}" register: _playbook_dir - name: Ensure Ansible is not being run in a world writable directory assert: that: _playbook_dir.stat.mode|int <= 775 msg: > An...
algo/Makefile
## docker-build: Build and tag a docker image .PHONY: docker-build IMAGE := trailofbits/algo TAG := latest DOCKERFILE := Dockerfile CONFIGURATIONS := $(shell pwd) docker-build: docker build \ -t $(IMAGE):$(TAG) \ -f $(DOCKERFILE) \ . ## docker-deploy: Mount config directory and deploy Algo...
Markdown
algo/PULL_REQUEST_TEMPLATE.md
<!--- Provide a general summary of your changes in the Title above --> ## Description <!--- Describe your changes in detail --> ## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here. --> ## How Has This Been Tested?...
Markdown
algo/README.md
# Algo VPN [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/fold_left.svg?style=social&label=Follow%20%40AlgoVPN)](https://twitter.com/AlgoVPN) [![](https://github.com/trailofbits/algo/workflows/Main/badge.svg?branch=master)](https://github.com/trailofbits/algo/actions) Algo VPN is a set of Ansible sc...
YAML
algo/server.yml
--- - name: Configure the server and install required software hosts: vpn-host gather_facts: false become: true vars_files: - config.cfg tasks: - block: - name: Wait until the cloud-init completed wait_for: path: /var/lib/cloud/data/result.json delay: 10 ...
YAML
algo/users.yml
--- - hosts: localhost gather_facts: false tags: always vars_files: - config.cfg tasks: - block: - name: Get list of installed config files find: paths: configs/ depth: 2 recurse: true hidden: true patterns: .config.yml ...
algo/Vagrantfile
Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-20.04" config.vm.provider "virtualbox" do |v| v.name = "algo-20.04" v.memory = "512" v.cpus = "1" end config.vm.synced_folder "./", "/opt/algo", create: true config.vm.provision "ansible_local" do |ansible| ansible.play...
YAML
algo/.github/dependabot.yml
version: 2 updates: # Maintain dependencies for GitHub Actions - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" # Maintain dependencies for Python - package-ecosystem: "pip" directory: "/" schedule: interval: "daily"
YAML
algo/.github/FUNDING.yml
# These are supported funding model platforms github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] patreon: algovpn open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/p...
Markdown
algo/.github/ISSUE_TEMPLATE/bug_report.md
--- name: Bug report about: Create a report to help us improve --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Do this.. 2. Do that.. 3. .. **Expected behavior** A clear and concise description of what you expected to happen. **Ad...
Markdown
algo/.github/ISSUE_TEMPLATE/feature_request.md
--- name: Feature request about: Suggest an idea for this project --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want t...
YAML
algo/.github/workflows/docker-image.yaml
name: Create and publish a Docker image on: push: branches: ['master'] env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout repository uses:...
YAML
algo/.github/workflows/main.yml
name: Main on: [push, pull_request] jobs: lint: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v2.3.2 with: python-version: '3.9' cache: 'pip' - name: Install dependencies env: DEBIAN_FRONTEND: noninterac...
Markdown
algo/docs/client-android.md
# Android client setup ## Installation via profiles 1. [Install the WireGuard VPN Client](https://play.google.com/store/apps/details?id=com.wireguard.android). 2. Open QR code `configs/<ip_address>/wireguard/<username>.png` and scan it in the WireGuard app
Markdown
algo/docs/client-apple-ipsec.md
# Using the built-in IPSEC VPN on Apple Devices ## Configure IPsec Find the corresponding `mobileconfig` (Apple Profile) for each user and send it to them over AirDrop or other secure means. Apple Configuration Profiles are all-in-one configuration files for iOS and macOS devices. On macOS, double-clicking a profile ...
Markdown
algo/docs/client-linux-ipsec.md
# Linux strongSwan IPsec Clients (e.g., OpenWRT, Ubuntu Server, etc.) Install strongSwan, then copy the included ipsec_user.conf, ipsec_user.secrets, user.crt (user certificate), and user.key (private key) files to your client device. These will require customization based on your exact use case. These files were orig...
Markdown
algo/docs/client-linux-wireguard.md
# Using Ubuntu as a Client with WireGuard ## Install WireGuard To connect to your AlgoVPN using [WireGuard](https://www.wireguard.com) from Ubuntu, make sure your system is up-to-date then install WireGuard: ```shell # Update your system: sudo apt update && sudo apt upgrade # If the file /var/run/reboot-required ex...
Markdown
algo/docs/client-linux.md
# Linux client setup ## Provision client config After you deploy a server, you can use an included Ansible script to provision Linux clients too! Debian, Ubuntu, CentOS, and Fedora are supported. The playbook is `deploy_client.yml`. ### Required variables * `client_ip` - The IP address of your client machine (You c...
Markdown
algo/docs/client-macos-wireguard.md
# MacOS WireGuard Client Setup The WireGuard macOS app is unavailable for older operating systems. Please update your operating system if you can. If you are on a macOS High Sierra (10.13) or earlier, then you can still use WireGuard via their userspace drivers via the process detailed below. ## Install WireGuard In...
Markdown
algo/docs/client-openwrt-router-wireguard.md
# Using Router with OpenWRT as a Client with WireGuard This scenario is useful in case you want to use vpn with devices which has no vpn capability like smart tv, or make vpn connection available via router for multiple devices. This is a tested, working scenario with following environment: - algo installed ubuntu at...
Markdown
algo/docs/cloud-alternative-ingress-ip.md
# Alternative Ingress IP This feature allows you to configure the Algo server to send outbound traffic through a different external IP address than the one you are establishing the VPN connection with. ![cloud-alternative-ingress-ip](/docs/images/cloud-alternative-ingress-ip.png) Additional info might be found in [t...
Markdown
algo/docs/cloud-amazon-ec2.md
# Amazon EC2 cloud setup ## AWS account creation Creating an Amazon AWS account requires giving Amazon a phone number that can receive a call and has a number pad to enter a PIN challenge displayed in the browser. This phone system prompt occasionally fails to correctly validate input, but try again (request a new PI...
Markdown
algo/docs/cloud-azure.md
# Azure cloud setup The easiest way to get started with the Azure CLI is by running it in an Azure Cloud Shell environment through your browser. Here you can find some information from [the official doc](https://docs.microsoft.com/en-us/cli/azure/get-started-with-azure-cli?view=azure-cli-latest). We put the essenti...
Markdown
algo/docs/cloud-cloudstack.md
### Configuration file Algo scripts will ask you for the API detail. You need to fetch the API credentials and the endpoint from the provider control panel. Example for Exoscale (European cloud provider exposing CloudStack API), visit https://portal.exoscale.com/u/<your@account>/account/profile/api to gather the requ...
Markdown
algo/docs/cloud-do.md
# DigitalOcean cloud setup ## API Token creation First, login into your DigitalOcean account. Select **API** from the titlebar. This will take you to the "Applications & API" page. ![The Applications & API page](/docs/images/do-api.png) On the **Tokens/Keys** tab, select **Generate New Token**. A dialog will pop u...
Markdown
algo/docs/cloud-gce.md
# Google Cloud Platform setup * Follow the [`gcloud` installation instructions](https://cloud.google.com/sdk/) * Log into your account using `gcloud init` ### Creating a project The recommendation on GCP is to group resources into **Projects**, so we will create a new project for our VPN server and use a service ac...
Markdown
algo/docs/cloud-hetzner.md
## API Token Sign in into the [Hetzner Cloud Console](https://console.hetzner.cloud/) choose a project, go to `Security` → `API Tokens`, and `Generate API Token` with `Read & Write` access. Make sure to copy the token because it won’t be shown to you again. A token is bound to a project. To interact with the API of an...