Odd Network Question

Home » CentOS » Odd Network Question
CentOS 22 Comments

I know this is OT, but I’m not sure where else to ask. I can hope for fogiveness! :)

My home router sends its logs to the rsyslog on my desktop system, and from there I can learn all kinds of interesting (or disturbing) things. I’ve written a really horrid shellscript (about 20 things piped together with a temp file in the middle) to give me the count of DROP events for specific incoming ports. (The “Description” field is lifted verbatim from
/etc/services.)

Count Port Description
—– —- ———

22 thoughts on - Odd Network Question

  • reveals that of all the source addresses trying to poke at 48825,

    distributed botnets…. its all noise.

  • One of the nice things about IPv6, is that the address space is so vast and sparse, that it isn’t feasible to scan it in the way IPv4 gets scanned, so if we ever get round to moving to IPv6 this sort of stuff will go away.

  • The raw internet is a very noisy, nasty place. That’s why we have firewalls! FYI, telnet (as you realise) is old, but the old machines that are still running it are eminently and easily hackable – it may be your IP has got on a list of old SGI boxes. 8080 probes are looking for open web proxies, 5060 is looking for open voip systems and so on.

    As you say 48825 is not a known port and too low to be a dynamic port. I suspect it’s a command/control port for a botnet – they aren’t particular renowned for their elegance and subtlety and so it might be that your IP address (if it’s a DSL line) in the past had been compromised and was running a bot controller and all the bot workers on hacked machines are trying to contact their controller to find out what to do. Certainly all the monitoring sites I’ve looked at see almost zero traffic on that port (zero = less than 10 packets a day).

    Just be thankful that you have a working firewall in place!

    P.

  • Nope, I’ve never had a DSL line. was dialup to a local ISP for some years until a cable company that would provide what I wanted (instead of insisting on selling me what I didn’t want) ran fiber down the street, and was willing to sell me a static IP address. right now my memory fails me as to exactly when that was, but it may have been as much as 20 years ago, certainly at least 15. so I’ve had that address for long enough that there shouldn’t be any botnets thinking that I am one of its command/control servers.

    but the amount of attempted traffic on that port certainly does seem like it could be a botnet banging on me.

    Amen!

  • Fred Smith wrote:

    You want a perfectly silly… and perfectly believable thought? I’ve seen attempts against our outward-facing servers these last 10 years… and I’ve seen enough where the idiot script kiddies were so stupid that they couldn’t manage to read the directions enough to at least salt the autogenerated name. The result was “user@” or a blank where there should be a name.

    So, I’m wondering if someone botnet got screwed up… and it’s going to the *wrong* address for its command and control. If so, sorry it’s hitting you, but thank you for taking a hundred thousand or so for all of us.

    mark

  • One thing that you could try is to port forward that port to an actual listening port (think like running nc/netcat in listening mode). That way it will complete the TCP handshake and you can see what commands (if any) it sends, might be useful to record it with tcpdump / wireshark.

  • and I didn’t even mention the huge number of failed attempts on port
    25. /var/log/maillog is full of systems trying to send spam, or trying to DOS me with incompleted connection attempts, or just plain spamming with mail for addresses not at this system. The little light on the network switch serving this machine hardly ever stops blinking with all the traffic hitting it.

    One thing I don’t understand is how/why the firewall is DROPping so many attempts on port 25 when it in fact has a port forward rule sending port 25 on to my mailserver. How does it know, or why does it think that some of them can be dropped at the outer barrier?

    Hey, its the least I can do for all the good guys out there! :)
    But that doesn’t mean the same dratsabs aren’t hitting all the rest of you too.

    Fred

  • Some spamming tools are just telnet with an expect script, lightweight and can be loaded onto embedded systems, e.g. other firewalls / modems etc…

    A downside of using these tools is that telnet sets the PUSH TCP flag, so many firewalls (e.g. Cisco ASA) have protocol inspection for SMTP and signals the connection as invalid. if it uses the PUSH TCP flag, which a proper SMTP daemon wouldn’t use for that protocol (PUSH flags ask the server to service the sent data, even if it hasn’t finished with a CR/LF)

  • Fred Smith wrote:

    I’m sure they are. Are you running fail2ban?

    And you do know that the last time someone, as a test, might have been last year, put an open PC on the ‘Net, it was 20 min before it was compromised?

    mark

  • Several years back I switched from sendmail to postfix. Not knowing what I was doing, I think I have it set to say it will forward email following SASL authentication. But as I had no intention of forwarding anything, I did not set up any authentication methods. So anyone who tries fails to authenticate.

    With fail2ban in place I get 200-500 daily SASL “fail to authenticate” instances. In contrast, several months ago fail2ban either died or did not restart correctly. This went unnoticed for about a week. During that time I got
    10000-32000 daily “failed to authenticate”.

    Jon

  • I’m not using fail2ban, and am using sendmail (why? because I’ve spent years slowly accumulating options in my .mc file that kill off unwanted connections and other hate-the-spammer options.). I’m not getting such emails but most of the entries in /var/log/mail are due to such events. every now and then a legitimate email can be seen passing through.

    Oh, I also am now using (as of 2-3 years ago) milter-greylist, which made an enormous contribution to preventing spam emails.

    Fred

  • I tried greylisting a while back and was surprised how many were being rejected. But they were also getting through despite the rejection at my end.

    I use a 3rd party as my backup MX email address. If I’m down, they save up the email and forward it to me when I’m back up. But the greylist rejected emails just tried the backup MX
    address and got through that way.

    Should I ever have a backup MX that I administer, I will definitely reinstate greylisting.

    Jon

  • If you have a stable environment and connections, you could also get rid of the backup MX completely. That’s what we did and we’re not alone. Of course if you have frequent service interruptions for whatever reason, that’s not an option.

    Regards, Simon

  • I’ve been using fail2ban for some time, I have a number of ports open to the Internet – SSH, SMTP, IMAPS, HTTP and HTTPS on my external subnet.

    This thread made me look at how fail2ban was doing, and I noticed that it wasn’t particularly working too well for SSH, as I have turned off password authentication, so I edited the filters a little, and found it started filtering some more IPs. I found on my firewall that there were something like 500 active connection states to SSH – it looked like a scanning tool was just hanging and sending many connections, the same thing for about three remote IPs – I put a manual block on these at the firewall.

    The firewall has a block feature, which allows me to enter URLs which point to lists of IPs (Blocklists) and block traffic from those IPs at the firewall.

    It’s designed to use these types of IP feeds: http://iplists.firehol.org/

    Well, there’s nothing stopping me running a cron-job on my CentOS boxes to do the following:

    iptables -L -n | awk ‘$1==”REJECT” && $4!=”0.0.0.0/0″ {print $4}’ >
    /tmp/banned

    I can then transfer the banned file to a web-server and block the bad IP
    addresses completely from my network. I like this as if a system is brute-forcing my SSH server, I can now block it from all resources on the network, and stop the attempts even reaching the internal hosts.

  • I’ve found the default 10min bans hardly bother some attackers. So I’ve added the “recidive” feature of fail2ban. After the second 10min ban, the attacker is blocked for 1 week.

    jon

  • ban for a whole week regardless, yes, I realise that a typo might  set it off for a actual user, but I have other methods of entry to unban if that happens, and we have a number of whitelisted IPs that cover most things like that for most use cases, and a VPN within the whitelist that can be used if the public services get locked out.

  • Oh definitely. My systems are set to “3 bans and you’re out” – a recidive ban is permanent after three other bans. I have large parts of some subnets in my ban list as attackers just move from one host to another as they get banned.

    P.

  • I worked for a company some time back that had an association with a South African company who wanted to host some infrastructure in our data centre, the network admin there wanted a specific configuration for outbound source NAT from a certain host that would scroll through a list of source NAT IP addresses (think a whole /24) for every connection attempt, pretty sure it was for sending unsolicited emails, in any case the association with that company didn’t last and I took redundancy after less than a year there.

  • Well, yes – I had a conversation with the guy, and he always had an answer, “oh if that happens I can do this”, he said that with real pride
    – a real slippery lizard in my opinion and at the back of my head was,
    “maybe the people you’re sending emails to just don’t want to receive them! And that’s why you’re jumping through these countless hoops, if you actually had proper opt-in, with a working opt-out per default you might not need this awful hack”, there are companies out there specifically selling IP addresses with good reputations to companies who ruin that IP range’s reputation, once they reputation has been ruined I
    guess they get discarded, sold on to another company who only then finds out that they can’t run a mail server on that range because its been added to every blocklist on the planet.