HNHacker News
TopNewBestAskShowJobs

leijurv

486 karma · joined May 1, 2016

[ my public key: https://keybase.io/leijurv; my proof: https://keybase.io/leijurv/sigs/w7C9Q0ei9POBhzwXcl36pWOTknw0WeEo5yNlqo497G8 ] Verifying my Blockstack ID is secured with the address 1PjWQMkKBD3JJJuYMEXnSYZ9pvpbLTQVqS https://explorer.blockstack.org/address/1PjWQMkKBD3JJJuYMEXnSYZ9pvpbLTQVqS
submissionscomments
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
:)
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Nothing so advanced, I'm afraid. The Monte Carlo system just creates a thousand points (2d position and velocity), and simulates them at 1 generation per second, culling points that are unlikely and reproducing points that are likely based on observations (clicking chunks and hearing back "loaded" or "unloaded").
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
That is not correct, this patch is meant to prevent block break desync, which is when your client and the server disagree about what blocks are placed in the world. If the server discards/ignores anything your client sends, the server MUST reply telling the client to undo that action, otherwise desync occurs. (e.g. "i have broken this block" -> the client is too far to reach that block -> the server has to reply with "set that block back to air").

The original version of this patch https://github.com/PaperMC/Paper/blob/d934dcc1e3e8b1ac34acef... fixed that desync, but it allowed you to force the server to generate an unlimited amount of chunks, which is an expensive operation.

You could only find players using this patch after it was modified to only reply if the chunk was already loaded. But at no point in time was this patch able to reveal if a chunk had been previously generated or not, that is a separate unrelated issue in which Spigot will reliably send a partial chunk on initial generation, but never for a previously generated chunk.

Take a look at https://2b2t.miraheze.org/wiki/Nocom

leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
This is one of life's great mysteries. Given the hosting provider for 2b2t, we know pretty much for a fact that the packet spam from 2018 and 2019 (before I knew about the project ;)) would have cost tens of thousands of dollars in bandwidth overages per month. Yet, he never added a packet limiter until an unrelated exploit could cause other clients to crash due to spamming an offhand swap sound effect. It took the exploit going fully public, plus another 36 hours or so, for it to actually get patched. ¯\_(ツ)_/¯
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Mostly learned as I went! I had never before implemeneted Monte Carlo localization, or DBSCAN, or a disjoint union find; it was a lot of research and trial and error. I'd honestly recommend Wikipedia! I also read a lot of blog posts such as on data clustering in order to decide how to write an algorithm to tell what is and isn't a single contiguous base.

The main expense was priority queue, which is a $20/account/month payment to 2b2t to be able to join the server faster. Probably nearing a thousand dollars on that. We lightened this by creating a proxy system where other builders could join through our headless, and it would add nocom exploit packets from their account to 2b2t, and peel off the responses on the way back. They got a more reliable experience with less disconnects, and we got some extra capacity for free (completely unbeknownst to them of course haha). By the end, all the overworld accounts were being paid for and used by other people, I only had to cover the 2 accounts in the nether.

About $300 on a new 2TB nvme drive for postgres. An unknown amount on electricity. Other than that, all the big processing ran on an existing homelab server (thanks to fr1kin). About $150 on digitalocean for a droplet to run the headless minecraft with minimal ping to 2b2t ($10/month). Backups were just WAL rsyncs to postgres replicas ran (again on homelabs) by myself and a few others.

leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Yes, Forgegradle was used. Frankly, not much interesting here, just a whole lot of work going through all the Minecraft code, and using Java reflection where possible and JVM bytecode injection otherwise. There's a lot of access transforming, using theUnsafe to allocate classes without calling their constructors, etc. As a random example that I remember, one of the last things to patch was that we had it working, but when you got kicked from the server, it would crash. This is because it would try to create a currentScreen GUI for the "disconnected from server" message, which for some reason was long enough that it was considering whether to wrap the text to the next line, which needed something like a font size, or maybe the window width, which crashed since there is no window or font.
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Yes, I probably should have credited that video to be honest.
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Correct, loading a pearl and respawning would throw us off the trail. This is why our aim was to follow the initial travel to the base location, rather than a future pearl TP. The easiest advice in order to throw off nocom is to travel in a straight line in the overworld for perhaps 10k blocks, set a bed quickly, then continue another 10k blocks, then /kill to the bed, then go perpendicularly for a render distance or two before the chunks unload at your death location. Even with some hypothetical tracking improvements (that never actually were written), such as walking back the last 10 minutes whenever a track goes cold, that would still throw it off.

Generally 2 or 3. 1 point of association was given whenever a track went cold, split up among however many players logged off within -6 seconds to +1 seconds of that timestamp (because of chunks unloading on a 5 second schedule). 1 point could be a false positive, but 2 or 3 would be reliably trustworthy.

leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Yes, this is a very fair question to ask. Of course, on the one hand, I could just say "this was fair game". The "point" of choosing to play on this server, is that it is THE no-rules server. The people who stick around more than a few months are the ones who accept that anything will eventually be griefed. Sometimes people call this the "sandcastle mentality", which means that a player accepts the destructive nature of 2b2t, and learns to live with it. Its name comes from building sandcastles on beaches: no one builds a sandcastle believing or expecting that it will last forever. The waves will always wash it away eventually, or someone else will break it. The only thing standing between your base and "the waves" is that no one knows where it is.

One way to think about it, is that in "normal" Minecraft servers, it's you versus everyone, but in an anarchy server that allows hacks, it's you versus the server software. There have been many hacks to locate other players, like following the trails that they leave in the world, that you can only see if you inspect some specific bits in chunk packets from the server. Perhaps they posted a screenshot that shows bedrock, which you can brute force their location from in a few hours/days on a GPU with OpenCL that simulates Minecraft terrain generation. Nocom was similarly "fair game", in that it only used the Minecraft protocol, and stayed within the "bounds" of talking to 2b2t with Minecraft packets and extracting information from that.

All that being said, it's still plainly the case that people put a ton of time into their bases, and no matter how much moral sleight of hand and cope you apply, it's still kicking over someone's sandcastle. When it comes to actually traveling to these locations and raiding them, our aim in that campaign was pretty much solely to amass a large stash of items/blocks for ourselves for the future. I would pass on bases by-default, only handing them along to be raided if there was bad faith construction (e.g. swastikas), or if most of the builders were known to be naughty. The main campaign was against standalone item stashes. These do take some time to create (by having exploiting past item duplication glitches), but they don't really have any creative expression in the same way that a base does. I have no logical argument for why I say that the same amount of hours invested in artistically making a build is more morally valuable than duplicating building blocks, it's just what feels about right. During the time when I was involved, we passed up hundreds of bases just because there was something actively being built there, and essentially only hit places that were just rows of chests placed on the ground in the world.

leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
There's a section called "The entire thing summed up in three sentences" in the linked GitHub README.
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Hard to estimate, probably a few hundred hours from me, and a comparable amount from others. As a random data point, I sent 53000 messages in the group chat developing it. ¯\_(ツ)_/¯
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Lol! Sorry for getting it locked, it is reversible if you still have the email. Mojang, it appears, didn't like spam login from a different cloudflare warp IP every few minutes...
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
I actually helped convince Sato in Feb 2020 to call it "automation period"; some other ideas were "age of fragmentation" (referring to how group alleigances were becoming split, with players in more than one group at a time) or "age of the algorithm" (referring to the YouTube algorithm promoting the server).
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
One reason might be that this only existed in Paper, which is a downstream fork of Spigot, which is (sort of) a downstream fork of CraftBukkit, which is a set of patches to the official minecraft server.

Another reason might be that this only does anything if there are many players on the server, and you hit a region loaded by someone else. Might be difficult to think of that. You'd never come across it if testing in singleplayer.

But in essence I agree, it's surprising that no one else found and reported this years ago!

leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Yes absolutely, for fun! Of course, it's also fun to have a secret project that no one knows about, to get an edge. 2b2t is practically the only Minecraft server that allows any kind of hacking your client (without getting banned), while also having an active community of meaningful size, so that was the clear target.
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
I am not done with university yet, so I don't speak confidently. But I'm afraid I have no special perspective, I just echo what I hear a lot: Learning by doing is probably the most important, but structured courses provide a theoretical and practical foundation that fills in a lot of important gaps that I would have had if I were only self taught.
leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Sure!

For monitoring on a meta-level, we used Prometheus and Grafana. Here's what that looked like near the very end: https://www.dropbox.com/s/ktlvvtmppq64u8o/trimmed%20grafana%... Since the ratelimit was heavily in place by then, the numbers are pretty low. For example, the headliner "blocks per second" was well over three thousand a few weeks before then.

One of the most common queries for actual usage though, was "what bases in the last 24 hours (or whatever) have the most chests currently". We'd then travel to these locations to borrow items. Here's that query https://pastebin.com/fjhHGSYz Roughly, it grabs chunks with chests in that timeframe, then uses a recursive Postgres CTE to traverse the https://en.wikipedia.org/wiki/Disjoint-set_data_structure that we used to implement DBSCAN, from the leaf to the root. Then it groups by the root, which in practice means grouping chunks together by which ones semantically have been determined to be part of the same base, then makes a report by quantity per base.

There was also a web UI that showed all active tracks. You could click any player and see their travel history, the route they had taken to get to that location. As well as clicking any cluster and seeing the usernames associated with it. We used this a lot to grab what members were present at a given item stash or base, to make sure we weren't stepping on anyone's toes.

In terms of what it took to make this happen, the stars of the show were probably the main Postgres, which was hand-tuned on top of a hand-tuned ZFS, on top of a NVME drive that was IOMMU passthrough'd to this VM for maximum performance. As well as https://github.com/OpenHFT/Chronicle-Map, which really helped out. We needed a mapping from block coordinate to a bit of data about that location, such as the last timestamp we checked it, what Minecraft block was there last, whether the block is interesting, uninteresting, different from seed, etc. High frequency trading software was perfect for this use case, because it greatly reduced GC pressure on the JVM, since the data was stored off-heap. It ended up at around (roughly) fifty million entries, served hundreds of thousands of requests for block data per second, and requested historical data (from the Postgres) at about thirty thousands SELECTs per second (from a table with over ten billion rows). The reason why this needed to be so fast, is that the use case is downloading bases. Sometimes someone would log in to 2b2t at their base, after having not played for weeks at a time (so the data is in Postgres, not the map in RAM), we wanted to be able to pick up right where we left off on downloading what they had built. This means it needs to get back up to speed with their entire base, as fast as possible, in the seconds before they move away to other chunks, or log off the server. We are downloading bases one click at a time, and bases are huge. The area that is loaded in by a player is 144 by 144 by 256. That’s 5 million blocks. And there are about 250 players online on 2b2t at any given moment in time. That’s well over a billion blocks that we could click on, and learn which Minecraft block they are. But, which locations should we use up our clicks per second budget on? It focused on areas that are being changed rapidly, and areas that are different from the base vanilla terrain. Those are certainly bases, large Minecraft builds. We do an expanding paintbucket pattern that expands in 3 dimensions to whatever has been built there. However, we have to do this quickly, and we have to pick up where we left off. Someone might be flying around their base with an elytra, at very fast speed. We would love to scoop up the terrain that they’re flying over. If the base is particularly interesting, someone flying over a certain area could have had about twenty Minecraft accounts spread all over 2b2t’s map suddenly refocus all of their left clicks on that one area, to grab all the interesting neighbors that it wasn’t able to last time. We peaked at about three thousand block clicks per second, averaged over weeks. So this was a massive data loading and management problem.

