> For the complete documentation index, see [llms.txt](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cybersecurity-cloud-and-it-notes.gitbook.io/kyles-cybersecurity-cloud-and-it-gitbook/hack-the-box/labs/offense/tier-0-pen-testing/ftp-basics-and-network-scanning-for-pen-testing-fawn.md).

# FTP Basics and Network Scanning for Pen Testing (Fawn)

I was able to answer the first few flag questions without looking up the answers, luckily.

<figure><img src="/files/TSxTO8hJHuxmzFFoxtAm" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/bme3XBy3Sx1j95qdUHy4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/coh8MMMM6SYn5kBittRV" alt=""><figcaption></figcaption></figure>

For task 5 I shamelessly asked X.AI (GROK 2) the answer:

<figure><img src="/files/WJac15LHLMmmp6IYPyD0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/EsH8yHYaHPXlHiXpu8B8" alt=""><figcaption></figcaption></figure>

I went on ahead and first used NMAP to just scan to see what ports were open, seems they only left the ftp port or port 21 open, interestingly.&#x20;

I then typed the command that Grok gave me.

<figure><img src="/files/K5nuBLZw7y4TEADAHiBq" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/2d3Ilu0uZPBsbZOofBnR" alt=""><figcaption></figcaption></figure>

It showed the answer for the next task in the output on the linux terminal already:

<figure><img src="/files/zBaFiZWxHyIwDeOhUjDs" alt=""><figcaption></figcaption></figure>

Hilariously, I misunderstood the hinted text in the next task so I entered in "ftp -h" in the terminal, and it gave me the help menu by default, showing that the real command is "ftp -?"

<figure><img src="/files/eGoSKu8JZ3WPqMA9IRt9" alt=""><figcaption></figcaption></figure>

I ended up guessing this one, lol.

<figure><img src="/files/Aqr6prmPsJEdP5Lo0560" alt=""><figcaption></figcaption></figure>

I misread the question task here so jumped the gun and put "220" for the response code, which was incorrect, that is the code for ready for new user, while htb was looking for successful login response code of "230"

<figure><img src="/files/6CrLPRZojs5zHpm8tlpd" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6zmi3LSXDsOe6qFh0Gql" alt=""><figcaption></figcaption></figure>

I knew the answer to this task already luckily:

<figure><img src="/files/tUyMuQ6yJSosr4WSnxXk" alt=""><figcaption></figcaption></figure>

Again, I didn't know the answer to the following task so I shamelessly asked Grok 2 for the answer. It's really helpful since it not only told me how to download the file but also how to specify where I want to download it, change the filepath/ directory, etc.

<figure><img src="/files/79lPB0c8cLz5VS3bI3YC" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/BXTIVxxLmUdddW49d3vc" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/QvyvIyZqZFFUQcHkiqL4" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/N8UPuDwnFy0d8AMgZToE" alt=""><figcaption></figcaption></figure>

So after relogging back into the ftp since it timed out, I entered the "ls" command to list the files on the ftp server. There appeared to be only one inconspicuous file obviously named "flag.txt." I entered the command 'get flag.txt' and it downloaded for me, luckily into a directory I could easily find without having to do a lot of fancy stuff.

<figure><img src="/files/hR204DszJ40OfKVm7IQy" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/lRhk1qWVF52nRrDwizr2" alt=""><figcaption></figcaption></figure>

I then exited out of the ftp server with "ctrl z" in the terminal, entered "ls" to list my current directory's files, and then entered "cat flag.txt" to output the text from the file. I then copy and pasted it to the text field of the last task.

<figure><img src="/files/j5JwAU3vbVEHIvBBk0rA" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7OOGRb5WB1lTbhUVSKUB" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jHAZpqyQcdFEWBAM88Wb" alt=""><figcaption></figcaption></figure>
