22 ms·
Visualizing malicious IP addresses
- internetter 2y ago[flagged]
- dylan604 2y agowhat, you would prefer it used chatGPT instead? every single article posted here is pretty much an ad. some are just less subtle. whether it was paid for ad or word of mouth, it's still adverstising
- internetter 2y agoI just found the continuous reference to it distracting, as it was utterly irrelevant to the otherwise interesting article.
- deleted 2y ago[deleted]
- wsintra2022 2y agoInteresting, if it’s an issue you could try port knocking to prevent the constant attempts
- IAmGraydon 2y agoAnyone who has run an SSH server on the default port knows that you’ll get hundreds or thousands of login attempts per day. Changing the port to something less obvious and running fail2ban is enough to mitigate most of it. They’re just looking for low hanging fruit.
- PhilipRoman 2y agoChanging the default port - yeah, works wonders for reducing noise. But I don't understand why people run fail2ban. Nobody is going to be brute forcing a ssh login, all it does is add another moving part very close to a security boundary for very little gain.
- tetris11 2y agoYes they do. I had a colleague who opened up his machine to another using the logon "remote" and let them set the password. It was cracked the next day. It turns out having 12345678 is probably a bad password.
- gnabgib 2y agoHave you recently run a server? It takes a week-month before your ssh port is published on shodan/binaryedge/censys/criminalIP and other dodgy scanners.. and then you can expect constant attention, and yes.. 14691 attempted logins for every username possible (even though password login is turned off) from the same IP (usually a VPN, tor exit, or "crowdsourced VPN")
- KomoD 2y ago> Nobody is going to be brute forcing a ssh login Uh what? Yes people do...
- chx 2y agoI just run sslh...
- mcoliver 2y agoFun. You could also try putting the data into Google's data studio (now looker) to visualize them in an interactive map you can publish. Add things like size of dot corresponding to number of attempts, add reverse DNS/whois info to the info bubble, etc. Wonder how much came from residential vs business ip space. https://lookerstudio.google.com https://lookerstudio.google.com
- noah_buddy 2y agoIf he published that, people will try and make the new leaderboard.
- supriyo-biswas 2y agoWell there’s http://ipv4.games/ http://ipv4.games/
- mianos 2y agoI always wondered how the IPs like this 180.101.88.232 from this block: ISP ChinaNet Jiangsu Province Network Domain Name chinatelecom.com.cn Continue to be the source of thousands of ssh password login attempts for years and years on end. It's not a big deal, I use a tarpit on all ssh with 2FA on the one I use, but it seems ridiculous that some participants of the internet don't give a shit about the rest of the world.
- dotancohen 2y ago> I use a tarpit on all ssh I would love to hear more about your approach, if that's not sensitive. My Gmail username is the same as my HN username if you prefer. Thank you!
- mianos 2y agoI run an N100 with LXD so I have a container running one of the many ssh tar pits and point 22 and a bunch other ports to it. It simulates an ssh login that very slowly sends ssh banner lines in the connection protocol, endlessly, until they disconnect. It commonly thought that they do nothing, but they seem to keep TCP connections open for quite a long time. A assume a hand written scanning client could detect and mitigate the delay but it's going to hold open the sessions on the firewall exit on the other side. If there are enough of these maybe someone might do something. Makes me smile when I look at the logs, that's enough for me. It's been covered quite a bit here on HN.
- dotancohen 2y agoThanks. Yes, I have heard of such an approach, I did not know that it is called a tarpit. I just googled the idea and found Endlessh, I'll try it. Thank you.
- KomoD 2y agoThese tarpits have been around for a while now, do they even do anything anymore?
- dools 2y ago
- ametrau 2y ago[flagged]
- ehhthing 2y ago[flagged]
- asciii 2y ago> How is it ok that if you use the internet, you, as a low trust society member, magically get access to a wealthier high trust society full of "suckers". The internet is the greatest leveler. Don't hate the player, hate the game. If someone is a "low" trust society member and made a contribution to the entire network, we ALL benefit. Also, isolating doesn't do shit because the big tech would like to monitor you solely for themselves (i.e. Tiktok).
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- dang 2y agoYou can't post like this here, and I've banned the account. Between this, https://news.ycombinator.com/item?id=40139695 https://news.ycombinator.com/item?id=40139695, and https://news.ycombinator.com/item?id=38834901 https://news.ycombinator.com/item?id=38834901, there's clearly a pattern of abusive behavior. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- wiradikusuma 2y agoHoly moly! That explains why I frequently get captcha when using residential internet in Jakarta. I don't see those captcha when accessing from e.g. Kuala Lumpur or Singapore. Is the information in the article actionable? E.g. can I complain to someone with authority?
- Moru 2y agoNo, it's just a map of all hacked IoT devices in the world, it's not where the actual hacker is.
- unraveller 2y agoIf you're lucky enough to have a big ISP with a single big block of IP addresses that never changes you can disallow all other ranges on your VPS admin ports and only have to worry about VPNing through that ISP. I guess you could block the main country offenders but you'd have to pay an API to keep up with the IP allocations to be sure.
- abound 2y agoOr alternatively, block port 22 entirely on your firewall and use something like Tailscale to access the machine. Of course, now your attack surface includes Tailscale, which has had it's own vulns in the past, but I think blocking all public traffic ends up being much stronger than any weaknesses Tailscale may introduce.
- kimixa 2y agoIsn't that just the same thing in different clothes? Just a different protocol offering the same features of authentication and encryption - often using exactly the same primitives? Is it "Security through obscurity" assuming fewer people are attacking vpn protocols that than ssh? And I'm not sure that's even true
- walterbell 2y agoPlus a centralized identity provider, which is a plus or minus depending on your threat model, https://tailscale.com/kb/1013/sso-providers https://tailscale.com/kb/1013/sso-providers
- yau8edq12i 2y agoIntroducing obscurity to the process doesn't make it insecure. Criticism of "security through obscurity" is that security shouldn't rely on obscurity. The system should remain secure even if the attacker knows every detail of your system. Here the point of the "obscurity" (if you can call it that) is to avoid blowing up your logs and wasting compute cycles and energy on attempts that will fail anyway.
- 2y ago
- mo_42 2y agoIt's not so hard to use Tor for that. I wonder how the Tor exit nodes are distributed across the globe and see how that correlates or not.
- bauruine 2y agoI don't have exactly what you want but you would be very disappointed by the result anyway. Tor isn't as nefarious as people tend to believe. [bauruine@tp:projects/misc]$ python check_ip_tor.py /tmp/malicious_ips.txt Got a total of 6303 malicious IPs Of which 15 are Tor relays Edit: Small addendum here are the worst 5 ASNs. 1607 TENCENT-NET-AP-CN 738 DIGITALOCEAN-ASN 483 KIXS-AS-KR 205 GOOGLE-CLOUD-PLATFORM 115 OVH
- viraptor 2y agoStats from my service: ~92% of fake / auto user registrations comes from tor exits. (Or would, without blocking)
- ies7 2y ago> Interesting! We can see the most locations in India, Indonesia, and China as well as a significant number in the US and Europe. Are these because the bad guys are in there or just because of the population size? China, India, US, and Indonesia are the top four of the most populous country and also 4 countries with most internet users. Even the size of 10% of Indonesian internet users are almost the entire Taiwan population.
- Gigachad 2y agoI doubt most of these scans come from the attackers network. This is probably just a map of where the poorly secured CCTV cameras and IoT washing machines are.
- tomschlick 2y ago> Are these because the bad guys are in there or just because of the population size? Yes
- denton-scratch 2y agoI was surpriswed at the sharp concentration of addresses in the Netherlands. It looks as if it's a matter of national boundaries - thee's no concentration in Germany or Belgium. That could be a couple of "relaxed" ISPs, I suppose. I doubt it's a question of different national legislation.
- dfex 2y ago> Upon closer inspection of Asia, we can notice a significant number of addresses located in South Kora, (and possibly North Korea?), as well as in Taiwan. > I was surpised to see that the distribution of attacks is extremely uneven with most of it concentrated in parts of Asia, Europe, and the US, and (almost) none from South America, Middle East, and Russia. Aside from the casual stereotyping of bad actors here, the article completely neglects the fact that just because the attack is sourced from a certain IP/geolocation doesn't mean that the attacker resides in that location. What you most likely have is a listed of pwned PCs with fast internet connections being used in botnets.
- bradley13 2y agoNot seeing how this is stereotyping. He is just presenting his results. Whether those results stem from direct attacks or botnets? He doesn't even speculate. When I ran public servers a few years ago, I saw similar results. Since the company had no customers in Asia, we IP-blocked the entire continent.
- out-of-ideas 2y agothe distribution looks spot on for what it used to look back in late 2000's as well from my collection of memories (minus south america, russia)
- eddd-ddde 2y agoBeing surprised that there were more attacks from X countries as opposed to Y countries implies an expectation that there would be the opposite.
- supriyo-biswas 2y agoI found the information about the attackers’ quite interesting, because it also seems to disagree with Cloudflare data and my personal experience[1] which shows the US to be the largest originator of attacks. [1] https://radar.cloudflare.com/ https://radar.cloudflare.com/
- wolfendin 2y ago
- micw 2y ago"Failed publickey" - does this make sense? What is the chance to brute-force a private key that way?
- magnat 2y agoIf you haven't updated your Debian in a while, 1 in 30000 apparently: https://www.hezmatt.org/~mpalmer/blog/2024/04/09/how-i-tripped-over-the-debian-weak-keys-vuln.html https://www.hezmatt.org/~mpalmer/blog/2024/04/09/how-i-tripp...
- apstls 2y agoIt could be key spraying, maybe targeting a particular organization with distributed infrastructure for which the attacker already has some keys, but more likely groups blasting default keys (i.e. for some crappy IoT devices that included them in the firmware etc) for a nice & quick botnet.
- iforgotpassword 2y ago1. Scrape GitHub et al for accidentally committed private keys, maybe even get the appropriate username. 2. Run botnet that tries all these keys on the entire Internet. 3. Profit!
- ykonstant 2y agoWhy is GitHub not(?) hosting a flock of repos* with fake private keys/username pairs to annoy/deter those people? *Flock because of the Cloud? What is the appropriate noun for many repos?
- micw 2y agoVery good points in the comments, thank you a lot!
- imp0cat 2y agoWouldn't it be better and faster to use a local geoip database for the IP lookup instead of doing a network call for each?
- deleted 2y ago[deleted]
- keepamovin 2y agoThis was cool. The makings of an adhoc DIY cyber intelligence dashboard. I guess the distribution could reflect places with lower income levels looking to get free compute? (for whatever purposes). A lot are coming out of places where relative cost of compute compared to income, may be too high, alternately there may not have access to accepted payment methods? For the servers coming from the US and developed East Asia it could be already cyber companies doing scanning to find clients, or already compromised servers?
- chriscjcj 2y agoIt's been a couple decades since I adminned servers and firewalls. In my experience, in the early 2000's, Russian IPs were extremely common. I was surprised that OP didn't see even one. Can anyone conjecture on what might account for the apparent change?
- efnx 2y agoThe Russians are probably tunnelling through another connection or are steering a botnet.
- johanbcn 2y ago> Can anyone conjecture on what might account for the apparent change? Many companies that do not have business in countries known for their abundance of bad actors will block their IP ranges right away. Nowadays hackers worth their salt will make use of botnets and VPNs located at more "friendly" countries.
- reincoder 2y agoYou can use IPinfo's IP map (https://ipinfo.io/tools/map https://ipinfo.io/tools/map) or IP summary tool (https://ipinfo.io/tools/summarize-ips https://ipinfo.io/tools/summarize-ips). Both of these services support sending IP addresses via an API endpoint and can handle up to 500k IP addresses. You can also share the report via URL.
- ayewo 2y agoThanks for the tip. I'm also working on a similar analysis where I need to geolocate a bunch of IP addresses at once.
- reincoder 2y agoFeel free to check out the IPinfo CLI: https://github.com/ipinfo/cli https://github.com/ipinfo/cli I highly recommend the following commands: - grepip: extract IP addresses from text. - summarize: The command summarizes the IP addresses and provides output in text. It is different than the summary tool I mentioned. - bulk: Bulk/batch enrich IP address. Output can be CSV or JSON. If you need any help or want me to take a look at those IP addresses (or ASNs and organizations), please create a post on the IPinfo community. I can share the code and instructions with you.
- ludovicianul 2y agoA few years ago I've built a more simple visualization similar to this one with the attacks on the host the application was already deployed: https://github.com/ludovicianul/geolog https://github.com/ludovicianul/geolog. China was mostly leading, but there were many from US and Europe.
- tonymet 2y agowhy is ssh open to the internet to begin with? ufw is the first thing I install, even on a "private" network and here's why. I recently installed a router with IPv4 and IPV6. I later found out that IPv6 was globally addressed with no firewall. Always run ufw and begin by shutting off everything to the internet, then only open up what you need.
- Msurrow 2y agoPerhaps because the VPS is hosted somewhere remote and (s)he needs to ssh into it. Why ask questions in such an arrogant manner to begin with.
- tonymet 2y agothen restrict IPs to the administrative network rather than the entire internet.
- darkwater 2y agoWell, if you want to connect to your home LAN from your phone anywhere in the world you either need SSH or some VPN port opened either. Alternatively you can use some SaaS server where everything initiate the connection against the remote SaaS endpoint, but if you want to stay 100% local you need to open a port. For ssh changing the port to something else usually takes out 99% of bots.
- tonymet 2y agoMost VPS systems have an API to manage security group/ firewall. When you arrive at the new location, call the API to open up the new address. Here is the API on AWS https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_AuthorizeSecurityGroupIngress.html https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_A... Alternatively run a VPN or TailScale
- globular-toast 2y agoErm, because he wanted to use SSH? Using firewall rules on the hosts is like a fake firewall. Stuff on the hosts can override those rules. Like docker. After all, the host is actually receiving the traffic. A router isn't a firewall. Lesson learnt: don't assume any "router" device is also a firewall. Last I heard about half of ISP issued routers don't run any kind of stateful firewall for IPv6. The only reason they do for IPv4 is NAT.
- alam2000 2y ago[dead]
- tetris11 2y agoI'd recommend grepping "(Failed|Invalid)" to capture more IPs
- mtekman 2y agoI use the same pattern for my iptables banner. It's essentially a manual firewall for when I disable ufw if it's being too aggressive: https://gitlab.com/mtekman/iptables-autobanner https://gitlab.com/mtekman/iptables-autobanner
- midnight_shaman 2y agoI always install fail2ban on publicly exposed machines, especially if ssh is enabled. It won't block new malicious IPs but at least it will stop bruteforce attacks coming from each IP
- Joel_Mckay 2y agoSure, but most people have had do the walk of shame to a local coffee shop when someone inevitably trips the ban on your own network. A proper firewall port-knock set interleaved with 5 day ban tripwire port rules is effective at mitigating distributed brute-forcing. However, a ssh route whitelist rule set with SSL or iodine tunnel traffic priority is probably more important (when someone saturates the bandwidth trying to starve your session off the server). Have a great day =)
- mr_mitm 2y agoPort knocking is one of those things that sound like a good idea, but there are many possible footguns. And why is it that there is no one consensus (or "blessed") implementation? The implementation by Moxie seems interesting, but needless to say that Python 2 is an instant no-go: https://github.com/moxie0/knockknock https://github.com/moxie0/knockknock It hasn't been updated in 12 years, so why is it that there seems almost no real interest in a solid port knocking implementation?
- teddyh 2y agoBecause port knocking is fundamentally a stupid idea: <https://news.ycombinator.com/item?id=39898061 https://news.ycombinator.com/item?id=39898061>
- mr_mitm 2y agoTwo of your three points don't apply to Moxie's and some other implementations, for example Singe Packet Authentication. You can have sufficient bits, and it doesn't have to be cleartext. Maybe it's technically not port knocking anymore, but it's the same idea. And it's not about adding more bits to your authentication, it's about vulnerabilities that can be exploited without authentication, like the recent xz backdoor debacle. Port knocking would defend against that, longer keys would not. This has all been pointed out to you in the thread you linked.
- opentokix 2y agoThis is literally built in, in most modern logging systems with visualization.
- voidUpdate 2y agoSo this made me realise where I could find the SSH log file, and I spent a little while panicking at just how many attempts I've been getting on my webserver, and locking things down just a little harder out of paranoia
- jeroenhd 2y agoIf you use a good password (meaning a unique, randomly generated one), or disable password login and use private keys only, your chances of getting hacked by any of these are abysmally small. There are reasons to lock down your SSH port (fear of exploitation of the SSH software, like in the xz backdoor scenario) but I generally wouldn't worry too much about all the failed login attempts in your SSH log, as long as you're using secure enough login credentials.
- denton-scratch 2y agoPeople have been having this experience for ages. The first time you look at access/security logs for an internet-connected server, your jaw hits the floor, you get very curious about who all those bad people are, and you start worrying whether you're doing enough to keep them out.
- ajsnigrutin 2y ago> Finding the location of each attacker. ...of the attacking IP address, not attacker... If I, living in a small EU country, wanted to "hack" my neighbour across the street, I sure as hell wouldn't use my home IP address, tied to my account at my ISP, which has my name and address. I'd probably try to find an "IP" (VM, vpn, or whatever) in a country that's not really friendly about giving "ip address data" to our authorities. On the other hand, I wouldn't use a chinese IP in china, if I lived there and wanted to hack my neighbour over there.
- 3abiton 2y agoI have been doing similar, albeit less complex analysis, of incoming malicious, and it's always surprising the amount of relentless attacks. Any good practices to maintain a secure online server?
- zaik 2y agoNo root login, no password login, public key only. This should make ~100% of ssh attacks futile. If you don't want to see many failed login attempts in your logs, listening on a completely random 5 digit port and has worked well for me. You can specify the port in ~/.ssh/config so you don't have to type it every time you log in.
- brazzy 2y agoAs others have pointed out, the location of the IP address does not necessarily correspond with the location of the attackers. Specifically, in Germany, the central-ish culster of dots is in the Frankfurt area, which is also the location of DE-CIX, one of the world's largest internet exchange points, and of roughtly 1/3 of all datacenters in Germany. So I think rather than comparing the IP locations with population density, it would be even more interesting to compare them with the location of internet infrastructure. This is of course correlated, and probably harder to find as an open dataset.
- channel_t 2y agoThese kinds of experiments get even more interesting when you also pipe the IPs into Shodan and find out that a lot of the malicious login attempts are coming from pwned DVRs and other devices.
- spacecadet 2y agoI automate the hell out of packet capture, using the max ipinfo free tier each month... graph db... I cluster packets, organization dossier, and other collections of data as embeddings. Helps cut noise and identify anomalies faster.
- reincoder 2y agoI hope you are not being limited by our (IPinfo) free tier request limit in any way. If you own a public website, you can take advantage of IPinfo's creditlink system and get up to 100K requests per month: https://ipinfo.io/contact/creditlink https://ipinfo.io/contact/creditlink. Also, our summary tool and map tool are free and do not require you to sign up. You can take advantage of them as well. They support up to 500k IP submissions. Additionally, the free country ASN database provides unlimited requests, as it is just a database. Use the MMDB version of the database and the IPinfo CLI. I understand you probably have a system in place, but please ping me if you need any assistance, especially with using our free IP database.
- JSDevOps 2y agoAwesome content! Brilliant post. You could use maxmind and use the free files to get your data.