by omribahumi · 8y ago · 0 comments
How about make the login process more resource intensive on the browser side, by running some intensive javascript code before sending it to the server?
The trick would be to make this much more intensive on the client side (say 1s of CPU time), while keeping this relatively easy for the server (say 1ms). We're trying to waste their resources, not ours.
One way I can think of:
1. server sends a random seed to the client
2. client calculates 1000 hashes based an random numbers generated from the seed, something like hash(rand() + password) and sends them to the server
3. server picks a one of those and validates it. In case the hash isn't valid, you'll respond with an invalid password, so the client won't be able to distinguish between a failed authentication because of hash validation or because of a wrong password.
Do exactly what bitcoin does: You send a random prefix and require the client to find a random suffix so that hash(prefix+suffix) ends with, say 4 zeros.
Stay away from trying to increase computational overhead. Everyone thinks computation is "free", but it isn't. There is a turbine somewhere cranking out annoyed pixies to drive your computation war with this botnet. The fact some actor has decided to distribute the energy cost to someone else doesn't mean you have to double down on the waste by multiplying the botnet operator's energy expenditure being dealt with by oblivious user's a thousandfold.
It's a bit like global thermonuclear warfare. The only winning mover is not to play.
The least resource intensive way of dealing with it is just detection and either preemptive drop (no more useful info) or if you want to get creative, start doing some whois digging with IP's and start blowing up some operator's inboxes with questions as to why you are getting malicious login traffic from their IP block so they can start running down the source from their end.
This is the Internet. We don't know everything going through it, but most operator's are generally open to trying to keep transits clean if they are made aware of a problem in a way that doesn't seem like a DDoS aimed at their time.
I guess you can fine tune how complex you want this to be by changing the number of zeros you require.
A friend suggested something else - make the client bruteforce a short RSA key (of say, 100 bits)
Thanks!
Can be used like a captcha or placed in between a process. You just specify how many hashes need to be completed before proceeding.
but are these scripts sophisticated enough to run JS etc?