VPNBook-Passwd.com w/ Sample Robot Script for ASUSWRT-Merlin

  • ATTENTION! You'll notice a Prefix dropdown when you create a thread. If your post applies to one of the topics listed, please use that Prefix for your post. When browsing the thread list you can use the Prefix to filter the view.
  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

garycnew

Regular Contributor
All:

As you know, I'm constantly trying to innovate and think outside of the box with solutions (Hopefully, there isn't already an ASUSWRT-Merlin Add-on for this one). I finally got around to implementing and documenting this project (http://vpnbook-passwd.com/). For those of you whom would prefer to automate the vpnbook.com openvpn client password update, I've registered vpnbook-passwd.com that provides read-only access to my /tmp/etc/openvpn/client1/auth file directly on my router. The only catch is you have to wait for me to manually update my router prior to your router being updated. Fair trade?

Here is a Sample Robot Script that works specifically with ASUSWRT-Merlin (which can be adopted for other architectures):
Code:
#!/bin/sh

### Robot Installation ###
# mkdir -p /jffs/scripts/vpnbook-passwd.com
# cd /jffs/scripts/vpnbook-passwd.com/
# wget http://vpnbook-passwd.com/robot
# chmod 755 /jffs/scripts/vpnbook-passwd.com/robot

wget=$(/usr/sbin/wget --quiet -O - --no-check-certificate --save-cookies wget-cookies.txt --keep-session-cookies --load-cookies wget-cookies.txt -U "VPNBook-Passwd.com Robot/0.1" http://vpnbook-passwd.com/ | head -2 2>&1 | tee auth)

#echo $wget

diff=$(diff auth /etc/openvpn/client1/auth)

#echo $diff

if [ "$wget" != "" ] && [ "$diff" != "" ]; then
   #username=$(head -1 auth)      
   #password=$(head -2 auth | tail -1)
   username=$(sed -n '1p' auth)      
   password=$(sed -n '2p' auth)

   #echo "#$username#"
   #echo "#$password#"

   nvram set vpn_client_password=$password
   nvram set vpn_client1_password=$password
   nvram commit

   service restart_vpnclient1
   service restart_webdav

   #echo -e "Password Changed\n$username\n$password\n" | /usr/sbin/sendmail -S"smtp.domain.com:25" -auusername -appassword -f"[email protected]" -t [email protected]
fi

### ASUSWRT-Merlin openvpn-event Config ###
# touch /jffs/scripts/openvpn-event
# chmod 755 /jffs/scripts/openvpn-event
# echo "if [ \"$dev\" = \"tun11\" ] && [ \"$script_type\" = \"route-pre-down\" ]; then" >> /jffs/scripts/openvpn-event
# echo "   /bin/sh /jffs/scripts/vpnbook-passwd.com/robot" >> /jffs/scripts/openvpn-event
# echo "fi" >> /jffs/scripts/openvpn-event

I've had something similar to this successfully running for the past year and thought it was mature enough to let out into the wild.

It's always a mystery as to what type of responses I will receive when posting to the ASUSWRT-Merlin forums. Inevitably, someone will mention Security, Honeypots, etc. The fact is, if it's useful to you then have at it. If not, at least be constructive in your criticism. Thank You.

Respectfully,


Gary
 
Last edited:

L&LD

Part of the Furniture
I don't understand the 'catch'?

As it has been explained so far, this does not sound like a fair trade.
 

Tech9

Very Senior Member
vpnbook.com

I personally had to look what vpnbook.com is. So, if I have no service with this guys because of the password, my first action would be to get the new password. How difficult is to update this password manually and how much time it takes? We may have 12h time difference with you.
 

garycnew

Regular Contributor
I don't understand the 'catch'?

As it has been explained so far, this does not sound like a fair trade.

The previous response is unconstructive.

A constructive response is kindly teaching you that double quotes are used in quoting an original reference and single quotes are used for quoting an existing quote.

Hope that helps.
 

garycnew

Regular Contributor
I personally had to look what vpnbook.com is. So, if I have no service with this guys because of the password, my first action would be to get the new password. How difficult is to update this password manually and how much time it takes? We may have 12h time difference with you.

This is a constructive question.

More than likely, I desire the same VPN to be up and available as much as you do, so it would be in my best interest to have my openvpn-event script configured to text me an alert when the VPN went down and for me to manually update the password for both of us.

It's a simple matter of whether you prefer to set-it-and-forget-it or manually update the VPN password on your own. I take it you prefer the later.
 

Martineau

Part of the Furniture
For those of you whom would prefer to automate the vpnbook.com openvpn client password update, I've registered vpnbook-passwd.com that provides read-only access to my /tmp/etc/openvpn/client1/auth file directly on my router. The only catch is you have to wait for me to manually update my router prior to your router being updated. Fair trade?
FYI,.....................(and not knocking your altruistic '/etc/openvpn/client1/auth' hosting efforts) auto updating VPNBOOK password has been around since 2014

but when they changed to .img, I've used
vpnbook/password_extractor at master · HiMyNameIsIlNano/vpnbook · GitHub
to extract the password (tweaked the script variable output_file=/tmp/vpnbok_pwd_${timestamp}.json to save the password locally to output_file=/jffs/configs/VPNBOOK.pwd), then used the appropriate event/postconf etc. script to use the new password if it has changed.
 

garycnew

Regular Contributor
FYI,.....................(and not knocking your altruistic '/etc/openvpn/client1/auth' hosting efforts) auto updating VPNBOOK password has been around since 2014
I was aware that auto-updating vpnbook.com had been available prior to the password image change. I was not aware of vpnbook/password_extractor. This is even better, if it will run on ASUSWRT-Merlin.
but when they changed to .img, I've used
vpnbook/password_extractor at master · HiMyNameIsIlNano/vpnbook · GitHub
to extract the password (tweaked the script variable output_file=/tmp/vpnbok_pwd_${timestamp}.json to save the password locally to output_file=/jffs/configs/VPNBOOK.pwd), then used the appropriate event/postconf etc. script to use the new password if it has changed.
Do you know whether it's possible to install vpnbook/password_extractor on ASUSWRT-Merlin?

How accurate is vpnbook/password_extractor?

Much Appreciated.


Gary
 
Last edited:

Martineau

Part of the Furniture
I was aware that auto-updating vpnbook.com had been available prior to the password image change. I was not aware of vpnbook/password_extractor. This is even better, if it will run on ASUSWRT-Merlin.

Do you know whether it's possible to install vpnbook/password_extractor on ASUSWRT-Merlin?
Yes
How accurate is vpnbook/password_extractor?
I only briefly/temporarily use VPNBOOK if my subscription VPN providers show weird transient connection/throughput issues etc. (which is rare) and sometimes when I feel it prudent to test new router firmware releases for vanilla VPN Client compatibility.

Personally, I would say it is very accurate when I have needed to use it, but I do recall it failed a couple of times where it seemed to drop the first character.
 

Tech9

Very Senior Member
I take it you prefer the later.

No, I don't use this service. I mean, with this script password update happens only when you update your router and that may not happen for hours because of the time difference. I get the idea, but the script may not be very useful for people living on the other side of the globe.
 

garycnew

Regular Contributor
I mean, with this script password update happens only when you update your router and that may not happen for hours because of the time difference. I get the idea, but the script may not be very useful for people living on the other side of the globe.
What if the vpnbook-passwd.com site is automatically updated by the vpnbook/password_extractor script?
 

L&LD

Part of the Furniture
The previous response is unconstructive.

A constructive response is kindly teaching you that double quotes are used in quoting an original reference and single quotes are used for quoting an existing quote.

Hope that helps.

No, your response is not constructive. Nor did you answer my queries.

Pointing out my failures in the English language while ignoring me questions is bad form.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top