Pentru cine nu are perl instalat, este foarte simplu de instalat
si sa adaugati urmatoarele linii
Acum trebuie sa creem fisierul "security" si sa setam permisiunile 644, asa ca ne ajutam de urmatoarele comenzi.
We're sorry, but you can't change this data. This is just a demo, so we've turned off the option to edit it. We did this to make sure everyone can check out the theme without any problems.
Please note that this message is not part of the Shufytheme Theme. If you have any questions, we welcome you to contact us
This loading screen is visible only on our demo, you will not see it on your website.
cd /usr/ports/lang/perl5.16 && make install clean
perl -v
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""
block in all
pass in quick on lo0
pass out quick on lo0
table <block> persist file "/var/db/[i]security[/i]"
block quick from <bloqueo>
pass in quick on sis0 proto tcp from any to any port 22 keep state
pass in quick on sis0 proto tcp from any to any port 80 keep state
pass in quick on sis0 proto tcp from any to any port 3690 keep state
pass out all keep state
touch /var/db/security
chmod 644 /var/db/security
#!/usr/bin/perl
use strict;
my @assholes = ();
open (IN, "/var/log/auth.log");
while (<IN>) {
if ($_ =~ /Invalid user.*from ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/) {
push(@assholes, $1);
}
if ($_ =~ /Did not receive identification string from ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/) {
push(@assholes, $1);
}
}
close (IN);
@assholes = sort {lc($a) cmp lc($b)} @assholes;
my @allowedIPs = ();
open (IN, "/var/db/allowed-ips");
while (<IN>) {
if ($_ =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/) {
push(@allowedIPs, $_);
}
}
close (IN);
chop(@allowedIPs);
my $tmp = "";
foreach my $asshole (@assholes) {
if ($asshole eq $tmp) {
$asshole = "";
} else {
if ($asshole =~ /127\.0\.0\.1/) {
$asshole = "";
}
if ($asshole =~ /192\.168\.[0-9]+\.[0-9]+/) {
$asshole = "";
}
foreach my $allowedIP (@allowedIPs) {
if ($asshole =~ /$allowedIP/) {
$asshole = "";
}
}
$tmp = $asshole;
}
}
@assholes = sort {lc($b) cmp lc($a)} @assholes;
my $popCount = 0;
foreach my $asshole (reverse @assholes) {
if ($asshole eq "") {
$popCount++;
}
}
for (my $i = 0; $i < $popCount; $i++) {
pop (@assholes);
}
my $list = "";
foreach my $asshole (@assholes) {
$list = $list . $asshole . " ";
}
exec "/sbin/pfctl -t bloqueo -T add $list";
chmod 751 security.pl
auth.info;authpriv.infoo
0 کاربر این را مفید یافتند (0 نظرات)
پربازدید ترین
Gazduire web securizată cu support 24/7 pentru site. Toate planurile gazduire website includ sistemul pentru clonare, stocare 100% SSD, certificat SSL.
We use cookies to learn where you struggle when you're navigating our website and them for your future visit, learn more about cookies in our terms of use