GithubHelp home page GithubHelp logo

almiche / backatcha Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 60 KB

Uno-Reverse for DDOS attacks (Production level crap)

License: MIT License

Ruby 98.33% HTML 1.67%
rack middleware uno reverse-card-sorting ruby social-distancing

backatcha's Introduction

BackAtCha BackAt Gem Version downloads Tests Code Cov == 100% Lint license bullshit?

Oh hey! Didn't see you there! Did I tell you about the time my friend @jusleg accidentally ordered me some "Ben and Jerry's Cookies Dough Ice Cream" © and how I then promplty reciprocated with 3 "SpongeBob Squarepants" © popsickles... Oh what's that you don't care? You're just here to find out what this repo is about? Well that's kinda rude but ok...

What is this ?

Ok picture this the other day I was taking my daily scheduled self isolation walk, if you're looking at this repo in the year 2133 and wondering what the hell is a social isolation walk here's a diagram to show you what the looks like in a bit more detail: social distancing Technically speaking this involves the following:

  • You maintain at least 6 ft of distance from any living being
  • You muffle any semblance of a cough because otherwise people will look at you like you're a zombie
  • You awe at how empty the streets are
  • You post a story on the gram with the #stayhome tag to let everyone know that you're being active and they're not

But back to this, this repo. So on said walk I started thinking to myself "What if you could UNO© Reverse Card a DDOS attacker by sending them back a giant packet over http from any Rack based application?" and then I thought "You're fairly decent at Ruby why not!". So that's when I embarked on a wild coding flurry that night. I wanted to make sure that this middleware was tested to the nines. So I bootstrapped a quick testing framework using Sinatra, Mocha and Rack's MockRequest tooling in order to simulate incoming http request.

Essentially what this middleware does is it grabs any incoming http request and checks for the Device-Memory header and then using Famingo Labs' patent pending memoization technology grabs the response coming out of the Rack app in question and multiplies the payload until it matches the requestee's Device-Memory size. So I finished writing all of this code up, with 100% code coverage, complete with rake tasks for automation, 0 errors with RuboCop and ready to take on the world.

I then messaged my friend @jusleg and it went a little something like this:

Me: yo dawg get ready soon next level gem incoming [100% code coverage](https://user-images.githubusercontent.com/14715156/78518827-898d7800-778f-11ea-9477-0ac91edb47c1.png) it'll have static analysis
Justin: what gem
Me: brand new gem being created rn
Justin: what purpose
Me: oufffff you will know soon
Justin: are you even using sorbet
Me: ahhhh shit I should damn it
Justin: Watch this great wholesome tiktok
Me: Here's a link to a great article I was reading the other day in the economist on hyperparameters
Justin: Read it already
Justin: Wait a minute aren't browsers already resillient against large http packets being shot at them
Me: That's a good point but what about this [this](https://www.youtube.com/watch?v=l6quREmoPVM)
Justin: I could go for some five guys for sure
Me: Also according to this screenshot there might be a chance for this thing afterall (below)
Records Download Time* Chrome (OS X) Firefox (OS X) Safari (OS X) IE9 (Win 7)
1,000,000 (153.37MB) 19:51 DOM Ready: 16.4s
RAM: 1.09GB
Loading: browser hang
Loaded: usable, 1 tab crash
DOM Ready: 14.29s
RAM: 1.82GB
Loading: untestable
Loaded: usable
DOM Ready: 5.13s
RAM: 1.76GB
Loading: browser hang
Loaded: usable
Data failed to load and browser became unresponsive.
nice
750,000 (115.13MB) 14:54 DOM Ready: 12.24s
RAM: 727.3MB
Loading: browser hang
Loaded: usable
DOM Ready: 13.8s
RAM: 1.48GB
Loading: browser hang
Loaded: usable
DOM Ready: 3.82s
RAM: 1.39GB
Loading: barely usable
Loaded: usable
Data failed to load and browser became unresponsive.
nice
500,000 (76.69MB) 9:56 DOM Ready: 9.13s
RAM: 512.0MB
Loading: browser hang
Loaded: usable
DOM Ready: 12.19s
RAM: 1.14G
Loading: browser hang
Loaded: usable
DOM Ready: 2.49s
RAM: 1.02GB
Loading: usable
Loaded: usable
Data failed to load and browser became unresponsive.
nice

Data from https://joshzeigler.com/technology/web-development/how-big-is-too-big-for-json

And with that I kept pressing forward, created some more tests for extra resiliency and even created some github actions to push this useless gem onto rubygems.

Did I actually try this on a real rack app?

Nope, because 100% code covered unit testing is enough isn't it?

What's next?

As for me, I'm going to playing around with my new guitar and taking some more self isolation walks. As for the gem, I'm going to be adding in sorbet type checking and making sure it works with TruffleRuby.

The Pivot

After discussing this further with @jusleg we've come to the conclusion that a more pressing right now is creating a service which would allow blog writers to embed ModelViews into Medium articles. So look out for that next time you write a Medium article.

backatcha's People

Contributors

almiche avatar jusleg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

backatcha's Issues

social distance scale up request

The diagram included in the README suggests that social distancing only requires a 3ft radius surrounding an individual.

The Centers for Disease Control and Prevention (CDC) have provided guidance to Stay at least 6 feet (2 meters) from other people.

Here is the diagram in question:
image

memory gone

My VM doesn't have 16GB of free space for this, what should I do? 🧐🤨

Social Distancing

Our README currently states

You maintain at least 6 ft of distance from any living being

However may experts state that the CDCs recommendation of 6ft isn't nearly enough (1).

Thus I suggest we consult some experts and update the distance required between individuals.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.