1. get access to a lottery ticket terminal
2. get access to a router firmware in the lottery datacenter en route to the database
3. wait for the query to get the winning numbers from the database
4. hold that packet and submit an INSERT into the database with you as the winning number at a predetermined date/time in the past
5. release the packet to query the database
6. hack the terminal to print your winning ticket with the predetermined date/time in the past
7. profit?
It probably doesn't work, but it was fun thinking about when I was younger.