News for hackers. Stuff that matters.
Re:Let us serve you, but don't bring us down by pfooti on Monday May 29, 2023 @12:36AM (#36110689)
I run a system at my employer that occasionally gets scraped by malicious users. It can be used to infer the purchasability of a specific domain, which is a moderately-interesting API endpoint, since that requires talking to domain registries. For a while, nobody cared enough about it to abuse the endpoint. But then we started getting about 40 QPS of traffic. We normally get less than 1.

I was keeping an eye on it, because we are hard-capped at 100 QPS to our provider, beyond that and they start dropping our traffic (and it is an outside provider, bundling domain registries like verisign and stuff), which makes regular users break if their traffic gets unlucky.

Anyway, after a week of 40qps, they start spiking to 200+, and we pull the plug on the whole thing: now each request to our endpoint requires a recaptcha token. This is not great (more friction for legit users = more churn) but it is successful. IF they had only kept their QPS low, nobody would have cared. I wanted to send some kind of response code like, "nearing quota".

FTR before people ask: it was quite difficult to stop this particular attack, since it worked like a DDOS, smeared across a _large_ number of ipv4 and ipv6 requesters. 50 QPS just isn't enough quota to do stuff like reactively banning IP numbers if the attacker has millions of IPs available.

Re:Let us serve you, but don't bring us down by sbierwagen on Monday May 29, 2023 @12:39AM (#36110705)
Temporarily add 500ms of latency to all ipv6 users, backoff timers for ipv4 addresses. Since there's only 4 billion v4 addresses, it's easy enough to just track them all in a sqlite db.
Re:Let us serve you, but don't bring us down by Taek on Monday May 29, 2023 @12:49AM (#36110764)
I don't think that works if your attacker has millions of IPs and is only using 200 per second.
Re:Let us serve you, but don't bring us down by akiselev on Monday May 29, 2023 @01:01AM (#36110832)
How are they getting millions of ipv4 addresses? IIUC that’s at least the equivalent of a /12 block. Do those shady residential proxies really operate at that scale?

If they’re ipv6 address wouldn’t they be safe to block across large ranges?

Re:Let us serve you, but don't bring us down by slivanes on Monday May 29, 2023 @01:05AM (#36110864)
My guess through compromised boxes (or some apps) that act as proxies.
Re:Let us serve you, but don't bring us down by reaperman on Monday May 29, 2023 @01:11AM (#36110901)
It is trivially easy to get millions of IPv6’s, even spread out across a thousand ranges.

It is also trivially “easy” to get past reCAPTCHA, but it costs more. My guess is that a domain name checker tool isn’t worth the cost per request to bypass reCAPTCHA (approximate 0.02 cents per session)

Re:Let us serve you, but don't bring us down by jszymborski on Monday May 29, 2023 @01:22AM (#36110943)
Right, but this is why the GGP's post suggested throttling IPV6. Or at least that was my understanding.
Re:Let us serve you, but don't bring us down by reaperman on Monday May 29, 2023 @01:31AM (#36110980)
The 500ms latency will help a lot if tons of requests are coming in serial. But most likely they are coming in parallel.

It’s hard to “throttle” a single isolated request from a lone IP.

Re:Let us serve you, but don't bring us down by wtallis on Monday May 29, 2023 @02:25AM (#36111272)
So.. make the requests serial. Just dump all the requests coming in over IPv6 into a queue, service that queue at a rate that's higher than the non-bot traffic requires but still low enough to be a problem for bots that can't self-limit to a reasonable rate. And of course, manage that queue intelligently so that you start dropping requests before you run out of RAM.
Re:Let us serve you, but don't bring us down by reaperman on Monday May 29, 2023 @07:26AM (#36112903)
That just sounds like DDoSing yourself? It costs bots almost nothing to wait in the queue, and exactly zero real IPv6 clients will wait 10+ seconds to complete the request.
Re:Let us serve you, but don't bring us down by pfooti on Monday May 29, 2023 @01:37AM (#36111005)
Mostly works, but there do exist a couple of botnets that contain 1 million compromised machines. If each makes one request before hitting backoff, spread evenly throughout the day, that's about 10 QPS alone before they use an IP number twice. But they tend to not actually level out their usage (which is a bummer - if they did they could have kept using it). Instead they hit with a lot of parallel queries all at once.

There's only so much you can really do when your underlying resource is so limited. Luckily the value of the query is lower than the cost of a recaptcha solve, so the attackers moved on to some other target.

Ironically I could now turn off the endpoint protection (or have it responsive to traffic load), until the attackers return. I shall not go into too many details, no need to give people a map.

Re:Let us serve you, but don't bring us down by pierat on Monday May 29, 2023 @12:38AM (#36110697)
QPS seems to be "queries per second".

I first thought it was something like "quadrillion bytes per second" or some newer over-the-top data measurement :)

Re:Let us serve you, but don't bring us down by vaylian on Monday May 29, 2023 @02:29AM (#36111298)
I haven't heard of that abbreviation before. But there is a stub on Wikipedia if anyone cares about improving that article: https://en.wikipedia.org/wiki/Queries_per_second
Re:Let us serve you, but don't bring us down by hattmall on Monday May 29, 2023 @12:49AM (#36110763)
Captcha seems like overkill. Were you not able to implement a JS fingerprinting / bot check before captcha.
Re:Let us serve you, but don't bring us down by pfooti on Monday May 29, 2023 @01:40AM (#36111024)
Yeah, "recaptcha" in this case is shorthand for a lot of stuff we did to harden the endpoint that ultimately represents a minor shift in balance from no friction to some friction for otherwise legitimate users, but a pretty significant drop in illegitimate traffic.