leijurv··on Nocom – 2b2t Minecraft server exploit using Monte-Carlo localization
Surprised to see this posted again, I wrote this, feel free to ask me anything!
leijurv··on Minecraft’s 'Worst' Server Was Exploited So Hard, Griefers Could See the Future
Hi, this was me.

That article has a lot of inaccuracies, typos, and general mistakes due to it being a summary of a YouTube video.

I recommend instead looking at:

The video it is summarizing https://www.youtube.com/watch?v=elqAh3GWRpA

My explanation https://github.com/nerdsinspace/nocom-explanation/blob/main/...

The 2b2t wiki page about it https://2b2t.miraheze.org/wiki/Nocom

leijurv··on SQLite is not a toy database
> My pet peave is the way sqlite accepts non-aggregated columns in a GROUP BY query.

Funnily enough, this is my favorite feature of sqlite that I wish other RDBMSs had :))

There is no easy equivalent to `SELECT order_id, status AS latest_status, MAX(updated_at) AS updated_at FROM orders GROUP BY order_id`. Well, it's possible, but for example in Postgres you need some silliness with nested queries, `PARTITION BY`, and `ROW_NUMBER()`.

leijurv··on NASA's Perseverance rover sends stunning images
Nuclear reactors are better and have economies of scale, it doesn't make much sense to everyone have their own.
leijurv··on So you've made a mistake and it's public
> The people contributing to WP - the editors - seem more concerned with coming up with Kafka-esque processes to introduce to the community than making the actual work of making an encyclopaedia.

I might take a look at https://en.wikipedia.org/wiki/Special:RecentChanges maybe reload it a few times. What percent of the changes are to policy space? (the article name begins with "Wikipedia:") And what percent are to regular articles / discussion of articles (article name is normal, or begins with "Talk:").

I think you'd be surprised because the vast vast vast majority of edits are to the articles themselves.

> Perhaps the only area where editors are as zealous they are about creating obscure processes, is in policing what content should they should fit into the their volumes.

This is important. I'm not sure if you're referring to notability, or sourcing, but both are critical to making an encyclopedia. https://en.wikipedia.org/wiki/Wikipedia:What_Wikipedia_is_no... https://en.wikipedia.org/wiki/Wikipedia:Reliable_sources

leijurv··on Submarine Cable Map
It's your lucky day!

https://live.infrapedia.com/app

leijurv··on Building a computer in Conway's game of life
https://en.wikipedia.org/wiki/Wake_(Sawyer_novel)
leijurv··on Cloudflare was down
Oh no, not the dark mode! The sacrifices we have to make for performance I guess...
leijurv··on Cloudflare was down
Someone needs to get these lava lamps plugged back in ASAP!
leijurv··on Onyx is violating the Linux kernel's license, refuses to release source code
I've obliged.
leijurv··on JPEG Committee releases a call for evidence for image compression based on AI
Yes, exactly! One of the winning entries at http://prize.hutter1.net/ (challenge to compress English Wikipedia) is/was a LSTM that predicted the next character then used arithmetic coding on the final bitstream (correct bit / incorrect bit).

Specifically, see https://arxiv.org/abs/1609.07959

leijurv··on Snowflake to Avalanche: A Novel Metastable Consensus Protocol Family for Crypto
It seems like in this protocol, such a cleanup wouldn't even be possible... if transactions can have only one input
leijurv··on Snowflake to Avalanche: A Novel Metastable Consensus Protocol Family for Crypto
This sounds an awful lot like each transaction can consume exactly one UTXO, but can have multiple UTXO outputs. This would cause progressive "shattering" of the UTXO set into millions of low-value "dust" UTXOs, a problem that Bitcoin is struggling with (specifically, how best to incentivize "cleaning up" the UTXO set by making transactions with multiple inputs, even though that increases the overall transaction size).

"We adopt what is commonly known as Bitcoin’s unspent transaction output (UTXO) model. In this model, clients are authenticated and issue cryptographically signed transactions that fully consume an existing UTXO and issue new UTXOs."

← PreviousPage 2 of 3Next →