Giter Club home page Giter Club logo

insecure-auto-vpn's Introduction

Insecure Auto VPN

An experiment in automating a TTY to connect to an OpenVPN server for Linux-based systems.

WARNING: This is just a proof-of-concept. Do not use this in high security environments as this kinda destroys the purpose of 2FA protection.

Problem Statement

On some Linux systems, there exists an OpenVPN bug that causes the auth-user-pass directive to not work with 2FA. This results in having to re-enter your username, password and 2FA every time one connects to a VPN, wasting roughly 20 seconds each time.

Most of us connect to the VPN every day at work. Each time connecting is about 5 seconds to enter your username and password, and another 10 (or maybe more) to take the phone out of your pocket, go to an authentication app, possbily wait for the numbers to refresh if it's too close to the deadline set for the 2FA. That's roughly 20 seconds per VPN login. That's 20 * 5 seconds, or 100 seconds a week. Over a year that's 5200 seconds a year - or 86 minutes, not accounting for the times when one goes out to meetings, closing the laptop and having to reconnect after.

That being said, this is just a proof-of-concept to demonstrate the possibility of doing so - use at your own risk.

Installation

npm i -g insecure-auto-vpn;

This exposes an iavpn command on your local machine for your current user.

Create a symlink to it in a place that root can access:

sudo ln -s $(which iavpn) /usr/bin/iavpn

Create Configuration File

iavpn -g

The script will request for 5 fields in the following order:

  1. Path to .ovpn file
  2. Username used by the VPN server
  3. Password used by the VPN server
  4. 2FA seed
  5. Password to encrypt fields from 1-4.

The script will create a file at ~/.iavpn with the encrypted information inside.

Since the ~/.iavpn file will only be read by root, you should set the permissions accordingly to improve security:

chmod 600 ~/.iavpn;
chown root:root ~/.iavpn;

Usage

Note: You'll also need Node to be installed as the root user. To verify this, run sudo which node.

sudo iavpn

We require sudo because the openvpn application requires sudo to open the sockets required.

Risks

Following are security risks that you are undertaking by using this:

  • NPM compromised - if NPM is compromised and someone overwrites the source code, they can potentially steal your VPN info. To mitigate this risk, git clone this and use npm link.
  • Package node-aes256 compromised - the package used for encrypting your information.
  • Weak password - a password length of 8 is enforced - it will take 1.44 years for a normal computer to brute-force, 5 days with a GPU, and 7 minutes with a supercomputer (reference)

Cheers

(you shouldn't be using this)

insecure-auto-vpn's People

Contributors

ryanoolala avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.