NCD scripting language, tun2socks proxifier, P2P VPN
2022-04-30 17:41:25 +00:00
.devcontainer Update dockerfiles 2022-04-30 17:41:25 +00:00
.github/workflows Patch by Sirherobrine23 2022-04-30 13:51:33 -03:00
.vscode Update dockerfiles 2022-04-30 17:41:25 +00:00
arpprobe Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
base Fixes for Visual Studio 2017. 2018-12-30 15:51:55 +01:00
blog_generator port to compile with MSVC 2012-07-24 10:26:30 +00:00
bproto port to compile with MSVC 2012-07-24 10:26:30 +00:00
bproto_generator bproto_generator: fix aliasing issues 2012-12-30 12:48:01 +00:00
client Assume that NSS headers are under nss/. 2018-12-30 15:51:55 +01:00
cmake/modules Assume that NSS headers are under nss/. 2018-12-30 15:51:55 +01:00
dhcpclient Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
dostest add some programs for playing with DoS attacks on TCP 2012-09-03 22:51:24 +00:00
examples ncd: Store the NCDStingIndex pointer in NCDValMem. 2015-05-09 00:01:49 +02:00
flooder Use GNUInstallDirs for controlling install destinations 2016-05-24 18:47:06 +02:00
flow compile PIC versions of internal libraries, to be used by NCD plugins 2013-03-13 15:06:47 +00:00
flowextra Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
generated Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
lemon Add NCD, the Network Configuration Daemon 2010-12-10 00:21:40 +00:00
lime Initial import 2010-10-25 09:17:17 +00:00
lwip Cherry pick http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_out.c?id=04b983b4f376697f04980b8d547fa4d03aa10600 2019-08-20 09:52:27 +08:00
misc Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
ncd NCD: Fix evdev event code names with newer headers. 2016-08-27 17:09:48 +02:00
ncd-request Use GNUInstallDirs for controlling install destinations 2016-05-24 18:47:06 +02:00
nspr_support Assume that NSS headers are under nss/. 2018-12-30 15:51:55 +01:00
predicate Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
protocol tun2socks: IPv6 support. Includes updated lwIP version and udpgw program. 2013-04-22 16:16:03 +00:00
random Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
scripts scripts/copy_nss: copy programs too 2011-01-28 15:42:59 +00:00
security Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
server Assume that NSS headers are under nss/. 2018-12-30 15:51:55 +01:00
server_connection Assume that NSS headers are under nss/. 2018-12-30 15:51:55 +01:00
socks_udp_client SocksUdpClient:Fix compile error when assertions are enabled. 2020-02-08 15:11:26 -08:00
socksclient tun2socks: Remove localhost limination for SOCKS5 UDP. 2020-02-01 15:02:11 -08:00
stringmap Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
structure structure: Vector: Reduce interface. 2014-11-09 10:10:28 +01:00
system This fixes build of the project on Windows 2020-06-06 02:22:20 +02:00
tests get rid of some warnings 2012-09-01 19:23:02 +00:00
threadwork Fix possible compile error after switch to pthread_sigmask. 2016-09-06 20:46:25 +02:00
tun2socks tun2socks: Remove localhost limination for SOCKS5 UDP. 2020-02-01 15:02:11 -08:00
tuntap Fix TUN/TAP initialization with newer TAP-Windows. 2016-11-13 16:52:38 +01:00
udevmonitor Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
udpgw Patch by Sirherobrine23 2022-04-30 13:51:33 -03:00
udpgw_client Use badvpn_add_library for all internal libraries. 2014-10-16 00:04:08 +02:00
.gitignore Patch by Sirherobrine23 2022-04-30 13:51:33 -03:00
badvpn-win32.nix Finishing Nix build method for Windows. 2016-11-18 19:58:02 +01:00
badvpn.7 switch to using the New BSD License 2012-01-27 13:24:37 +00:00
badvpn.nix Nix expressions: Separate the package function from the composition. 2015-01-24 15:36:38 +01:00
blog_channels.txt Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
build-win32.nix Finishing Nix build method for Windows. 2016-11-18 19:58:02 +01:00
BUILD-WINDOWS-VisualStudio.md New Windows build instructions using VS. 2018-12-30 15:58:00 +01:00
build.nix build.nix: Enable passing nixpkgs as an argument. 2020-02-01 15:02:11 -08:00
ChangeLog version 1.999.130 2015-04-09 12:31:55 +02:00
CMakeLists.txt Implement optional support for SOCKS5-UDP 2020-02-01 15:02:11 -08:00
compile-tun2socks.sh Fixes and refactoring for SOCKS5 UDP. 2020-02-01 15:02:11 -08:00
compile-udpgw.sh Fix udpgw compile script as well 2017-07-27 18:52:15 +02:00
COPYING switch to using the New BSD License 2012-01-27 13:24:37 +00:00
Dockerfile Update dockerfiles 2022-04-30 17:41:25 +00:00
fix_flex.php port to compile with MSVC 2012-07-24 10:26:30 +00:00
generate_files ncd: rename NCDValue{Generator,Parser} to NCDVal{Generator,Parser} 2012-10-05 01:45:22 +00:00
README.md Update README.md 2021-08-22 16:00:45 +02:00

