Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nu11secur1ty patch 1 #1215

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ When OpenVPN is installed, you can run the script again, and you will get the ch

In your home directory, you will have `.ovpn` files. These are the client configuration files. Download them from your server and connect using your favorite OpenVPN client.

## Cleaning of revoked users:
## NOTE:
For your safety, please run every time when you want to clean an already revoked user!
This program is only for `REVOKED` users!

- Usage:
```perl
perl revoke-cleaner.pl
# follow the steps...
```


If you have any question, head to the [FAQ](#faq) first. Please read everything before opening an issue.

**PLEASE do not send me emails or private messages asking for help.** The only place to get help is the issues. Other people may be able to help and in the future, other users may also run into the same issue as you. My time is not available for free just for you, you're not special.
Expand Down
6 changes: 4 additions & 2 deletions openvpn-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1103,13 +1103,13 @@ function newClient() {
# if not, use SUDO_USER
if [ "${SUDO_USER}" == "root" ]; then
# If running sudo as root
homeDir="/root"
homeDir="/etc/openvpn/client/"
else
homeDir="/home/${SUDO_USER}"
fi
else
# if not SUDO_USER, use /root
homeDir="/root"
homeDir="/etc/openvpn/client"
fi

# Determine if we use tls-auth or tls-crypt
Expand Down Expand Up @@ -1147,9 +1147,11 @@ function newClient() {
echo "</tls-auth>"
;;
esac
# $homeDir
} >>"$homeDir/$CLIENT.ovpn"

echo ""
# $homeDir
echo "The configuration file has been written to $homeDir/$CLIENT.ovpn."
echo "Download the .ovpn file and import it in your OpenVPN client."

Expand Down
54 changes: 54 additions & 0 deletions revoke-cleaner.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/usr/bin/perl
# Author @nu11secur1ty
use strict;
use warnings;
use diagnostics;
use Term::ANSIColor;

print color('GREEN');
print "You should remove all lines which you see on this print with the path";
print color('RESET');

print color('BLUE');
print " (/etc/openvpn/easy-rsa/pki/index.txt)\n";
print color('RESET');

print color('GREEN');
print "because these users are already";
print color('RESET');

print color('RED');
print " revoked!\n";
print color('RESET');

print color('GREEN');
print "If you do not see lines with (R) in the beginning, you will have nothing to clean!\n\n\n";
print color('RESET');

my $ENV = `cat /etc/openvpn/easy-rsa/pki/index.txt | grep R`;
print "$ENV";

print color('Yellow');
print "This is your issued crt's\n";
print color('RESET');

my $issued = `ls -all /etc/openvpn/easy-rsa/pki/issued/`;
print "$issued";

## Cleaning
my $ENVPKI = "/etc/openvpn/easy-rsa/pki/index.txt";
print "Preparing for cleaning...\n";

print color('RED');
print "Please, choose the username, or if you are not really sure, just press Enter to exit the cleaner...\n";
print color('RESET');

chomp (my $username = <STDIN>);
my $cleaner = `sed -i '/$username/d' $ENVPKI`;

print color('YELLOW');
print"Your client configurations in /etc/openvpn/client/ are...\n";
print color('RESET');
my $configs = `ls -all /etc/openvpn/client/`;
print"$configs";
exit 0;
7 changes: 7 additions & 0 deletions share-client-config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;

my $clents = `cp -avr /etc/openvpn/client/* /var/www/html/`;
print "$client"