This shows how weak Ruby’s random number generator is.
Fire up the rails server and point your browser to: localhost:3000/lottos This generates six random lotto numbers between 1 and 49.
Now, gather at least eight sets of numbers using the following command, at least eight times: curl localhost:3000/lottos >> gathered.txt
Grab untwister from github.com/altf4/untwister and compile and run it: ./untwister -i ../fakelotto/gathered.txt -m 1 -M 50 -r ruby-rand
This will determine the seed. Run a rake task with the determined seed, and see a set of twenty lotto picks: bundle exec rake tasks:attack
Buy those lotto tickets. Win! Not really. But if you point your browser back to: localhost:3000/lottos you’ll see one of those sets of numbers show up.