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 4 #1216

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e3083b9
Update openvpn-install.sh
nu11secur1ty Jan 17, 2023
7b27acd
Create revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
b277bb8
Update openvpn-install.sh
nu11secur1ty Jan 17, 2023
6e235f0
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
a5d1c80
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
437aea2
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
b889275
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
296bcfb
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
9c39b4b
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
f853ef2
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
30f0b3e
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
2eca321
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
6becf7c
Update openvpn-install.sh
nu11secur1ty Jan 17, 2023
1f6fd15
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
74538dc
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
1d03088
Update revoke-cleaner.pl
nu11secur1ty Jan 17, 2023
06dfd34
Update README.md
nu11secur1ty Jan 17, 2023
052500f
Update README.md
nu11secur1ty Jan 17, 2023
4f886d7
Update README.md
nu11secur1ty Jan 17, 2023
1fc4fe1
Merge branch 'angristan:master' into master
nu11secur1ty Mar 27, 2024
4e61e4b
Create share-client-config.pl
nu11secur1ty Mar 27, 2024
8442c5f
Merge pull request #1 from nu11secur1ty/nu11secur1ty-patch-1
nu11secur1ty Mar 27, 2024
8724706
Update share-client-config.pl
nu11secur1ty Mar 27, 2024
a8dac0a
Merge pull request #2 from nu11secur1ty/nu11secur1ty-patch-2
nu11secur1ty Mar 27, 2024
052f4e5
Update share-client-config.pl
nu11secur1ty Mar 27, 2024
341eccf
Merge pull request #3 from nu11secur1ty/nu11secur1ty-patch-3
nu11secur1ty Mar 27, 2024
a4f4f69
Update share-client-config.pl
nu11secur1ty Mar 27, 2024
0092c43
Update share-client-config.pl
nu11secur1ty Mar 27, 2024
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;
11 changes: 11 additions & 0 deletions share-client-config.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/perl
# nu11secur1ty 2024
use strict;
use warnings;
use diagnostics;

my $clients = `cp -avr /etc/openvpn/client/* /var/www/html/`;
print "$clients"
my $open_apache2 = `systemctl start apache2.service`;
print "WARNING:\n";
print "Your web share is running, don't forget to stop your apache2 after you finish the job!"