From 7b27acd69b0753eaeb1e663be83cbea29fd84c82 Mon Sep 17 00:00:00 2001 From: nu11secur1ty Date: Tue, 17 Jan 2023 12:53:20 +0200 Subject: [PATCH] Create revoke-cleaner.pl --- revoke-cleaner.pl | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 revoke-cleaner.pl diff --git a/revoke-cleaner.pl b/revoke-cleaner.pl new file mode 100644 index 0000000..a7eede0 --- /dev/null +++ b/revoke-cleaner.pl @@ -0,0 +1,35 @@ +#!/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\n\n"; +print color('RESET'); + +my $ENV = `cat /etc/openvpn/easy-rsa/pki/index.txt | grep R`; +print "$ENV"; + +## Cleaning +my $ENVPKI = "/etc/openvpn/easy-rsa/pki/index.txt"; +print "Preparing for cleaning...\n"; +print "Please, choose the username...\n"; + +chomp (my $username = ); +my $cleaner = `sed -i '/$username/d' $ENVPKI`; + + exit 0;