Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
blocklist-with-ipset
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
virus2500
blocklist-with-ipset
Commits
37839e81
Commit
37839e81
authored
10 years ago
by
virus2500
Browse files
Options
Downloads
Patches
Plain Diff
Path to Black and Whitelist is now set automatically
parent
681594c5
No related branches found
Branches containing commit
Tags
v1.0.0
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+5
-16
5 additions, 16 deletions
README.md
blocklist.pl
+3
-2
3 additions, 2 deletions
blocklist.pl
with
8 additions
and
18 deletions
README.md
+
5
−
16
View file @
37839e81
...
...
@@ -6,6 +6,8 @@ Create an ipset based blocklist from an text file (downloaded from e.g. blocklis
Changes
--------
V1.0.4: Path to white and blacklist is now set automatically
V1.0.3: Now you can set multiple blocklist sources
V1.0.2: Added a whitelist and blacklist
...
...
@@ -15,25 +17,12 @@ V1.0.2: Added a whitelist and blacklist
You will need to install ipset!
Also you will have to specify where your binarys are located. This settings can be made in blocklist.pl .
If you want to run the script as an cronjob you will have to specify the absolute path to the whitelist.txt and blacklist.txt in blocklist.pl
my $whiteList = "whitelist.txt";
my $blackList = "blacklist.txt";
to e.g.
my $whiteList = "/scripts/blocklist/whitelist.txt";
my $blackList = "/scripts/blocklist/blacklist.txt"
where /scripts/blocklist/ is the path to the white and blacklist file!
(You can find out where your binarys are with "which" e.g. "which iptables")
While in blocklist.pl please also specify and verify where your binarys are located.
(
These
can be found via "which" e.g. "which iptables")
These
values need to verified for your system:
my $iptables = "/sbin/iptables";
...
...
This diff is collapsed.
Click to expand it.
blocklist.pl
+
3
−
2
View file @
37839e81
#!/usr/bin/perl
use
strict
;
use
warnings
;
use
FindBin
'
$Bin
';
################################################################
###### Script to check Blocklist.de list. Block new IP ######
###### and unblock deleted entrys ######
...
...
@@ -10,8 +11,8 @@ use warnings;
my
@listUrl
=
("
http://lists.blocklist.de/lists/all.txt
",
"
http://www.infiltrated.net/blacklisted
");
my
$tmpDir
=
"
/tmp
";
my
$logFile
=
"
/var/log/blocklist
";
my
$whiteList
=
"
whitelist.txt
";
my
$blackList
=
"
blacklist.txt
";
my
$whiteList
=
"
$Bin
/
whitelist.txt
";
my
$blackList
=
"
$Bin
/
blacklist.txt
";
## binarys ##
my
$iptables
=
"
/sbin/iptables
";
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment