News for hackers. Stuff that matters.
Re:Who's Attacking My Server? by fuzzy2 on Sunday March 13, 2022 @01:51PM (#30663828)
I just ban China entirely from accessing my server. There's nothing on it a Chinese person could be interested in, just personal stuff and a private forum. Doing so has tremendously reduced the overall (remaining) abuse traffic volume.

It's quite easy and efficient to do this using IPSet. IP ranges associated with China are available on the net.

Re:Who's Attacking My Server? by chockchocschoir on Sunday March 13, 2022 @02:02PM (#30663982)
Before going about a blocking potential people who are in fact interested in your content/service (which you can't know if they are or not based on the country), did you do the bare minimum to secure your server against attackers from any other location, namely changed from the default password and disabled password login?

Your approach to security has a number of issues. First, you don't know if someone is actually interested in your thing or not based on the location. They could be visiting China, could still be able to speak English or any other reason. Secondly, the mapping of Location <> IP Address is not as guaranteed as you seem to think. Plenty of IPs get flagged as Chinese while not being in China, and vice-versa is true as well. Just because some 3rd party says a host/client is in a specific location doesn't make that true.

Edit: Seems the commentator I replied to now have added "just personal stuff and a private forum" to their comment which was not there before, so most of my point is moot now, as I assumed at least semi-public content/service, not private.

Re:Who's Attacking My Server? by michaelcampbell on Sunday March 13, 2022 @03:58PM (#30665119)
I DO run a "public" service, in that it provides some info to people. However I run it at totally my own cost, the information is for entertainment value only (and not in the "I just say that to get around this being horrible in some way"; it's literally information about gaming and games), and I just don't need the hassle of the constant hack attempts. I block China and Russia, and have for years, using publicly available IP ranges.

Yes, I know it's not going to get just China and Russia. Yes I know I'm blocking false positives. Yes I know I'm allowing false negatives.

And honestly, I couldn't care less. It's my service, my information, my time, and my money, and I don't feel the least bit bad nor swayed by some appeal to morality or fairness.

> Your approach to security has a number of issues.

Your examples are a bit of non-sequitur. If I OVERBAN, I'm not decreasing my security. The non-(Chinese hacker) visitor in China can't get in, that's not a security issue. IP's being flagged as Chinese not being in China... can't get in also not a security issue. Vice versa is a bit of a security issue, with which the second layer of my security onion deals.

Re:Who's Attacking My Server? by Skiiing on Sunday March 13, 2022 @05:02PM (#30665662)
You typed my thoughts exactly. I run a popular website, and I just block everything from China, and do a Captcha challenge for others such as Russia. People don't have the right to access my website. If a Chinese citizen is (correctly) angry about the situation then they need to petition their government to change the culture that permits massive continuous hacking attempts from their country.

I use Cloudflare which makes blocking countries simple, no need to keep updated IP lists.

Re:Who's Attacking My Server? by grog454 on Sunday March 13, 2022 @05:46PM (#30666052)
Honest question: what impact did you see when you switched from not blocking China + Russia to blocking them? What type of attacks are you seeing primarily?

Failed login attempts / brute force attempts seem like the cost of doing business in public. I assume that if my servers are accessible from 1 or more public addresses, they WILL be subject to brute force attempts. I also assume that by making my passwords sufficiently randomized, the probability of these attacks having any effect is infinitesimal.

To me, blocking an IP because it tried to log in to your servers seems purely like a fear response with no rational basis (or at least a poor understanding of probability / stats). By extension, blocking a range of IPs because of some arbitrarily elevated frequency of login attempts seems equally silly.

Now for DOS attacks, temporary IP blocks make perfect sense.

Re:Who's Attacking My Server? by michaelcampbell on Tuesday March 15, 2022 @08:59AM (#30684676)
> Honest question: what impact did you see when you switched from not blocking China + Russia to blocking them? What type of attacks are you seeing primarily?

Thousands of brute force login attempts per day gone. The effect is, as you say, small, but it was non 0 and now it is 0, and it's a bunch of noise I don't have to wade through.

> Failed login attempts / brute force attempts seem like the cost of doing business in public.

Yup, and I pay that cost by blocking the source of 98% of them.

> purely like a fear response with no rational basis (or at least a poor understanding of probability / stats)

Thanks, clearly you know me well /s. And honestly, again, I don't feel that I even NEED a rational basis. It's my system, I'll block whomever I feel like blocking for whatever reason I want, thanks. If you want to deride me by calling into question my motives, you can do that too for whatever reason YOU want to, but that's on you.

Re:Who's Attacking My Server? by grog454 on Wednesday March 16, 2022 @03:45PM (#30703130)
> If you want to deride me by calling into question my motives, you can do that too for whatever reason YOU want to, but that's on you

You are free to act under whatever impetus you want and while I did call in to question your motives (implicitly), I never meant that as a derision. I frequently ask myself "why am I doing this?". It usually doesn't hurt to self reflect.

Edit: Something about this kept nagging me. And I think its this:

>It's my system, I'll block whomever I feel like blocking for whatever reason I want, thanks.

I see parallels to a sentiment that used to be fairly common in the U.S.:

"It's my store, I'll refuse whomever I feel like refusing for whatever reason I want, thanks"

Laws against that kind of thing are relatively new (1964?). You have a valid reason to block certain users (hacks) but do you really not see a problem extending that to national origin?

Re:Who's Attacking My Server? by mrjin on Sunday March 13, 2022 @08:59PM (#30667396)
The thing is there are so many attackers/rookies out there. I wouldn't call them hacker as they are most likely noob running scripts to scan the network. Just seconds after I exposed my server's SSH port, there were failed login attempts. I wasn't worried about someone breaking in as I've harden my server with all the patches, no password login allowed and the private key was on a YubiKey which I don't have it myself. So unless there was a 0-day I haven't patched, it's very unlikely someone else can actually gain access to it. From the logs I could see lots of failed logins using various user names/passwords most likely using a dictionary. Those nonsense soon flooded my logs and I eventually had to change the SSH port as I could not stand that any longer.

As you mentioned, simply ban couldn't help less. But anyway, their servers, their choices. I've no comment on that.

Re:Who's Attacking My Server? by victor106 on Sunday March 13, 2022 @09:23PM (#30667527)
> It's my service, my information, my time, and my money, and I don't feel the least bit bad nor swayed by some appeal to morality or fairness.

Nailed it!!! I feel the same

Re:Who's Attacking My Server? by mro_name on Monday March 14, 2022 @03:22AM (#30669378)
totally agree.

I can understand that limiting services is sad, but nobody has a claim either, right?

So offering to some is way better than offering to none because of overwhelming opsec work (which is still secondary to the content). If the vandals show a pattern, it's bad luck if one shows the same. And proxying should be known to those who suffer from the block.

Maybe internet has to let go the mania of offering everything to everybody all the time. Like real life.

Re:Who's Attacking My Server? by passivate on Sunday March 13, 2022 @06:28PM (#30666369)
Can you really call it a public service if its not accessible to the public? Maybe a "Americas/Europe"-only service, but then it would sound questionable...
Re:Who's Attacking My Server? by alasdair_ on Sunday March 13, 2022 @07:09PM (#30666696)
> Can you really call it a public service if its not accessible to the public? Maybe a "Americas/Europe"-only service, but then it would sound questionable...

The Seattle Public Library is a public service despite not allowing residents of Guangzhou to borrow books.

Re:Who's Attacking My Server? by passivate on Monday March 14, 2022 @12:17PM (#30674281)
That is false. They can apply for a visitor card - which has a $25 fee.

In any case, physical goods and services are not analogous to digital goods and services. Or are you redoing the the piracy-is-stealing argument??

Re:Who's Attacking My Server? by alasdair_ on Monday March 14, 2022 @03:39PM (#30677177)
I'm doing the "it's still a 'public service' even if there are location restrictions" argument, since almost anything I can think of as a typical example of a "public service" (police, fire, medical, education, access to courts, etc.) also have location restrictions and we call all of those things "public services".

If you want a special definition of "public service" that means "accessible every human on earth without any exclusions" then that's fine, but telling someone something isn't a public service because you want to use a special definition of the phrase that no one else seems to use is a bit... overly argumentative?

Re:Who's Attacking My Server? by passivate on Tuesday March 15, 2022 @01:41AM (#30682008)
Fair enough, I didn't mean to be argumentative but I accept your criticism.
Re:Who's Attacking My Server? by karamanolev on Sunday March 13, 2022 @07:59PM (#30667036)
I think the commenter wouldn't have any issue calling it an "Americas/Europe"-only service and by his (and arguably, my) logic, it doesn't sound questionable. One has to make choices.
Re:Who's Attacking My Server? by lowwave on Sunday March 13, 2022 @06:59PM (#30666618)
think it is totally fine. Most the web is build around ASCII text any way. Since he is running it on his own dime, it is totally ok to not have Chinese/Russian visitors.
Re:Who's Attacking My Server? by fuzzy2 on Sunday March 13, 2022 @02:25PM (#30664238)
Yes, the server is of course properly secured. There was something that made me do this in the past, but I don't remember. Never had any problems with it whatsoever.

I do know, because my services (except the forum) are for me exclusively. On the forum, I know everyone. None of the members live in China, have relatives in China or travel to China. If they cannot access the forum, they can contact me in another way.

Re:Who's Attacking My Server? by chockchocschoir on Sunday March 13, 2022 @02:30PM (#30664296)
Yeah, if you're running private services, then my point is moot of course, should have known :) Thanks for explaining though.
Re:Who's Attacking My Server? by criddell on Sunday March 13, 2022 @02:08PM (#30664044)
I don't think it matters if the geo-location table is correct or not. If traffic from an IP range is entirely malicious, block that IP range. If that range happens to be Chinese or from Florida it doesn't really matter, does it?
Re:Who's Attacking My Server? by nkozyra on Sunday March 13, 2022 @10:48PM (#30668031)
Most of the time these malicious attacks will come from a data center, where someone is no doubt leasing some hardware until they get shut down.

When I get any number of malicious known attack vectors, I have a process that runs a few services against the IP for geolocation and server info. If it's a known data center, its block is immediately blocked, otherwise just the IP.

For whatever reason, they tend not to get new ips easily, so shutting down the IP will usually buy a few days before they have a new instance on qualys or whatever.

Re:Who's Attacking My Server? by alam2000 on Monday March 14, 2022 @02:58AM (#30669259)
In our environment, blocking all traffics from data centers are effective to prevent malicious attacks. You can get the data center ranges from IP2Proxy database.

We need to whitelist a few important servers that we are working with to prevent lock-down of good traffics.

Re:Who's Attacking My Server? by chockchocschoir on Sunday March 13, 2022 @02:24PM (#30664230)
Correct, blocking a IP block based on that malicious traffic comes from there might be a worthwhile strategy (although I'd argue that it's less important than properly configuring your stuff anyways, getting a new IP is trivial), and also a strategy which is different than what fuzzy2 was describing, which is what I was arguing against.
Re:Who's Attacking My Server? by IncRnd on Monday March 14, 2022 @01:44AM (#30668903)
Not the GP, but every web server I've ever run has had IP addresses originating from China at the top of the frequency list for nefarious attempts to compromise the security. If someone is temporarily visiting China and wants to visit one of my websites, they can wait until they return. I've not removing my blocks on IP addresses.
Re:Who's Attacking My Server? by dylan604 on Sunday March 13, 2022 @05:27PM (#30665897)
> I assumed at least semi-public content/service, not private.

Um, they posted information on a public website. It's not private. Even if the site is owned by them, it is publicly available, of their own accord.

Re:Who's Attacking My Server? by chockchocschoir on Sunday March 13, 2022 @07:13PM (#30666725)
"personal stuff" and "private forums" is probably as private as it gets, for being something accessible on the web, and I wouldn't call those publicly available, as you'd need to pass some sort of authorization/authentication to be able to see it. Or I gravely misunderstand your comment.
Re:Who's Attacking My Server? by jotm on Sunday March 13, 2022 @03:12PM (#30664701)
That's kinda against the spirit of the Internet, well, what it should be IMO.

But I do also ban, only temporarily. I found that a lot of IPs just stop reappearing/retrying, likely because they blacklist my IP and move on.

Re:Who's Attacking My Server? by walrus01 on Sunday March 13, 2022 @04:02PM (#30665158)
this seems to presume that malicious things originating in china scanning/probing other peoples' IP ranges don't use proxies or rented VMs, or relay compromised hosts almost anywhere in the world, etc. all that banning chinese /16 or /12 size netblocks will do is cut down on the clutter in your logs, not actually accomplish anything.

getting scanned and probed by peoples' automated tools looking for vulnerabel daemon RCEs has been a log clutter issue for about 25 years or more now. it's part of the background noise of the internet. ever since the days of having your http daemon logs cluttered up with GET DEFAULT.IDA stuff and similar in 2001.

https://www.google.com/search?client=firefox-b-1-d&q=get+def...

put more effort into ensuring that public facing daemons are totally up to date and hardened against external compromise. Or better yet don't have them public facing at all, if you can admin your server via an ssh daemon that only listens on a logical vpn interface or some sort of OOB interface.

Re:Who's Attacking My Server? by holoduke on Sunday March 13, 2022 @04:16PM (#30665291)
Totally agree. Sometimes I watch my live logs of auth.log of about 100 public servers. I am probably see 10 port scans or ssh attempts per second from random machines. Nothing to worry about if machines setup correctly. More worrying are the people who try to break our public APIs. Either by letting it to crash, brute force operations etc. The security flaws are often inside the software domain layer.
Re:Who's Attacking My Server? by raegis on Sunday March 13, 2022 @10:50PM (#30668045)
Wow. I'm looking at only one of my servers and there is a root login attempt every second. I feel a little embarrassed I am surprised by this.
Re:Who's Attacking My Server? by mrjin on Sunday March 13, 2022 @09:03PM (#30667423)
IPs on the log files most likely are exit proxies if those attackers were not rookies. Simply change the SSH port only would deter 90% of those attempts per my personal experience.
Re:Who's Attacking My Server? by walrus01 on Sunday March 13, 2022 @11:46PM (#30668330)
while I'm not the greatest fan of fail2ban ever, though I do use it on some public facing servers, it also has the option for "recidivism" which means that an IP that repeatedly gets itself banned will be banned for an even longer duration, which at least cuts down on the log file clutter somewhat.
Re:Who's Attacking My Server? by mrjin on Monday March 14, 2022 @12:48AM (#30668617)
You were right about it. I'm currently not using fail2ban and I probably should start using it. Those login failures are nuisance.
Re:Who's Attacking My Server? by temp8964 on Sunday March 13, 2022 @02:06PM (#30664023)
And also legitimate Chinese visitors will use VPN to access foreign websites anyway. Because of the GreatFirewall, a Chinese person must use a VPN to reliably visit foreign websites.
Re:Who's Attacking My Server? by Topolomancer on Sunday March 13, 2022 @02:05PM (#30664013)
Not an option for me, but thanks for the suggestion. I don't want to erect a geo-fence here.
Re:Who's Attacking My Server? by dym_sh on Sunday March 13, 2022 @02:56PM (#30664551)
chinese goverment already did that for you. anyone who really needs to access you site from inside china will use vpn or tor.
Re:Who's Attacking My Server? by tartoran on Sunday March 13, 2022 @06:43PM (#30666475)
Does China really ban all outside access or they only ban some specific sources such as newspapers and info they deem dangerous to their propaganda?
Re:Who's Attacking My Server? by reaperducer on Sunday March 13, 2022 @02:48PM (#30664466)
IP ranges associated with China are available on the net.

Didn't help me all that much.

Most of the abuse and spam leveled at the servers I manage come through $5 DigitalOcean servers being used as relays.

It's the same thing that ruined voice telephony: Make the connection so cheap that it can be abused at scale.

Re:Who's Attacking My Server? by Spivak on Sunday March 13, 2022 @06:49PM (#30666536)
I mean just block VPC ranges then. They’re public, and lots of sites already do it. I would bet you don’t expect and traffic originating from rented servers.
Re:Who's Attacking My Server? by teleforce on Sunday March 13, 2022 @11:57PM (#30668379)
Please check this very interesting real-time Live Threat Map by Radware [1].

Most of these attacks are harmless and the attacks that you should be worried is the Advanced Persistent Threat (APT) types [2].

Around eight years back I've proposed a system for crowdsourcing in covertly detecting APT similar to the minefields concept being used in war and I still think it's the best way to reliably detect APT including zero-day attacks.

Few months back in HN someone proposed an open source solution for crowdsourcing firewall, IDS and IPS but cannot get the link for now on top of my head at the moment.

[1] Live Threat Map:

https://livethreatmap.radware.com/

[2] Advanced Persistent Trap:

https://en.wikipedia.org/wiki/Advanced_persistent_threat

Re:Who's Attacking My Server? by rdtsc on Sunday March 13, 2022 @11:42PM (#30668312)
I did the same thing - blocked China, then moved the SSH login to another port. It cut down some log noise which was good enough for us.
Re:Who's Attacking My Server? by qwertox on Sunday March 13, 2022 @02:13PM (#30664116)
I do the same, but my issue is with rented servers on AWS, Digital Ocean and the like. There's no way of knowing who owns a rented IP address, the WHOIS record just outputs "US", which is meaningles.

I think there's an need for forcing service providers to group IP blocks by the nationality of who rents them.

Just to be clear, this is in the context of my private servers which host my mailserver as well as my personal website which is not meant for public consumption, but which I need to be publicly available.

Re:Who's Attacking My Server? by fuzzy2 on Sunday March 13, 2022 @02:29PM (#30664284)
> I think there's an need for forcing service providers to group IP blocks by the nationality of who rents them.

But what would that accomplish? Unlike rogue ISPs in other countries, big cloud providers have abuse reporting that actually works.

Or just block all of them outright if they do not need to access your services.

Re:Who's Attacking My Server? by gkbrk on Sunday March 13, 2022 @04:14PM (#30665275)
Depends on the country the cloud provider is located in. I have had zero luck getting anything taken down by reporting to abuse emails or forms of Aliyun, for example.

I have had much better luck with US or EU based cloud providers. In particular, I remember DigitalOcean being very responsive.

Re:Who's Attacking My Server? by fuzzy2 on Sunday March 13, 2022 @04:30PM (#30665404)
Alibaba Cloud? I actually would’ve expected better from them! Never had to report anything myself, seeing how I’m probably blocking them.

I recently had contact with AWS about spam sent using SES and found the response times very quick and the replies appropriate (they’ll look into it but cannot report back, what I expected anyway). This particular spam stopped coming, but that could be a coincidence.

Re:Who's Attacking My Server? by jcynix on Sunday March 13, 2022 @02:36PM (#30664358)
> I think there's an need for forcing service providers to group IP blocks by the nationality of who rents them.

Would neither help nor work, as there's TOR and VPNs to access your servers from anywhere in the wirld.