The main idea here is that at some point just leaving the scrape running in a way that didn't overwhelm my backend would have resulted in me not caring enough to do that. But now they get nothing. Even if you're borrowing bandwidth and not paying, you should be a good neighbor is all.

Re:Let us serve you, but don't bring us down by reaperman on Monday May 29, 2023 @01:12AM (#36110904)
Most of the time, the new CAPTCHAs do that and then never show an actual interactive element. The interactive gimmicks are a fallback in cases of high uncertainty.

The webmaster doesn’t need to worry about it, the anti-bot services handle who gets what difficulty of challenge. But the webmaster can specify whether they’d like to be more or less strict/difficult than usual.

Re:Let us serve you, but don't bring us down by fragmede on Monday May 29, 2023 @12:54AM (#36110791)
did you ever look inside those queries? were they the same, just repeated ad nauseam just polling in case their status had changed?
Re:Let us serve you, but don't bring us down by jb_gericke on Monday May 29, 2023 @01:04AM (#36110860)
Why not put auth on the endpoint and enforce quotas and rate limiting (an api gateway like kong could handle this for you).
Re:Let us serve you, but don't bring us down by pfooti on Monday May 29, 2023 @01:22AM (#36110942)
Endpoint was invoked in our signup funnel, so there was a bootstrapping problem for quota enforcement, the attackers weren't making a whole signup, just getting to the point where the domain search ran.
Re:Let us serve you, but don't bring us down by boulos on Monday May 29, 2023 @01:13AM (#36110905)
Rate limit and return a 429?
Re:Let us serve you, but don't bring us down by pfooti on Monday May 29, 2023 @01:26AM (#36110955)
See sibling, but the endpoint was part of a signup funnel, so short of rearchitecting it completely to put that check after customer creation, there's no real persistent key to rate limit on. Any one IP ended up getting rate limited to 5 requests per hour on that API, but the attack was incoming from what looked like a botnet, so it was tricky.
Re:Let us serve you, but don't bring us down by rapnie on Monday May 29, 2023 @01:25AM (#36110952)
Maybe mCaptcha [0] is worth a look. It applies a Proof-of-Work like algorithm (not blockchain-related) which makes it very expensive for scrapers to get data in bulk, but poses least amount of friction to individual users. The project is implemented in Rust and received NGI.eu/NLnet funding. I don't know its state of production-readiness, but Codeberg.org is considering using it (this choice is informed by higher respect for privacy and improved a11y compared to hCaptcha).

[0] https://mcaptcha.org/

Re:Let us serve you, but don't bring us down by 8organicbits on Monday May 29, 2023 @01:44AM (#36111053)
Really interesting! How efficiently does a web browser compute the PoW? I'm concerned that a bot would use an efficient GPU implementation while real users would run an inefficient JS/webcrypto version.
Re:Let us serve you, but don't bring us down by jchw on Monday May 29, 2023 @01:57AM (#36111133)
I tried to implement PoW in browser for the same concept. I think it's probably at least marginally useful, but practically you're limited by WebCrypto I think, which outperformed anything I could find in pure JS or WASM. The disadvantage of WebCrypto is that there's a limited set of algorithms you can use and also, understandably, calculating hashes is async, so if you want a lot of rounds, you'll spend a lot of time jumping in and out of the event loop. It's still probably a useful speed bump or price increase for expensive operations: what might cost a few seconds on a typical phone or desktop is probably at least enough to act as a speed bump for attackers to perform it quickly (especially combined with other measures like throttling and progressively increasing PoW difficulty for an IP.) Maybe WebGPU could change this, but I'm weary of relying on all users having a fast GPU enabled in their browser just for this use case.

