Tags: scripting programming misc 

Rating:

### Writeup

Simple scripting challenge. Solve script -
```py
from pwn import *
# io = process('../src/chall.py')
io = remote('challs.n00bzunit3d.xyz', 13541)
def solve(x,y):
possible = []
answer = 0
for i in range(1,y):
possible.append(str(i))
for i in possible:
answer += i.count(str(x))
return answer
for i in range(1,101):
if i > 1:
io.readline()
io.readline()
io.readuntil(b'How many ')
line = io.readline().strip()
x = chr(int(line[0]))
y = int(line.replace(f"{x}'s appear till ".encode(),b"").replace(b"?",b""))
answer = solve(x,y)
io.sendline(str(answer).encode())
io.interactive()
```

### Flag - n00bz{4n_345y_pr0gr4mm1ng_ch4ll}

Original writeup (https://github.com/n00bzUnit3d/n00bzCTF2023-OfficalWriteups/tree/master/Misc/Numbers).