Reporting security attacks?
Can these be blocked at the router?
Thanks,
Nancy
10 Replies
- Les
If you're suing a firewall like iptables you can block specific IP's (or ranges of IP's) yourself.
MSJ
sigh
- Les
Those are about the only ports I have open.
I have fail2ban running, so I'm constantly seeing new stuff getting banned. I have to leave some holes open for our clients, but I think I'm going to just hunker down and deny everything to everyone except a dozen or so addresses.
This is what had me asking about blocking at the router:
Connection attempts using mod_proxy:
111-241-41-23.dynamic.hinet.net -> mx2.mail2000.com.tw:25: 1 Time(s)
111-241-43-153.dynamic.hinet.net -> mta7.am0.yahoodns.net:25: 1 Time(s)
111-241-43-92.dynamic.hinet.net -> mx3.mail2000.com.tw:25: 1 Time(s)
111-241-45-208.dynamic.hinet.net -> mx2.mail2000.com.tw:25: 1 Time(s)
111-241-47-101.dynamic.hinet.net -> mx2.mail2000.com.tw:25: 1 Time(s)
61-228-17-81.dynamic.hinet.net -> mx2.mail2000.com.tw:25: 1 Time(s)
61-228-95-243.dynamic.hinet.net -> mx0.mail2000.com.tw:25: 1 Time(s)
One of my clients get 20k - 30k unauthorized login attempts per week (with all sorts of ridiculous user names). It is annoying, and it always makes me wonder if my passwords are secure enough, but in the end they are just unsophisticated attacks that were eating up my time trying to stop each IP address. I just make sure I use very strong passwords and change them regularly.
While fail2ban is not bullet proof, it is an extra layer of security. You can't stop them from trying - they are the mosquitoes of the internet.
Whitelisting will work for some protocols, but you can't really whitelist access to port 25 or 80.
Of course brute force attempts are just part of life on the Internet, particularly from China. The great firewall only goes in one direction, LOL.
Move SSH off port 22 and close the port; that will help. A lot of bots will try 22 and if they get nothing they'll just move on. As for modproxy, are you actually running modproxy? Once someone figures out you are running a proxy (assuming it was ever unsecured, even for a short time) you get on some lists that get passed around and people will try using your box for a long time. Nothing you can really do about it. If it's secured, your firewall should block them after some failed attempts to access it.
If you need to run a proxy, can you switch to SSH-based proxying? You could set up SSH with keypair auth on a non-standard port and a SOCKS proxy through PuTTY, etc.
We've got a lot of clients using SFTP to us, so moving the SSH port would be a bit of a pain, but that's not a bad idea.
I guess I'm being overly sensitive when I see 139 different blocked IP's in 24 hours in my ufw.log.
I'd like to do a scan of my host from an unallowed host, just to see what is open still. Does anyone have any suggestions for that? I know there web sites with scanners, but they're hard to use with a headless host.
When I want to test an unauthorized machine I tether my laptop to my phone and connect that way.
The blocks are not persistent across reboots, but I use another script to save blocks that are then reloaded on reboot.
I do use a non-standard SSH port simply to make it easier to track who is having problems connecting and reduce the script kiddie noise.
#!/bin/bash
# tempblock IPADDDRESS Comment
# tempblock IPADDRESSS/CIDR Comment
LOGFILE='/var/log/tempdrop.log'
DATE=`date +"%Y-%m-%d %H:%M:%S"`
# Did we get a value?
if [ $# -eq 0 ]
then
echo "$0 : Need To Provide IP or IP/CIDR to add temp drop"
exit 1
fi
echo
echo "Temp Drop IP Block [$1] - $2"
echo "Adds temp drop for IP at the top of the chain"
echo "--------------------------------------------------------------"
echo CMD: iptables -I INPUT -s $1 -j DROP
/sbin/iptables -I INPUT -s $1 -j DROP
echo "$DATE DROP [$1] - $2" >> $LOGFILE
## End
Example: tempdrop 111.241.0.0/16 "TW Fake email Attempts"