Though thinking about it, I wonder if there is a hybrid: start with a difficulty that's just a few seconds for CPU/WebCrypto and ramp up quickly, but also support WebGPU where possible so that web users on abusive connections may still succeed? I am not sure though, I guess this depends on the feasibility of using WebGPU and etc.

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @02:09AM (#36111186)
Requiring every user to compute it's own PoW is a terrible idea. It defeats the whole purpose. One's person expensive computation is another person's almost free computation.

I commented in the past about it:

"At first glance, yes, we can create intentionally expensive computations without relying on a blockchain, that would serve the same purpose. In reality we cannot. Special computer hardware (ASICs) could generate much cheaper PoW annotations than general purpose computers, and sell it to spammers. Blockchain economic incentives ensure that ASICs will be used by the miners first and foremost."

https://news.ycombinator.com/item?id=33533389

Re:Let us serve you, but don't bring us down by comex on Monday May 29, 2023 @02:15AM (#36111216)
> Blockchain economic incentives ensure that ASICs will be used by the miners first and foremost.

So instead, what, you want people to buy BTC and send small amounts of it to websites?

Problem is, given varying income levels across society and across the world, one person's expensive micropayment is another person's almost free micropayment.

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @02:26AM (#36111275)
In a comment down below, i made it clear i was not referring to BTC. In the internet there is no centralized registry of naming projects. There are currently three projects in which the communities call themselves bitcoin. Any one of the other two bitcoins support much smaller microtransactions than BTC.

Very true, that micropayments could vary on their relative cheapness across the global population. Let's put a number, is 0.01 cent affordable by most people on the planet, for every http request?

Re:Let us serve you, but don't bring us down by elcomet on Monday May 29, 2023 @02:44AM (#36111381)
So maybe you should link to the one you are referring to, if there are three projects with the same name.
Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @02:59AM (#36111463)
I am talking about Bitcoin BSV. If the purpose of blockchain was solely to provide PoW, then there could exist a lot of blockchains, a thousand maybe. Economic incentives ensure that the most inefficient of blockchains will be put out of the market. So some of them, like btc will soon be put out of the market, because speed and microtransactions is the two factors every blockchain competes on.

https://www.binance.com/en/price/bitcoin-sv

Re:Let us serve you, but don't bring us down by 8organicbits on Monday May 29, 2023 @03:18AM (#36111545)
> This coin is not listed on Binance for trade and service.

An obscure coin my users cannot purchase through major exchanges is a really poor solution. Sorry, that makes no sense.

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @03:46AM (#36111694)
I answered on the other comment, but at that point, in case there is a blockchain, which supports a millionth of a cent transaction, then exchanges (Binance, Coinbase etc) are not so useful. If every person just needs one cent for a million http requests, then one guy in your neighbourhood or your town, or your city might have some of it, you message him and he will send you a cent for free. You buy him a coffee, and he will give you in return, billions of http requests.

But again, economic incentives need to work their way into the system.

Re:Let us serve you, but don't bring us down by 8organicbits on Monday May 29, 2023 @07:03AM (#36112757)
Yikes, that sounds terrible. The current best alternative is a visual captcha. I'm not driving around town to buy coffee for some random person just to be able to use the internet. That's not the sort of internet I want.
Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @05:29PM (#36118313)
I am not suggesting that you should do that. As soon as we reach the sweet spot of transaction fees, between a thousandth of a cent, and a millionth of a cent, then every person will have a wallet with one dollar inside it, and send it to a site he visits and desires to not be considered a spammer.

In case you run out of proof_of_burn a friend of yours might send you just a cent, and you are good to go, for one hundred thousand http requests more. There is no need for a normal person, to hold more than a handful of dollars for every year's internet use.

That renders exchanges almost useless. Not totally useless, but much less relevant than they are today.

I personally wouldn't care less, if there is one bitcoin/blockchain which reaches that sweet spot, or if they are a hundred, including litecoin, ripple etc. PoW is meant to be used for practical reasons. Blockchain however constitutes an economic system, of suppliers-miners and consumers-users, it is more than just a software program. It will evolve in the future, and it requires some crucial time.

For the moment there no API which provides the kind of PoW service to be very useful, and some hacks might be required to mitigate side effects of relentless scraping. These are just hacks, useful today, but the real solution is coming soon. Web3 some people call it, or Cryptocosm is another name of it.

Re:Let us serve you, but don't bring us down by Leo_Germond on Monday May 29, 2023 @03:12AM (#36111519)
Specialized ASICs are not easy to come up with, what's more if it's in a tug of war you can expect those to suddenly become obsolete, rendering this approach too costly for a scrapper. Also you may have missed the part in the original link where they were using AWS to do the scrapping, so no ASICs there, and you pay by the minute, two things that would make PoW a valid countermeasure, no "free computation" in that setup.
Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @03:23AM (#36111571)
As far as i know, btc and ethereum actively fight the ASICs, because they will diminish the profits of amateur miners, and will bring great centralization to the network. Which is true, and it is no problem.
Re:Let us serve you, but don't bring us down by 8organicbits on Monday May 29, 2023 @06:59AM (#36112736)
You wouldn't need to host the ASICs (or even GPUs) in AWS, anything there can easily call back to a self hosted compute farm with the challenge.
Re:Let us serve you, but don't bring us down by 8organicbits on Monday May 29, 2023 @03:13AM (#36111524)
Looking cross-comment I think you're advocating for micro-payments or micro-proof-of-burn. This is better than having every user compute their own PoW as they'd purchase a small amount of cryptocurrency from an ASIC farm, which should be cheaper/faster/more efficient than using their local hardware. I mostly agree with the concept, but I don't think any such API exists yet with enough adoption to consider this a real option any time soon.

Right now, if I was to ask my users to do a proof of burn for $0.0001 of BTC most of them would just close my site as they don't have any BTC. The process of setting up an account on an exchange, waiting several hours/days for KYC checks to clear, adding a credit card, buying BTC, sending it to a browser extension, and then trying the signup again is a *significant* initial hurdle. If we were in a world where I could assume all my users already owned BTC, that's a different story, but we haven't seen adoption of cryptocurrency anywhere near that level. I don't expect PoW schemes to drive that adoption either, so this seems like a poor solution today.

Do you happen to know if a hCaptcha/mCaptcha-like micro-proof-of-burn tool exists already? I'd be happy to be proven wrong.

That brings us back to options that exist today, which includes every user computing their own PoW. Looking at mCaptcha some more, it uses a SHA256 derivative so it's compute-hard and vulnerable to GPUs/ASICs. The author mentions some of those concerns in an earlier thread [1]. I wonder if a different proof-of-work algorithm would be better, like a memory-hard PoW, proof-of-space, and/or proof-of-wait. I'm skeptical of those too, unfortunately.

[1] https://news.ycombinator.com/item?id=32341446

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @03:34AM (#36111639)
You are right in most of your points. Today it doesn't exist an API for micro_proof_of_burn. Economic incentives however require a little patience because they need to work their way through the system. 0.0001 BTC is hugely expensive. A blockchain with millionth of a cent transaction, is certainly possible, and it will exist in 2-3 years approximately.

In my calculations, with millionth of a cent per transaction, even paying for torrent blocks (64 KB), not torrent pieces (16KB) will soon become profitable.

Re:Let us serve you, but don't bring us down by yyyk on Monday May 29, 2023 @06:10AM (#36112455)
Micropayment are 'profitable' save for anti-money-laundering laws (not to speak of anti-terrorism laws) which make any such payment have significant compliance costs. The only was to bypass that would be with centralized verification agencies to take liability (and demonetize anyone deemed controversial). Since they're centralized, they'll have zero use for blockchain (good riddance). Does anyone want that future?
Re:Let us serve you, but don't bring us down by tornato7 on Monday May 29, 2023 @03:18AM (#36111544)
Ethereum was pretty successfully ASIC-resistant. Other PoW algorithms are GPU-resistant. Even so, I doubt most spammers are sophisticated enough to create ASICs just to make cheaper requests to this guy's service.
Re:Let us serve you, but don't bring us down by DannyBee on Monday May 29, 2023 @08:10AM (#36113164)
Right - the argument here seems totally silly. The cost barrier to entry would be incredibly high.

Unlike blockchain systems, the implementation details of mcaptcha are also totally hidden, and you don't have to maintain compatibility at all.

Someone creates an asic? Great, you can make it not work anymore without affecting any of your users for real.

10+ million down the drain.

Re:Let us serve you, but don't bring us down by entropyie on Monday May 29, 2023 @03:39AM (#36111661)
Security is not all or nothing. There are many applications where adding a small bit of friction in the form of compute will stop 99.9% of abusive traffic. Visual captchas are a plague on the internet, but so is Blockchain mania.

I added FriendlyCaptcha to some of my sites, and stopped 100% of abusive traffic. Open source, user friendly, accessible to people with disabilities.

https://friendlycaptcha.com/

Most of us are not running amazon.com here.

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @03:57AM (#36111763)
Nice solution, if that works for your site, perfect.

If i may add, in case someone desires a little bit of revenue from a website, one very popular solution is to put advertisements in some places. Well some people consider that a security hole, including me. So i guess the definition of security varies, but the security mania goes on for many decades. I am one of those security maniacs, and any tool to enhance security is important, blockchain is one of them.

Re:Let us serve you, but don't bring us down by RobotToaster on Monday May 29, 2023 @04:26AM (#36111928)
Friendlycaptcha isn't open source, only the widget/client is. The sever seems to be closed source.
Re:Let us serve you, but don't bring us down by entropyie on Monday May 29, 2023 @05:59AM (#36112398)
Re:Let us serve you, but don't bring us down by RobotToaster on Monday May 29, 2023 @06:04AM (#36112421)
>This distribution is licensed under a non-commercial source available license
Re:Let us serve you, but don't bring us down by entropyie on Monday May 29, 2023 @07:27AM (#36112910)
Thanks for the clarification. Indeed it is not open source in the truest sense, but I don't consider source-available to be closed-source. Especially when the main limitation seems to be a no reselling clause. This would not prevent most people from deploying to their SaaS for example. Even having the code available to audit is a plus. Again, perfection is the enemy of good.

I've found that black and white thinking in security is very dangerous, as you often end up with very "secure" controls that have terrible UX, which users bypass completely via byob etc... And pwnage ensues. UX is a primary pillar of security.

Re:Let us serve you, but don't bring us down by yyyk on Monday May 29, 2023 @05:00AM (#36112101)
>One's person expensive computation is another person's almost free computation

We have pretty good guides to what's an expensive computation to everyone. That's how password-hashing algorithms work, much better than BitCoin does. Besides, the existence of specialized methods of compute is hardly determinative. We're not trying to stop TLAs. It just needs to be expensive enough to stop 99%, and at most we'll later update again.

Re:Let us serve you, but don't bring us down by DannyBee on Monday May 29, 2023 @08:15AM (#36113198)
This doesn't make any sense.

ASIC's take tons of time and money to design.

Unlike blockchain, where the PoW algorithm is part of basic compatibility, it's not at all in mcaptcha - the users see a checkbox. The rest is implementation details.

If someone creates an ASIC, you can break it very easily by changing the PoW algorithm a bit, and no users are affected.

Even if someone has the money to keep up with you, which is remarkably expensive, they will be too slow right now.

That would be hard to change

Re:Let us serve you, but don't bring us down by wmanley on Monday May 29, 2023 @08:19AM (#36113222)
The difference between this use case and bitcoin is algorithm mobility. All bitcoin miners must use the same algorithm and get the same result for it to work. This makes it very hard (read slow) to change the algorithm, so there's time and incentive to design, fabricate and deploy ASICs. For client-server PoW the server can choose a new algorithm whenever the old algorithm becomes ineffective.
Re:Let us serve you, but don't bring us down by toastal on Monday May 29, 2023 @01:47AM (#36111062)
If it doesn’t involve my free labor training machine learning models like reCAPTCHA and hCAPTCHA and I can still visit sites from a non-Western IP, then it’s already an improvement.
Re:Let us serve you, but don't bring us down by hackernewds on Monday May 29, 2023 @01:49AM (#36111075)
how does it work? perhaps it's proprietary that the authors wouldn't want to disclose, but I did not see anything referenced in the site. I wouldn't plug it into mine without knowing g
Re:Let us serve you, but don't bring us down by rapnie on Monday May 29, 2023 @01:56AM (#36111124)
It isn't proprietary [0]. There is a matrix channel [1] for the project to ask questions.

[0] https://github.com/mCaptcha/mCaptcha

[1] https://matrix.to/#/#mCaptcha:matrix.batsense.net

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @02:00AM (#36111156)
In my opinion, PoW is the only reliable way, to avoid DDoS attacks. Scraping too much, too quickly is a light form of DDoS, although not intentional. PoW was invented in 2006 exactly for that purpose.

The genius of bitcoin (not BTC) is that it provides an organized and practical way, for PoW to be used by everyone on the planet. Some people find it strange, because there is an imaginary token created out of pure nothing which represents the PoW. It would work fine, without that imaginary token i.e. bitcoin, just by dollars of euros, but it wouldn't be internet native. The point is always to just send a minimal PoW with every http or tcp/ip request.

Re:Let us serve you, but don't bring us down by sph on Monday May 29, 2023 @04:07AM (#36111817)
Proof-of-work was originally introduced by Adam Back's hashcash, to fight email spam.

Bitcoin is an evolution of that idea applied to digital cash.

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

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @04:18AM (#36111867)
Yes, DDoS attacks are spam over the http protocol. Spam is spam over the imap protocol. Overwhelming a server with too many download requests, is not spam but it has the same effect. Calling the police every ten minutes because the door sounds like someone tries to break in, is spam.
Re:Let us serve you, but don't bring us down by account42 on Thursday June 01, 2023 @04:48AM (#36148810)
> Spam is spam over the imap protocol.

IMAP isn't used for sending email. You're thinking of SMTP.

Re:Let us serve you, but don't bring us down by jcq3 on Monday May 29, 2023 @08:43AM (#36113396)
Would it be possible to use bitcoin pow as a replacement for captcha? It both blocks ddos and create an income through mining (client side) for the host.
Re:Let us serve you, but don't bring us down by GTP on Monday May 29, 2023 @10:18AM (#36114242)
It wouldn't create any income due to the electricity costs associated with mining, unless the users start buying ASICs. Also the most straightforward way of implementing this would be by having the user spending the token they generated in a transaction to prove their work, which would nullify their income. Maybe there is some workaround by monitoring the blockchain and seeing if a certain user generated some tokens at a certain time, but would it be worth the extra energy required due to the use of bitcoin' PoW? I think no.
Re:Let us serve you, but don't bring us down by kmeisthax on Monday May 29, 2023 @10:41AM (#36114467)
No. In fact, using such a well-known proof of work function would defeat the purpose of using PoW. Instead of having something that's cheap for occasional users but expensive for spammers, you'd have something that's cheap for people who own mining ASICs and expensive for occasional users.

Hardware specialization breaks the economics behind a CAPTCHA. To fight that you need to use a PoW that hasn't been ASIC'd yet, and be willing to change PoW functions at the drop of a hat. PoW functions that stress memory or cache are also helpful here, though you run the risk of browsers flagging you as a cryptominer (which is technically correct, even if economically wrong).

Re:Let us serve you, but don't bring us down by smallnamespace on Monday May 29, 2023 @10:57AM (#36114616)
> cheap for people who own mining ASICs and expensive for occasional users.

Seems like it should be the same cost (barring the friction of having a wallet, etc.) for both sets of people since Bitcoin is just a commodity and the value is the same to everyone, miner or not.

For example, a miner should value some fraction of a BTC the same way anyone else does, since they can sell or buy it at the same price a normal user can. The fact that they can profitably mine BTC just means they have a profitable business on the side, it doesn’t mean they should prefer to pay for services (or emails) in BTC.

Re:Let us serve you, but don't bring us down by kmeisthax on Monday May 29, 2023 @01:40PM (#36116131)
Miners have ASICs - specialized silicon that ONLY mines Bitcoin, but does so many times faster than a CPU or GPU can. The average low-demand user does not have such hardware. Furthermore, because Bitcoin increases difficulty to maintain a fixed transaction rate, ASICs have to be replaced with newer models every few years. So older ASICs are going to be cheaper, but they might still be worth buying if you're a spammer.

So in order to moderately inconvenience said spammer, you have to make each and every ordinary user wait hours mining a few satoshis' worth of hashes in order to be let in. This is the exact opposite of what you want.

Re:Let us serve you, but don't bring us down by emporas on Monday May 29, 2023 @05:02PM (#36118085)
Well said, that's exactly my point.
Re:Let us serve you, but don't bring us down by smallnamespace on Monday May 29, 2023 @05:25PM (#36118285)
Yes, sorry I wasn't expressing myself very clearly. I agree if the goal is to impose a uniform (per-unit) cost to users, you should avoid widely-optimized hash functions.

But even if you pick a novel function that doesn't have special-purpose hardware, spammers can still optimize their setups to lower the effective unit cost below what a legitimate user faces, by doing normal miner activities (picking hardware, scaling up, moving to where electricity is cheap, etc.).

Since your goal is to maximally discriminate between legitimate and spam use cases, you'd want spammers to face at least the same per-unit cost as legitimate users.

What's one way you can do that? Well, how about charging actual currency, whether Bitcoin or fiat? Money has the useful property of having the same nominal value for everyone, and not being amenable to further optimization.

In short, forcing users to actually run PoW themselves doesn't really make economic sense. Even if you're avoiding existing hash functions, it's mostly worse than just charging money because spammers have better ability to optimize against it.

And if charging money doesn't work, switching to local PoW is unlikely to be better.

Re:Let us serve you, but don't bring us down by davidgerard on Monday May 29, 2023 @10:30AM (#36114366)
no, this is incorrect. Proof of Work was invented by Moni Naor and Cynthia Dwork in 1992 as a proposal to fight email spam. https://www.wisdom.weizmann.ac.il/~naor/PAPERS/pvp.ps
Re:Let us serve you, but don't bring us down by sowbug on Monday May 29, 2023 @11:30AM (#36114903)
Pretty sure my second-grade teacher invented it. Writing "I will not talk while the teacher is talking" 100 times on the chalkboard is proof of work, and it definitely cut down on unwanted chatter.
Re:Let us serve you, but don't bring us down by RugnirViking on Monday May 29, 2023 @04:33AM (#36111964)
I hate to be a pedant but I see it used wrong a lot. "DDOS" stands for Distributed denial of service, specifically indicating the traffic is coming from many sources (wide range of ip), which is what makes it so hard to defend against. Someone scraping too fast would be performing an unintentional DOS, because they probably arent scraping using a botnet (and if they were they probably do in fact intend to attack)
Re:Let us serve you, but don't bring us down by jakear on Monday May 29, 2023 @05:14AM (#36112171)
And if they’re scraping using “serverless” compute? It’s distributed, but could be used without “meaning” to attack. That seems to be what happened to Archive (they said AWS, could be ECS or Lambda, idk).

FWIW this thread inspired me to implement Cloudflare Turnstile on one of my pages - highly recommend. As compared to reCAPTCHA your users are never wasting their life away clicking on traffic signs, and as compared to mCaptcha you don’t have to host the server yourself.

Re:Let us serve you, but don't bring us down by geraldwhen on Monday May 29, 2023 @07:19AM (#36112857)
Extremely unlikely that was lambda unless the user liked to light money on fire.
Re:Let us serve you, but don't bring us down by jakear on Monday May 29, 2023 @09:13AM (#36113625)
Well they were an "AI Startup"....
Re:Let us serve you, but don't bring us down by marginalia_nu on Monday May 29, 2023 @06:11AM (#36112458)
In practice they're often using botnets. It's what makes this such a difficult problem to deal with. If they weren't it would be trivial to rate-limit or block problematic IPs or subnets.
Re:Let us serve you, but don't bring us down by RugnirViking on Monday May 29, 2023 @04:22PM (#36117669)
as I mentioned in the post: why would a legitimate scraper be using a botnet?
Re:Let us serve you, but don't bring us down by marginalia_nu on Tuesday May 30, 2023 @03:02AM (#36121925)
In most cases, they aren't legitimate scrapers. They have a complete disregard for the resources they use from the websites they scrape and use a botnet to hide their point of origin.
Re:Let us serve you, but don't bring us down by tiagod on Monday May 29, 2023 @06:38AM (#36112595)
Even if their scraping operation is centralized, it's common to use residential proxy providers which spread the activity over a big number of IPs.
Re:Let us serve you, but don't bring us down by riedel on Monday May 29, 2023 @04:51AM (#36112052)
The problem to me seems that it needs to scale with the number of requests. So PoW effectively burns energy.

As the problem with captchas, is rather who profits from them and who could track users, it seems that with an OCR system to be protected, it is most reasonable to actually give OCR tasks to humans. IMHO this is far more sustainable and people would understand the value: there is nothing bad in improving ML in general. Maybe someone could even define a sensible PoW task for OCR but I doubt it...

Re:Let us serve you, but don't bring us down by RockRobotRock on Monday May 29, 2023 @03:40AM (#36111665)
hCaptcha's accessibility model seems quite good to me: https://www.hcaptcha.com/accessibility
Re:Let us serve you, but don't bring us down by fsckboy on Monday May 29, 2023 @03:50AM (#36111724)
proof of work sounds accessible to me
Re:Let us serve you, but don't bring us down by bramd on Monday May 29, 2023 @05:38AM (#36112292)
I disagree. To "solve" their CAPTCHAs I had to register by providing a working email address. I don't encounter HCAPTCHA problems that often, so when I need to solve a new one usually my cookie has expired and I have to reopen the link to get a new one before being able to continue. I just store such links in my password manager, but imagine you have to find an email with the link they sent you over a year ago before being able to just continue on with what you were doing. And even then, depending on ad blocking/privacy settings their cookie may not even work.

I think this whole thing is a big hurdle just because I'm unable to solve visual puzzles. Besides, having a company collecting email addresses of people who are disabled in one way or another and giving them an identifying cookie is a privacy/data disaster waiting to happen.

That being said, I think the audio alternatives for visual CAPTCHAs are also unacceptable. Even if you can hear them, they may be hard to solve especially if they are not provided in your mother tongue. I think we can and should be able to do better by now

Re:Let us serve you, but don't bring us down by RockRobotRock on Monday May 29, 2023 @11:06AM (#36114691)
Good points
Re:Let us serve you, but don't bring us down by ranger_danger on Monday May 29, 2023 @03:57AM (#36111766)
There is also this proof-of-work solution https://gitgud.io/fatchan/haproxy-protection/
Re:Let us serve you, but don't bring us down by RobotToaster on Monday May 29, 2023 @04:36AM (#36111978)
There's also (the imaginatively named) powcaptcha https://git.sequentialread.com/forest/pow-captcha
Re:Let us serve you, but don't bring us down by tambourine_man on Monday May 29, 2023 @07:18AM (#36112853)
I got interested in mCaptcha, followed your link, but couldn’t find anywhere an example of what the end user would deal with. What kind of PoW are we talking about?
Re:Let us serve you, but don't bring us down by m3at on Monday May 29, 2023 @09:56AM (#36114016)
Re:Let us serve you, but don't bring us down by tambourine_man on Monday May 29, 2023 @12:49PM (#36115608)
Thanks, the GitHub page is much better.
Re:Let us serve you, but don't bring us down by dicknuckle on Monday May 29, 2023 @10:35AM (#36114420)
Did you click on Link to Widget? It's just above the video link.
Re:Let us serve you, but don't bring us down by Zuiii on Monday May 29, 2023 @10:01PM (#36120387)
> It applies a Proof-of-Work like algorithm (not blockchain-related)

If you're going to waste my energy to do proof-of-work anyway, I'd rather you use it for something useful (even mining crypto-currency to pay for server costs) rather than let it go to waste.

Re:Let us serve you, but don't bring us down by Szpadel on Monday May 29, 2023 @01:58AM (#36111141)
I had similar issue for one of our clients. My strategy to not affect legit users was to enable mitigations if global traffic crossed some threshold.

eg. in your case this could mean if traffic is above eg. 75QPS then captcha is enabled, and if it's below that it's disabled.

I don't know what tech stack you are using, but nice trick that i figured out was to abuse rate limiting to detect global traffic (doing if branch with rate limit with const as client id)

Re:Let us serve you, but don't bring us down by pfooti on Monday May 29, 2023 @02:12AM (#36111202)
That is more or less what I landed on myself. (Not quite, but similar reactive configs based on traffic thresholds).

For a while, we had to just set off pagers when global traffic exceeded a threshold and manually toggle the extra hardening, but eventually it became a lot more reactive.

Re:Let us serve you, but don't bring us down by ricardo81 on Monday May 29, 2023 @02:27AM (#36111279)
Understandable. I've seen services that offer residential IP address proxies for as low as $1/GB. FWIW the particular service in mind actually pays the IP owners who opt into it.

I guess your tool is asking the registries if domains are registered.

Re:Let us serve you, but don't bring us down by WA on Monday May 29, 2023 @03:16AM (#36111537)
I usually make it a two step process:

  host example.com
If this returns with an IP address, no need to talk to a registrar. Only if there is no IP address, I go with

  whois example.com
Re:Let us serve you, but don't bring us down by schoen on Monday May 29, 2023 @03:37AM (#36111653)
You could also do an in-between step of

  host -t soa example.com
which should give you domains that have any DNS record at all, not just an A record.
Re:Let us serve you, but don't bring us down by remram on Monday May 29, 2023 @05:28PM (#36118304)
Is there still a point talking to the registrar then? How common is it for a domain to exist with the registrar but have no SOA record?
Re:Let us serve you, but don't bring us down by schoen on Monday May 29, 2023 @10:27PM (#36120509)
Hmmm, I'd have to think about this more to be sure. I'm not immediately positive of the answer.

If the registrant creates any DNS records at all, then the SOA will need to exist for the zone to be valid; but I don't recall whether the registrar is or isn't required to publish a zone for a registered domain that otherwise contains no records. (Also whether the registrar is required to inform the registry of authoritative nameservers for the domain at all times from the moment that the domain is registered, and then whether that information would lead to the synthesis of a SOA record.)

I guess I can either try this (if I could find a no-frills-enough registrar that doesn't create any records at all for add-on hosting services or domain parking) or try to take some more ICANN coursework to find out the answer.

Or maybe someone else reading this thread knows whether we can have a domain in practice that is registered but has no published SOA.

Re:Let us serve you, but don't bring us down by Pmop on Monday May 29, 2023 @03:36AM (#36111651)
There's a demand, why not supply it, and make money while you are at it?

This reminds me of the RMT driven botting problem in WoW (World of Warcraft). Instead of fighting the neverending game of cat and mouse against botters, Blizzard just decided to supply the long reprimanded demand for in-game currency by creating the WoW token, and they make money while they're at.

Re:Let us serve you, but don't bring us down by emodendroket on Monday May 29, 2023 @12:43PM (#36115547)
If such a simple mitigation as adding captchas worked then it seems like the value is pretty marginal, plus it sounds like the limit is upstream.
Re:Let us serve you, but don't bring us down by tyingq on Monday May 29, 2023 @08:20AM (#36113230)
If you can detect it reliably, poisoning them with bad answers might be enough to cause them to find an easier target.
Re:Let us serve you, but don't bring us down by dspillett on Monday May 29, 2023 @08:52AM (#36113450)
Be careful with that. A friend once did something similar to an active scraper who then went off and set his site up for a full blown DDoS.

He knew that was the reason for the intentional DDoS due to messages (along the lines of “think it is funny to poison my information do you?”) in the query string of the bulk requests. Like unpleasant fools making a big noise in shops because they aren't served immediately after cutting in line or some such, the entitled can be quite petty when actively taken to task for the inconvenience they cause.

Passive defences are safer in that regard, assuming you don't get into an arms race with the scrapers, though are unfortunately more likely to mildly inconvenience your good users.

Re:Let us serve you, but don't bring us down by tyingq on Monday May 29, 2023 @08:55AM (#36113476)
That's fair. Perhaps a middle-ground of poisoned answers that look like overload related errors.

Though I did have success once stopping hot-linked images by serving up images that didn't fit well with the sensibilities of the internet forum that was hotlinking them. It had the advantage of looking like the people in the forum posting had deliberately chosen to post the image. Serving different images depending on client ip made for fun too, as they argued with each other about why they posted "that".

Re:Let us serve you, but don't bring us down by dspillett on Monday May 29, 2023 @11:38AM (#36114963)
> Serving different images depending on client ip made for fun too, as they argued with each other about why they posted "that".

Evil. I like it.

Re:Let us serve you, but don't bring us down by scotty79 on Monday May 29, 2023 @12:27PM (#36115412)
I think you could make your requests two step.

If somebody wants to access endpoint you might send him a challenge first. Random text. The client must append to the text some other text chosen by him, so that when you calculate sha256 on concatenated text, first byte or two of it will be zeros.

To access your actual endpoint client needs to send that generated text and you can check it if it results in the required number of zeros. You might demand more zeros in times of heavier load. Each additional bit that you require to be zero increases number of random attempts to find the text by a factor of two.

To make stuff easier for yourself the challenge text instead of being random might be a hash of clients request parameters and some secret salt. Then you don't have to remember the text or any context at all between client requests. You can regenerate it when the client sends second requests with answer.

Honestly I don't know why this isn't a standard option in frameworks for building public facing apis that are expected to be used reasonably.

Re:Let us serve you, but don't bring us down by hombre_fatal on Monday May 29, 2023 @06:13PM (#36118730)
Because it doesn’t accomplish anything. Things take longer for honest users while botnet abusers don’t even notice that the rented hardware is burning more CPU.
Re:Let us serve you, but don't bring us down by scotty79 on Monday May 29, 2023 @07:15PM (#36119241)
For honest users it's not noticeable in normal conditions. But the DDOSer will DDOS themselves. They might make your service slow down when they attack for the users but not because your server gets swamped just because you choose to increase the difficulty of the challenge while you are attacked. DDOSers will notice because they won't be able to make requests as fast. At least not the ones that are costly for you. It's an enforced client side throtling that affects even bad actors.

Generating challenges is really cheap. Calculating a single SHA256 or sth out of a querystring+salt. Can be done on separate layer so requests without valid PoW won't even register on your main system.

Re:Let us serve you, but don't bring us down by hombre_fatal on Tuesday May 30, 2023 @11:42AM (#36126177)
I think the part you're not addressing is the fact that DDOSers aren't using their own hardware and more importantly: their request still goes through at the end so what do they care if it took 2000ms longer?

I actually do like your puzzle challenge idea from an obfuscation standpoint of making an API less attractive for clients that aren't your own, though. A challenge system + an annoying format like Protobufs instead of JSON is too much work for a lot of abusers.

Biggest problem with DDOS though is that if the volume is even reaching your application server, you're probably hosed.

Re:Let us serve you, but don't bring us down by scotty79 on Tuesday May 30, 2023 @10:29PM (#36133803)
> their request still goes through at the end so what do they care if it took 2000ms longer?

It means that on this hardware they can make one request per two seconds not thousands per second.

And it affects all of the hardware under the control of an attacker, so his attack becomes thousands times less dangerous.

> Biggest problem with DDOS though is that if the volume is even reaching your application server, you're probably hosed.

That's why I'm suggesting that challenge generation and validation can be done on separate machines. So your application servers can be safe.

Obfuscation is a valid point too.

I thought about it for a bit, made some experiments. Now I think the challenge should be completely random but the server needs to keep track of recently issued challenges and solved challenges to prevent reusing of already calculated solutions. I think bloom filters would be perfect for that because some small percentage of false negatives doesn't matter.

Re:Let us serve you, but don't bring us down by elliotto on Monday May 29, 2023 @12:29PM (#36115431)
It's always interesting to see these prisoner's dilemma / tragedy of the commons show up in networking. If they hadn't abused the commons it would have worked out better for everyone.