this post was submitted on 12 Oct 2023
75 points (98.7% liked)

Linux

56064 readers
695 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

From The Hacker News

top 16 comments
sorted by: hot top controversial new old
[–] palordrolap@kbin.social 21 points 2 years ago (2 children)

Surprised this isn't a better known / prevented vector. I remember experimenting with variant IPs like this in IE6 over 20 years ago.

Checking now with Firefox and it auto-translates on the line below as I type one in. (Tried both 0x7f000001 and 2130706433 because they're both variants of 127.0.0.1, and if there's something bad running on that address you have other problems.)

Irrelevant nerd fact: 2130706433 is a prime number.

[–] puttputt@beehaw.org 3 points 2 years ago* (last edited 2 years ago) (1 children)
[–] tal@lemmy.today 6 points 2 years ago* (last edited 2 years ago) (1 children)

I just plugged factor(2130706433); into Maxima and it says that it has no factors. Pretty sure that it's prime.

[–] puttputt@beehaw.org 8 points 2 years ago

Sorry, i said it was a mersenne prime, then realized it wasnt, so edited it and deleted it. It was a mess

[–] Shdwdrgn@mander.xyz 14 points 2 years ago (1 children)

Does anyone know of a linux tool that can immediately ban an IP address if they try to log in to ssh with specific user names? I see a ton of attempts in my logs for names like fax, mysql, admin, and of course root. Fail2ban only works if the same IP makes repeated attempts but I'm betting if I could generate a list from these failed attempts it would probably correlate with standard blocklists of compromised hosts. For that matter, is there a way to use an RBL to limit addresses that ssh will even accept? Of course none of these attempts have a chance of logging in, but it would still be nice to further limit my exposure for any future attacks.

[–] stardreamer@lemmy.blahaj.zone 10 points 2 years ago* (last edited 2 years ago) (1 children)

Sounds like a job for crowdsec. Basically fail2ban on steroids. They already have a ban scenario for attempts to exploit web application CVEs. While the default ssh scenario does not ban specific usernames, I'm pretty sure writing a custom one would be trivial (writing a custom parser+scenario for ghost cvs from no knowledge to fully deployed took me just one afternoon)

Another thing I like about crowdsec is the crowd sourced ban IPs. It's super nice you can preemptively ban IPs that are port-scanning/probing other people's servers.

It's also MIT licensed and uses less ram than fail2ban.

[–] Shdwdrgn@mander.xyz 1 points 2 years ago (1 children)

Hmm I keep hearing about it but haven't looked into it. One thing I have set up between my systems if they share the blocked IPs with each other so every server drops a blocked address at the same time... I assume crowdsec has something similar for local sharing so I don't have to wait for a blocked IP to be sent to them, added to the database, and sent back to my local machines again?

[–] stardreamer@lemmy.blahaj.zone 2 points 2 years ago* (last edited 2 years ago) (1 children)

One way to do this would be set up crowdsec bouncers on each server but only run a single instance of the crowdsec daemon. Send all logs to the daemon and let it communicate with all the bouncers.

[–] Shdwdrgn@mander.xyz 1 points 2 years ago

Cool, thanks for the tip!

[–] nul9o9@lemmy.world 13 points 2 years ago (4 children)

Interesting, I didn't know IPv4 addresses converted to hex could be used for anything.

[–] giacomo@lemm.ee 21 points 2 years ago

It's all 1s and 0s at the end of the day

[–] tony@lemmy.hoyle.me.uk 6 points 2 years ago

You can use a decimal number as well. It's rare to see that form of URL though.

[–] PowerCrazy@lemmy.ml 4 points 2 years ago* (last edited 2 years ago)

Dotted Decimal is just a human convention. IPs are just 32 bit numbers meaning binary digit, and octal, dotted decimal and Hex are all valid representations of that same number. Subnet masks work via binary math.

Almost every single thing you would use an IP address for, you can substitute dotted decimal for octal or hex representations.

[–] bfg9k@lemmy.world 1 points 2 years ago

We have PABXes that use VxWorks and it uses hex IPs to identify each ethernet port

Might be easier to use with lower-level stuff like pure C?

[–] Jan_x41v1@feddit.de 1 points 2 years ago

I use a ssh server on my notebook to sync files. is having public key authentification enough to mitigate this attack? are only ssh servers attacked which use password auth. ?