> For the complete documentation index, see [llms.txt](https://docs.cooku222.kr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cooku222.kr/security/web-hacking/dreamhack/dreamhack-php7cmp4re.md).

# \[Dreamhack] php7cmp4re

#### 문제 링크

<https://dreamhack.io/wargame/challenges/1113>

[php7cmp4reDescription php 7.4로 작성된 페이지입니다. 알맞은 Input 값을 입력하고 플래그를 획득하세요. 플래그 형식은 DH{} 입니다.dreamhack.io](https://dreamhack.io/wargame/challenges/1113)

&#x20;

#### 문제

<figure><img src="https://blog.kakaocdn.net/dna/DlmD0/btsEhpGp2Kw/AAAAAAAAAAAAAAAAAAAAAOOpklSprhhVQP35cDD1HlRavhBIE0uz0qpvDDSBLKng/img.jpg?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=eje8%2BQhmYCHcxLAOtV5x493X15s%3D" alt="" height="342" width="526"><figcaption></figcaption></figure>

#### 풀이

<figure><img src="https://blog.kakaocdn.net/dna/bZR20y/btsEhUzgNTB/AAAAAAAAAAAAAAAAAAAAAHG5Q_yfbhVvKRqNZQUsemY_OFZ02hE0e0E4TgxaENG4/img.jpg?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=6G83qgePlGpRZ7ZUC9owU5X9v04%3D" alt="" height="228" width="612"><figcaption></figcaption></figure>

이런 화면이 처음에 등장하는데, 여기에 무슨 글자를 넣을지 알려면 코드를 분석해야하므로 php 코드를 살펴보았다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/nwneN/btsEeEYvCZ0/AAAAAAAAAAAAAAAAAAAAAIwf9FFEO_xwUIaaDT0t5OnTpIIMeGuEjQyBscf8QlxU/img.jpg?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=sbY82X%2BnV0uzKMUPkI67bvcMXIk%3D" alt="" height="428" width="552"><figcaption></figcaption></figure>

이런 조건문이 한 단락 나오는데, 이 조건문에 맞게 인풋 값을 입력해주면 된다.\
1\) input\_1과 input\_2에는 빈칸만 아니면 모든 값이 들어갈 수 있다.\
2\) input\_1의 길이가 4 미만이어야 한다.\
3\) input\_1이 아스키코드 8("8"이라 하였으므로 여기선 숫자 8이 아니라 아스키 코드 8로 해석이 된다) 이하 '이면서(&&)' 7.A 초과 (&&) 7.9미만\
4\) input\_2의 길이가 1보다 크고 3미만 = 길이 값이 2\
5\) input\_2의 값이 숫자 74보단 작지만 아스키코드 74보단 커야한다(여기서도 "74"라고 했으므로 숫자가 아니라 문자값이라는 것을 알 수 있다.)\
이 다섯가지 조건을 충족하는 입력값으로 아스키코드 표값을 사용한다. \
input\_1에는 7.9보다 높은 값을 입력 -> 7.90은 자릿수 초과 -> 따라서 아스키코드 표에서 90을 나타내는 :을 붙여 7.:을 넣음\
input\_2에는 두자리이면서 경계값인 74를 나타내는 아스키코드 J로 J0을 만들어 넣어주었다.&#x20;

<figure><img src="https://blog.kakaocdn.net/dna/bhH6ur/btsEf1skyzU/AAAAAAAAAAAAAAAAAAAAAIYHwS02pvZVCwuTfeT6jy0Wdr7580K2Rb0HRs3tcZ2C/img.png?credential=yqXZFxpELC7KVnFOS48ylbz2pIh7yKj8&#x26;expires=1782831599&#x26;allow_ip=&#x26;allow_referer=&#x26;signature=QFnmllp4PmTZjO7DBEtT13Id0xI%3D" alt="" height="147" width="692"><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cooku222.kr/security/web-hacking/dreamhack/dreamhack-php7cmp4re.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
