> For the complete documentation index, see [llms.txt](https://aditya-3.gitbook.io/oscp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aditya-3.gitbook.io/oscp/readme/walkthroughs/pg-practice/authby/242.md).

# 242

We have a webpage and it asks for authentication![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-87bb18d66cafca30156f4158085f3e49860e8212%2Fa0e0e4bd7f008daef368d609d37e9bb6.png?alt=media)

Now using the credentials obtained from ftp at \[\[PG Practice/AuthBy/21]]

We can login to the webpage: offsec:elite ![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-8efb89e3f42dd971dd1818ac314fac79c8b7a35f%2Fb09a36fb2ed949008ed11260ac9351ee.png?alt=media)

Now we can see the page. It is the same as the *index.php* file in ftp ![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-5fed06c9991aa8b170cbc534749ff5f9c61a6fbd%2F5602f3778f9fb3c94698e2f8a5094ec3.png?alt=media) ![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-3ff44884d35e7e22b10aa78146aeca0793c9b9b2%2F816f7332914058a1499545b2a0d9f980.png?alt=media)

So we can try to put a text file and check if it is accessible

```
echo "This is a test" > test.txt
```

Now in ftp:

```
put test.txt
```

![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-5ad39b18847b8e048a9aece5bed4cd83d768b983%2F628982f7678c47994290b5ce5d5cb6e1.png?alt=media) It uploaded

Now we can try to access this file in the webpage![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-d9a89c32ef6c542c1fb3d4d2fb3da86e2d17cae4%2Fcffa20ea72194f7ca6a0ffc8eabe3190.png?alt=media) It works.

We can now try putting a php reverse shell. Go to revshells.com and get a reverse shell: ![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-e62a008a07471609b62fb9a56a28e8affc2d5e2b%2F05e9f7cb59c622660f7878489ed33d52.png?alt=media) We can save this in *php-reverse-shell.php* file

And now upload in ftp:

```
put php-reverse-shell.php
```

and access it in browser: <http://192.168.164.46:242/php-reverse-shell.php>

We get a shell:

```
rlwrap nc -nlvp 3389
```

![](https://2519178678-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuE2sPgM0QY6KfiTIG8Vs%2Fuploads%2Fgit-blob-19daa9196df8a343e461b0868c3fc4a22b3d1bc3%2Fb645eefa707314be4dadf1634f04918e.png?alt=media)


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://aditya-3.gitbook.io/oscp/readme/walkthroughs/pg-practice/authby/242.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
