# 06 - random

## The Challenge

Daddy, teach me how to use random value in programming!

ssh <random@pwnable.kr> -p2222 (pw:guest)

## The Solution

![](https://3609409146-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFKoejdbAjmSQIWMVBk%2F-MGO8SsHtEuW5UvSfA_D%2F-MGPMHCLoLXzZoiVVoo-%2Fimage.png?alt=media\&token=644c909e-6ea5-4a1f-968e-1361b315ff96)

Whats off here? This is not how you use rand()! [This](https://stackoverflow.com/questions/1108780/why-do-i-always-get-the-same-sequence-of-random-numbers-with-rand) is how you use rand.

As a result of that, the same number will be generated over and over again. Here it is:

![](https://3609409146-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFKoejdbAjmSQIWMVBk%2F-MGO8SsHtEuW5UvSfA_D%2F-MGPN0p8QLQ7rrmptnia%2Fimage.png?alt=media\&token=b93d7d0d-0809-4f61-87f8-ecf056ab6bce)

After XORing with 0xdeadbeef and translating to a number:

&#x20;

![](https://3609409146-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MFKoejdbAjmSQIWMVBk%2F-MGO8SsHtEuW5UvSfA_D%2F-MGPNJQiDR9806EJYw4L%2Fimage.png?alt=media\&token=f0a7958f-79a7-4b5b-9b5d-a37046cf759a)
