Add readdir of /spider/local_host/badip.* files.
Add a default /spider/data/baddx.issue file.
Move PC[61]1 baddx check after the IP address check code.
Add baddx callsign check to RBN
+10Jan23=======================================================================
+1. Add baddx on incoming callsign in RBN.
+2. Search for all /spider/local_data/badip.* files to allow more control on
+ which IP addresses are detected. e.g. badip.torexit, badip.torrelay as well
+ as baddx.local. The suffixes, apart from .local (created by set/badip) are
+ completely arbitrary. You can use whichever suffix name you like. This is
+ a more useful arrangement for the ever increasing sources of "bad ip
+ addresses" that we need to deter.
+
+ NOTE: all badip.<suffix> are read only EXCEPT badip.local (which can be
+ altered in real time by the sysop using set/badip <ip address> ...).
+ If one uses periodic crontab jobs to update any other badip.<suffix>
+ files from web resources then don't forget to 'load/badip' afterwards.
+3. Add a /spider/data/baddx.issue file which can be copied to (or used as a
+ basis to create) /spider/local_data/baddx
09Jan23=======================================================================
1. Finish implemention of DXCIDR ip address filtering. This works on both
logins (treated the same as locked out - i.e. just disconnected) and also
with PC61s where these sentences are just dropped. Also attempt to prevent
any *following* PC11s with the same data getting through.
+
+ YOU WILL NEED either 'cpanm Net::CIDR::Lite' or debian/ubuntu based distros
+ 'apt install libnet-cidr-lite-perl'. RedHat based systems will have similar
+ packages available.
+
2. Recognise PC18s coming from CC Clusters more nicely.
04Jan23=======================================================================
1. Fillout DXCIDR, attach checks in PC61 and logins. Login that fail will
--- /dev/null
+bless( {
+ ID10T => 1673336995,
+ name => 'baddx',
+ SALE => 1471525525,
+ F0OL => 1673336913,
+ PIRATE => 1471525604,
+ WANTED => 1471525604,
+ TEST => 1471525604,
+ EY0RE => 1673336913,
+ FO0L => 1673336913,
+ F0SALE => 1673337052,
+ N1L => 1673337039,
+ R0BOT => 1673336913,
+ FORSALE => 1471525525,
+ CUNT => 1672857612,
+ L1D => 1673336913,
+ ID1OT => 1168880653,
+ FROG => 1471525525,
+ WH0RE => 1673336913,
+ NOCALL => 1471525604,
+ TR0LL => 1673336913,
+ P1RATE => 1471525604,
+ NIL => 1471525604,
+ FERRARI => 1471525604,
+ DXTEST => 1471525604
+}, 'DXHash' )
{
new();
- my $count = _load('base');
- $count += _load('local');
-
- LogDbg('DXProt', "DXCIDR::reload $count ip addresses found (IPV4: $count4 IPV6: $count6)" );
+ my $count = 0;
+ my $files = 0;
+
+ LogDbg('DXProt', "DXCIDR::reload reload database" );
+
+ my $dir;
+ opendir($dir, $main::local_data);
+ while (my $fn = readdir $dir) {
+ next unless my ($suffix) = $fn =~ /^badip\.(\w+)$/;
+ my $c = _load($suffix);
+ LogDbg('DXProt', "DXCIDR::reload: $fn read containing $c ip addresses" );
+ $count += $c;
+ $files++;
+ }
+ closedir $dir;
+
+ LogDbg('DXProt', "DXCIDR::reload $count ip addresses found (IPV4: $count4 IPV6: $count6) in $files badip files" );
return $count;
}
return;
}
- # if this is a 'bad spotter' user then ignore it
+
my $nossid = $from;
$nossid =~ s/-\d+$//;
if ($badspotter->in($nossid)) {
return;
}
- # if this is a 'bad spotter' or an unknown user then ignore it. BUT if it's got an IP address then allow it through
- my $nossid = $pc->[6];
- $nossid =~ s/-\d+$//;
- if ($badspotter->in($nossid)) {
- dbg($line) if isdbg('nologchan');
- dbg("PCPROT: Bad Spotter $pc->[6], dropped");
- return;
- }
-
-
# convert the date to a unix date
my $d = cltounix($pc->[3], $pc->[4]);
# bang out (and don't pass on) if date is invalid or the spot is too old (or too young)
return;
}
+ my $nossid = $pc->[6];
+ $nossid =~ s/-\d+$//;
my @spot = Spot::prepare($pc->[1], $pc->[2], $d, $pc->[5], $nossid, $pc->[7], $pc->[8]);
}
}
+ # is this is a 'bad spotter' or an unknown user then ignore it.
+ if ($badspotter->in($nossid)) {
+ dbg($line) if isdbg('nologchan');
+ dbg("PCPROT: Bad Spotter $pc->[6], dropped");
+ return;
+ }
+
# global spot filtering on INPUT
if ($self->{inspotsfilter}) {
my ($filter, $hops) = $self->{inspotsfilter}->it(@spot);
}
}
+
# this is where we decide to delay PC11s in the hope that a PC61 will be along soon.
my $key = join '|', @spot[0..2,4,7]; # not including text
return;
}
+ # is it 'baddx'
+ if ($DXProt::baddx->in($call)) {
+ dbg("RBN: Bad DX spot '$call', ignored");
+ dbg($line) if isdbg('nologchan');
+ return;
+ }
+
+
# remove all extraneous crap from the origin - just leave the base callsign
my $norigin = basecall($origin);
unless ($norigin) {