npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

insecure-auto-vpn

v1.1.0

Published

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

Downloads

15

Readme

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)