Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A function to make sure you are connected to your favorite VPN before running your script.
A Python function to make sure you are connected to your favorite VPN before running your script or function. It just raises an exception if you're not connected.
"expressvpn"
)"hidemyass"
)"hotspotshield"
)"ipvanish"
)"ivpn"
)"mullvad"
)"nordvpn"
)"privateinternetaccess"
)"protonvpn"
)"surfshark"
)"vyprvpn"
)Add your own!
pip install ensure-vpn
Import the function and run it as the first thing in your script:
from ensure_vpn import ensure_vpn
ensure_vpn("mullvad") # raises VPNNotConnectedException if you're not connected.
# rest of your script goes here
You can also use a custom IP or subnet:
ensure_vpn("2.235.200.110") # or e.g. "2.235.200.0/24"
You can also use the decorator to run the check every time before running a specific function. This is to make sure you don't run untrusted code if you lose your VPN connection after starting your program.
Note that this can be resource intensive depending on how often you call your function so it may slow down your program considerably or get you rate-limited by the services used by this script.
from ensure_vpn import ensure_vpn_decorator
@ensure_vpn_decorator("nordvpn")
def do_stuff():
# ...
do_stuff() # VPN is checked every time you call do_stuff
FAQs
A function to make sure you are connected to your favorite VPN before running your script.
We found that ensure-vpn demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.