---
# System prepended metadata

title: bytemancy 1
tags: [CTF]

---

# Description
Can you conjure the right bytes?
The program's source code can be downloaded [here](https://challenge-files.picoctf.net/c_foggy_cliff/b04a1829da5f649435a6903647d126ba60a3d04a250e8f7e3973b2ce121beba5/app.py).
Connect to the program with netcat: `$ nc foggy-cliff.picoctf.net 50121`

# Hints
1. No copy-pasta, please - use Python!

# Solution
下載檔案後，是一個名為 app.py 的檔案
```python
while(True):
  try:
    print('⊹──────[ BYTEMANCY-1 ]──────⊹')
    print("☍⟐☉⟊☽☈⟁⧋⟡☍⟐☉⟊☽☈⟁⧋⟡☍⟐☉⟊☽☈⟁⧋⟡☍⟐")
    print()
    print('Send me ASCII DECIMAL 101 1751 times, side-by-side, no space.')
    print()
    print("☍⟐☉⟊☽☈⟁⧋⟡☍⟐☉⟊☽☈⟁⧋⟡☍⟐☉⟊☽☈⟁⧋⟡☍⟐")
    print('⊹─────────────⟡─────────────⊹')
    user_input = input('==> ')
    if user_input == "\x65"*1751:
      print(open("./flag.txt", "r").read())
      break
    else:
      print("That wasn't it. I got: " + str(user_input))
      print()
      print()
      print()
  except Exception as e:
    print(e)
    break
```

\x65 就是 e
我們需要輸入 1751 個 e 就會拿到 flag
所以使用 python 串 nc 就可以了 
`python -c "print('e' * 1751)" | nc foggy-cliff.picoctf.net 50121`