This repository has been archived and is not being maintained by the author any longer.

BadVPN

Introduction

In this project I host some of my open-source networking software. All of the software is written in C and utilizes a custom-developed framework for event-driven programming. The extensive code sharing is the reason all the software is packaged together. However, it is possible to compile only the required components to avoid extra dependencies.

NCD programming language

NCD (Network Configuration Daemon) is a daemon and programming/scripting language for configuration of network interfaces and other aspects of the operating system. It implements various functionalities as built-in modules, which may be used from an NCD program wherever and for whatever purpose the user needs them. This modularity makes NCD extremely flexible and extensible. It does a very good job with hotplugging in various forms, like USB network interfaces and link detection for wired devices. New features can be added by implementing statements as C-language modules using a straightforward interface.

Tun2socks network-layer proxifier

The tun2socks program "socksifes" TCP connections at the network layer. It implements a TUN device which accepts all incoming TCP connections (regardless of destination IP), and forwards the connections through a SOCKS server. This allows you to forward all connections through SOCKS, without any need for application support. It can be used, for example, to forward connections through a remote SSH server.

Peer-to-peer VPN

The VPN part of this project implements a Layer 2 (Ethernet) network between the peers (VPN nodes). The peers connect to a central server which acts as a communication proxy allowing the peers to establish direct connections between each other (data connections). These connections are used for transferring network data (Ethernet frames), and can be secured with a multitude of mechanisms. Notable features are:

  • UDP and TCP transport
  • Converges very quickly after a new peer joins
  • IGMP snooping to deliver multicasts efficiently (e.g. for IPTV)
  • Double SSL: if SSL is enabled, not only do peers connect to the server with SSL, but they use an additional layer of SSL when exchanging messages through the server
  • Features related to the NAT problem:
    • Can work with multiple layers of NAT (needs configuration)
    • Local peers inside a NAT can communicate directly
    • Relaying as a fallback (needs configuration)

Requirements

NCD only works on Linux. Tun2socks works on Linux and Windows. The P2P VPN works on Linux, Windows and FreeBSD (not tested often).

Installation

The build system is based on CMake. On Linux, the following commands can be used to build:

cd <badvpn-source-dir>
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<install-dir>
make install

If you only need tun2socks or udpgw, then add the following arguments to the cmake command: -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DBUILD_UDPGW=1. Otherwise (if you want the VPN software), you will first need to install the OpenSSL and NSS libraries and make sure that CMake can find them.

Windows builds are not provided. You can build from source code using Visual Studio by following the instructions in the file BUILD-WINDOWS-VisualStudio.md.

License

The BSD 3-clause license as shown below applies to most of the code.

Copyright (c) 2009, Ambroz Bizjak <ambrop7@gmail.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
   notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
3. Neither the name of the author nor the
   names of its contributors may be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

List of third-party code included in the source:

  • lwIP - A Lightweight TCP/IP stack. License: lwip/COPYING