# Soccer htb

* **First of all i have scan the ip**

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FXJPjIw6qugX3FV3yUQI4%2F1_x2aB0PXN9nRrmnzwJBnlMg.png?alt=media\&token=d3a70a9d-a514-4d33-b370-57091e720313)
* **Here we find ssh and http port open & we don’t have credential to log into ssh server**
* **then i am going to fuzz the url to show which sites we can go into**
* **then i am goin to add /tiny to the url**
* then we found login page but we don’t have cred let’s try to find default credential for that site

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FBSJA0DeOjNTT7JNEDoKM%2F1_SBiXAp-TG3hFV4xRxlTQNQ.webp?alt=media\&token=29950e14-2597-4112-be6f-b4793ada5aad)

  * **then i find that in their repo in github have a default passowrd**

  <figure><img src="https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FWil2DzT59ywHbgitBnfp%2F1_DLJkAWvY6jN87xUCHAgpUA.webp?alt=media&#x26;token=a819715e-d08b-4d89-bc79-1fd47bad990c" alt=""><figcaption></figcaption></figure>
* **after login as admin i find that i can upload files let’s try to upload php reverse shell**

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FFLxkt4FID9TOowsjyWCQ%2F1_Rdodt0J-3JE_0Bi_UZrKuA.webp?alt=media\&token=2af04214-4143-4f01-86be-d7e6adea45c0)

  ![](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a7435696-0810-4bcc-8765-b0fc872a8eb4/Annotation_2023-03-25_144306.png)

  * it’s success let’s try to make listener and try to order the reverse shell from url

![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FiXoXHaRGzct4Pi98grfp%2F1_rzTKkOowso7UdHPSsqoJLg.png?alt=media\&token=ed2ebb45-b790-48f9-b0f3-6e794f7ef24a)

<figure><img src="https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FvyxlfG5OY4xK0IWqZHwF%2F1_87BxGaYvx3L80-MGHyWIjQ.webp?alt=media&#x26;token=9421e5ea-2b08-4159-bea0-2b64bb3ca480" alt=""><figcaption></figcaption></figure>

* **here we success and get into machine then make shell stability with : `python -c 'import pty;pty.spawn("/bin/bash")'`**
* **let’s try to enumerate the machine with linpeas**
* **i found that we have another subdomain lets add it to /etc/hosts to get it in browser**

![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2F9V78KY69Qo2rJTSyWfik%2F1_ZKhQ2ZUP_zrNQYqjm1XRsw.webp?alt=media\&token=65c4fd71-971e-40b3-9d20-618eaac54855)

* **here we get into and this site provide services such as make tickets for match**
* **then i try to get sqli and search for script to get the request in my terminal**

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2F5TF4usPclgnI2n19HQ8k%2F1_ElbjG1GlOn7WjyvoyLkEJQ.webp?alt=media\&token=119ba5ff-a994-43d1-95fd-a6d79d852395)
* **then i try to use multiple argument with sqlmap tool**

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FDEO5p0zPC3xREL3DDgmp%2F1_9vf4XwajA58HcZxpWqH0Yw.webp?alt=media\&token=25c38b5e-5250-4d01-a8bf-3db39c0f039c)

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FvIPOnPEA7o2DYW7AWccY%2F1_FpAKjhcgtLf3gBbRmkrKXg.webp?alt=media\&token=7f0fed73-f607-43d5-8771-f2e9f73ad40f)
* **after we get cred try to log in ssh server with this credential**

  ![](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b06c0906-e770-408b-ab66-f9f5b792e508/Annotation_2023-03-25_165048.png)

  * **after that i can read user.txt file and get flag**

    ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FqykyIws32mv75w3cm84V%2F1_JvtNkjvhL8z_ykAJy6xrlQ.webp?alt=media\&token=5b6de041-93be-43d6-866d-4aaa2a3b9ca0)
* **then i run linpeas in machine to make enumeration and get that i can write in dstat directory then lets show it**

<figure><img src="https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FIaIsrSTBREiMN4yjCLYm%2F1_U6yXU4mnNVE6QBOFWZ-vsg.webp?alt=media&#x26;token=ae9e0cdd-bb2f-4a05-8111-afe911a1fc1e" alt=""><figcaption></figcaption></figure>

* you can know more than about dstat here :<https://linux.die.net/man/1/dstat>

  ![](https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9e8c716d-1f48-42ff-966e-7d0368af36d7/Annotation_2023-03-26_092721.png)
* after search i find that script that lead to privilege techniques and way to exploit it - i put it in his path and execute it with **`doas`**
* `**doas` it executes commands as other users according to the rules in the `doas.conf`  configuration file you can know about it in :\*\*<https://man.openbsd.org/doas.conf.5>

  ![](https://2140186435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpoPpsF6DyQtOrXy70rxC%2Fuploads%2FEMe0URCsMrudKNUPnKqC%2F1_IhwoIXcRgBnRp2dZBSLysg.webp?alt=media\&token=abddc50e-8114-4420-97d4-32bf7729525e)

  * **here i finished and get root flag**
