I can tell you that you are not alone .... occasionally I see it in some of my bots, too.KhashayaR wrote:Hello Everyone
I wonder if anyone can help me with this, my eggdrop logs indication someone or a robot keep sending telnet request please see below, is there any way I can avoid this? what they are trying to achieve by doing this? any article you can read and get more knowledge about this?
appreciate your help and suggestions
That's probably even better.KhashayaR wrote:Willyw, ... I used to add them to iptables via SSH
...
Tracking? It's all in the bot's log, isn't it?However, it’s a very difficult to keep tracking each ip address since I believe its they are all proxies, do you think such an action can harm the eggdrop?
Code: Select all
ipset create eggdrop hash:net
iptables -I INPUT -m set --match-set eggdrop src -j DROP
Code: Select all
ipset add eggdrop <ip>
Code: Select all
#!/usr/bin/perl
use strict;
use warnings;
my $setup = {
file => 'blacklist.txt',
filter => 'blacklist',
url => 'https://lists.blocklist.de/lists/ssh.txt',
};
system(`wget -qO- $setup->{url} > $setup->{file}`);
my $file = $setup->{file};
open my $data, $file or die "Could not open $file: $!";
system(`ipset flush $setup->{filter}`);
my $count = 0;
my $total = 0;
while (my $ip = <$data>) {
if ($ip =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) {
`ipset add $setup->{filter} $ip`;
$count = $count + 1;
}
$total = $total + 1;
}
close $data;
print "Filtered: $count/$total\n";
Code: Select all
ipset create blacklist hash:net
iptables -I INPUT -m set --match-set blacklist src -j DROP
Code: Select all
Filtered: 9012/9012
Code: Select all
ipset create blacklist hash:net
iptables -I INPUT -m set --match-set blacklist src -j DROP
Code: Select all
apt install ipset
Code: Select all
ipset create blacklist hash:net
iptables -I INPUT -m set --match-set blacklist src -j DROP