You are viewing a single thread.
View all comments
38 points
*

I have a small PC I use for exposing a private PC to the wider web via nginx proxy. It had two accounts on it: mine, and one I called “remote” with some basic password I set up to forward the proxy connection.

One day, this machine started making 100% CPU noises, for several hours. Wtf? I check the processes and a Tor node had been setup and was transmitting gigabytes to some Russian IP.

My brain goes into panic mode, I kill the process, wipe the remote user, and eventually pull the Ethernet plug.

I wish I hadn’t wiped the user directory as I wanted to know what was being sent and where. Nonetheless the logs showed that several Russian IPs had been attempting an SSH brute force for literally months and one finally guessed “remote” and weak password I set for it.

I have decades of experience on Unix system, and I cringe having made such a rookie mistake.

Lesson learned: change the default SSH port to a transient port, have one dedicated SSH user with a non-standard username, and use auth-key entry only.

I still wonder what was being sent over that Tor node, and why it required all the CPU cores. My best guess is crypto mining, or it was used for a DDOS attack net somewhere.

permalink
report
reply
11 points

Obfuscation is not security, changing the port doesn’t increase your security

permalink
report
parent
reply
15 points

I see this claim all the time, and it bugs me every time. Obfuscation is a perfectly reasonable part of a defense in depth solution. That’s why you configure your error messages on production systems to give very generic error messages instead of the dev-centric messages with stack traces on lower environments, for example.

The problem comes when obscurity is your only defense. It’s not a full remediation on its own, but it has a part in defense in depth.

permalink
report
parent
reply
7 points

Changing the port isn’t really much obfuscation though. It doesn’t take long to scan all ports for the entire IPv4 range (see masscan)

permalink
report
parent
reply
2 points

Technically a password is obfuscation anyway

permalink
report
parent
reply
12 points

I hear you, but I disagree:

It buys you enough time to check the journals and see that a group of IPs have attempted various ports giving you enough time to block the IP altogether.

It also buys you disinterest from the malicious host, since probably there’s a hard limit on how many ports they will test, and they will flag your machine as “too much work” and try another.

Again, I agree with you that obfuscation is not security, but it sure does help.

permalink
report
parent
reply
5 points

From what I understand you obfuscate the port in order to limit the amount of incoming attacks. But then fail2ban would be a much more effective tool.

The disinterested aspect you described is the actual problem. Because it’s based on the assumption your port won’t be found, but it definitely will, and as soon as that happens you’ll end up in a database such as shodan and the entire effect is GONE.

permalink
report
parent
reply
6 points

I figure you’d know about it by now, but fail2ban would really help.

permalink
report
parent
reply
3 points

What do you think they were transmitting?

permalink
report
parent
reply
3 points

I think they were either computing crypto-hashes and passing on the results back home (via Tor), or they were using my machine to send out several ping/fetch requests over Tor to DDOS some unknown target machine.

permalink
report
parent
reply
2 points

So can this pretty much always be shut down by having sufficiently complex + long pw?

permalink
report
parent
reply

Asklemmy

!asklemmy@lemmy.ml

Create post

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it’s welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

Icon by @Double_A@discuss.tchncs.de

Community stats

  • 10K

    Monthly active users

  • 5.9K

    Posts

  • 319K

    Comments