Tags: python pwn 

Rating:


# 999 bottles
- Category: PWN
- Rating: Easy

In this challenge we are given 999 ELF files, each one of them accept one ASCCII character, we are supposed to find the right character in order to find the flag.

so brute forcing is the easiest way to do it obviously.

## Solution:

```python
from pwn import *
import string
context.log_level = 'critical'

flag = []

for j in range(1, 1000):
for i in string.printable:
r = process('./%s.c.out' % str(j).zfill(3))
r.recv()
r.send(i)
res = r.recv()
if 'OK!' in res:
flag.append(i)
print ''.join(flag)
r.close()
break
r.close()

```
by runnig this script we get this:
![capture1](Capture1.PNG)

in a few minutes we can see the flag :
![capture2](Capture2.PNG)

## flag:

`RITSEC{AuT057v}`

Original writeup (https://github.com/hamza-amjoun/ctf-writeups/blob/master/RITSEC_2019/999_bottles/README.md).