> For the complete documentation index, see [llms.txt](https://meowsec.gitbook.io/w1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://meowsec.gitbook.io/w1/tryhackme/thmw/network-services.md).

# Network services

This room from [tryHackMe](https://tryhackme.com/room/networkservices) introduces some good concept on network service security. Here, I have included some necessary concept from THM and other sources as a note. I also included task answers. Hope this will help readers.

{% hint style="info" %}
No flag is disclosed here.&#x20;
{% endhint %}

### Task 2: Understanding SMB

How SMB works -&#x20;

![](/files/-MZ7f3MJ4VIH5C6u2Mq6)

Unix system uses 'Samba' - which supports SMB. This is also available in Windows.

![](/files/-MZ7fTm2g0m2sfLsdx8B)

### Task 3: Enumerating SMB

A very good tool for enumeration is : [enum4linux](https://github.com/CiscoCXSecurity/enum4linux)&#x20;

In this post, you will find an awesome checklist for SMB enumeration, created by 0xdf: [**Link here**](https://0xdf.gitlab.io/2018/12/02/pwk-notes-smb-enumeration-checklist-update1.html)

![](/files/-MZ7hL4H2bri0aElb7iO)

### Task 4: Exploiting SMB

Methodology for exploiting is&#x20;

* Get any misconfiguration&#x20;
* Get SMB share info

To remotely access the SMB share, we can use smbclient tool :  **`smbclient //[IP]/[SHARE]`**

![](/files/-MZ7jOGMwLMR4WVGtpas)

### Task 5: Understanding Telnet

Telnet -

* A protocol to connect and execute command to a remote server
* Communicates in a plain text, no encryption&#x20;
* Command - **`telnet [IP] [port]`**

![](/files/-MZ7kk5fZMgrbxyDcW1f)

### Task 6: Enumerating Telnet

Sometime only **nmap** scan is enough to enumerate.

![](/files/-MZ7lGXL6-7CdCmNMk3w)

### Task 7: Exploiting Telnet

Two very good sites to search Exploit:&#x20;

1. <https://www.cvedetails.com/>
2. <https://cve.mitre.org/>

![Screen shot 1](/files/-MZ7pb31cYUn66WrAz9y)

![Screen shot 2](/files/-MZ7pl0wl7TtvlFnQSla)

### Task 8: Understanding FTP

File Transfer Protocol (FTP) -

* This allows to transfer file over network
* FTP operates using two channels
  * Command channel for transmitting command
  * Data channel to transfer data
* This has two types of connections
  * Active FTP connection - client opens a port and listen, server connects to it
  * Passive FTP connection - server opens a port and listen passively, clients connect to it

![](/files/-MZ7uSpeUt884uZrb_lp)

### Task 9: Enumerating FTP

Nmap scan can reveal good info about FTP running on a server.

![](/files/-Mb5FJEGCUXzUO7HdmUW)

### Task 10: Exploiting FTP

2 ways to exploit -&#x20;

* MITM: as the FTP communication is unencrypted, attacker can read the plain text info
* Brute force: the password can be weak often. So brute forcing it can give us access

Hydra command to brute force password:

**`hydra -t 4 -l [user] -P [wordlist location] -vV [IP] ftp`**

![](/files/-Mb5G_tjwJ61ERSFWpnr)
