Sinisterly
Tutorial freevpn --> bash script - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Hacking (https://sinister.li/Forum-Hacking)
+--- Forum: Tutorials (https://sinister.li/Forum-Tutorials)
+--- Thread: Tutorial freevpn --> bash script (/Thread-Tutorial-freevpn-bash-script)



freevpn --> bash script - d0ntjump - 09-30-2016

d0ntjump -->

--> here is a script i wrote to easily establish a free vpn connection.
--> you can visit --> www.vpnbook.com <-- and check it out yourself. [it's great for browsing & such but doesn't support p2p]
--> follow the instructions below and you will have a free vpn in no time!

preconditions --> first you will need to install wget, figlet, lolcat & openvpn if they aren't already installed with your linux distro.
                                 --> w/debian --> sudo apt-get install wget figlet lolcat openvpn
                                      --> figlet & lolcat are strictly 4 eye candy.

opt 1 --> create a folder in your 'home/user' directory and name it 'vpn' or whatever you desire/please.
                 --> copy & paste the script below into a text editor of your choosing.
                       --> save the script as 'freevpn' in the folder 'vpn' or whatever you named it.
                             --> go to --> http://www.vpnbook.com/freevpn <-- and download the files 'US1 OpenVPN Certificate Bundle' & 'US2 OpenVPN Certificate Bundle'.
                                   --> now you will need to extract/unzip the files into the same 'vpn folder or whatever you named it.

opt 2 --> download the attachment and extract/unzip the file into your 'home/user' directory.

here is an example of the hierarchy/structure you should have -->

home --> user --> vpn --> freevpn (script)
                                                 vpnbook-us1-tcp80.ovpn
                                                 vpnbook-us1-tcp443.ovpn
                                                 vpnbook-us1-udp53.ovpn
                                                 vpnbook-us1-udp25000.ovpn
                                                 vpnbook-us2-tcp80.ovpn
                                                 vpnbook-us2-tcp443.ovpn
                                                 vpnbook-us2-udp53.ovpn
                                                 vpnbook-us2-udp25000.ovpn

next --> from terminal/bash you will need to change the permissions and add the 'x' execution privilege.
              --> navigate to folder where the script is and run the commands below.
                     --> w/debian --> sudo chmod +x freevpn
                           --> w/debian --> sudo chmod 755 freevpn <-- use this command as needed and accordingly.

--> you will need to alter the file path in the code to reference your user directory.
--> anywhere in the code that says 'sudo openvpn /home/user/vpn/' you will need to change the 'user' path to your own.
--> example --> sudo openvpn /home/billybob/vpn/vpnbook-us1-tcp80.ovpn

--> all you need to do now is execute the script with ./freevpn
--> the script is self explanatory...
--> enjoy!

#!/bin/bash
#------------------------------------------------------------
# author --> d0ntjump
# description --> creates a vpn connection using openvpn
# requirments --> wget, figlet, lolcat & openvpn
#------------------------------------------------------------
figlet "freevpn" | lolcat
sudo echo
echo "username --> vpnbook"
    # the username never changes
echo "password -->" && wget -q -O- http://www.vpnbook.com/freevpn | grep Password
    # the password changes from time to time --> command above will grab current password
    # output will duplicate
echo
echo "enter/choose which configuration to use -->"
echo
echo "(1) --> vpnbook-us1-tcp80.ovpn"
echo "(2) --> vpnbook-us1-tcp443.ovpn"
echo "(3) --> vpnbook-us1-udp53.ovpn"
echo "(4) --> vpnbook-us1-udp25000.ovpn"
echo "(5) --> vpnbook-us2-tcp80.ovpn"
echo "(6) --> vpnbook-us2-tcp443.ovpn"
echo "(7) --> vpnbook-us2-udp53.ovpn"
echo "(8) --> vpnbook-us2-udp25000.ovpn"
echo
read configuration
echo
if [ $configuration == "1" ]
 then
   sudo openvpn /home/user/vpn/vpnbook-us1-tcp80.ovpn

elif [ $configuration == "2" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us1-tcp443.ovpn

elif [ $configuration == "3" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us1-udp53.ovpn

elif [ $configuration == "4" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us1-udp25000.ovpn

elif [ $configuration == "5" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us2-tcp443.ovpn

elif [ $configuration == "6" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us2-udp53.ovpn

elif [ $configuration == "7" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us2-udp25000.ovpn

elif [ $configuration == "8" ]
 then
  sudo openvpn /home/user/vpn/vpnbook-us2-tcp443.ovpn
fi



RE: freevpn --> script <-- 4 Linux - mothered - 09-30-2016

A few supported Images here and there, would've been nice to make It a little easier to follow.

Nonetheless, thanks for the guide.


RE: freevpn --> script <-- 4 Linux - d0ntjump - 10-01-2016

(09-30-2016, 03:18 PM)mothered Wrote: A few supported Images here and there, would've been nice to make It a little easier to follow.

Nonetheless, thanks for the guide.

i'm not much on pictures because i believe that anything worth learning won't be a cake walk. society today expects to be spoon-fed. you will grasp/understand
a concept better after making mistakes. please don't envision me as a dickhead. i mean no harm and i will consider pictures with future posts. constructive
criticism accepted and thank you!


RE: freevpn --> script <-- 4 Linux - mothered - 10-01-2016

(10-01-2016, 05:08 AM)d0ntjump Wrote: i'm not much on pictures because i believe that anything worth learning won't be a cake walk. society today expects to be spoon-fed. you will grasp/understand
a concept better after making mistakes. please don't envision me as a dickhead. i mean no harm and i will consider pictures with future posts. constructive
criticism accepted and thank you!

That's fine, It was just a suggestion on my end nothing more. I apologize If It came across any other way.

Once again, thanks.


RE: freevpn --> script <-- 4 Linux - d0ntjump - 10-01-2016

(10-01-2016, 05:25 AM)mothered Wrote:
(10-01-2016, 05:08 AM)d0ntjump Wrote: i'm not much on pictures because i believe that anything worth learning won't be a cake walk. society today expects to be spoon-fed. you will grasp/understand
a concept better after making mistakes. please don't envision me as a dickhead. i mean no harm and i will consider pictures with future posts. constructive
criticism accepted and thank you!

That's fine, It was just a suggestion on my end nothing more. I apologize If It came across any other way.

Once again, thanks.

no need for an apology. no harm was done and you're very welcome. do you use a vpn?
this particular one is only good for browsing. it is meant for light anonymity. a good
vpn service cost a little cheese.


RE: freevpn --> script <-- 4 Linux - mothered - 10-01-2016

(10-01-2016, 05:49 AM)d0ntjump Wrote: do you use a vpn?

Given the nature of my computing, I certainly do.

When I compromise websites, I hook onto someone else's AP and utilize their ISP.


RE: freevpn --> script <-- 4 Linux - d0ntjump - 10-01-2016

(10-01-2016, 02:33 PM)mothered Wrote:
(10-01-2016, 05:49 AM)d0ntjump Wrote: do you use a vpn?

Given the nature of my computing, I certainly do.

When I compromise websites, I hook onto someone else's  AP and utilize their ISP.

then you already know what you're doing,


RE: freevpn --> script <-- 4 Linux - xulas - 10-02-2016

Very simple. Very efficient.