🌌
N/B Writeups
  • CTF Writeups
  • CTFs
    • 2019
      • OverTheWire Advent
    • 2020
      • Midnight Sun
      • Things I learned from DarkCTF
  • Pwnable.kr
    • 01 - fd
    • 02 - col
    • 03 - bof
    • 04 - flag
    • 05 - passcode
    • 06 - random
    • 07 - input
    • 08 - leg
    • 09 - mistake
    • 10 - Shellshock
    • 11 - coin1
    • 12 - blackjack
    • 13 - lotto
    • 14 - cmd1
    • 15 - cmd2
    • 16 - uaf
    • 17 - memcpy
    • 18 - asm
    • 20 - blukat
    • 21 - horcruxes
    • 33 - echo1
    • 34 - echo2
    • 43 - coin2
  • More Pwn
    • Protostar - format4
  • Lord of SQLI
    • Lord of SQLI
Powered by GitBook
On this page
  • The Challenge
  • The Solution

Was this helpful?

  1. Pwnable.kr

13 - lotto

Previous12 - blackjackNext14 - cmd1

Last updated 4 years ago

Was this helpful?

The Challenge

Mommy! I made a lotto program for my homework. do you want to play?

ssh lotto@pwnable.kr -p2222 (pw:guest)

The Solution

The code seems to work overall. It asks the user to input 6 characters [between the ASCII values of 1 - 45]. If the input maches the randomized value we win the lottery and get the flag. This challenge should take a long time to solve unless this faul logic:

Take a closer look. The match variable will be increased six times if one digit from our guess is contained in the lotto string. After several attempts of a single digit repeated six times this should work :)