Skip to the content.

đź”— Link to the Room

🏷️ Table of Contents

  1. Understanding SMB
  2. Enumerating SMB
  3. Exploiting SMB
  4. Understanding Telnet
  5. Enumerating Telnet
  6. Exploiting Telnet
  7. Understanding FTP
  8. Enumerating FTP
  9. Exploiting FTP

📚 Study Notes

Understanding SMB

image


❓What does SMB stand for?Server Message Block

❓What type of protocol is SMB?response-request

❓What protocol suite do clients use to connect to the server?TCP/IP

❓What systems does Samba run on?Unix

Enumerating SMB

First, I recommend you to start the target machine and wait for it to fully boot.

The syntax of Enum4Linux: 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)

 

[!TIP] Enum4linux runs multiple Samba-based checks in one command, which makes it great for fast lab work. Using the -a option performs a full basic enumeration in one go — perfect for a first sweep.

 


❓Conduct an nmap scan of your choosing, How many ports are open?3

❓What ports is SMB running on? Provide the ports in ascending order.139/445

❓Let's get started with Enum4Linux, conduct a full basic enumeration. For starters, what is the workgroup name?WORKGROUP

❓What comes up as the name of the machine?POLOSMB

❓What operating system version is running?6.1

❓What share sticks out as something we might want to investigate?profiles

Exploiting SMB

 

 

 

Most useful SMBClient commands to remember:

command what it does
ls or dir list files and folders
cd [dir] change directory
get [file] download a file to your attack machine

 


❓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?smbclient //10.10.10.2/secret -U suit -p 445

❓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.No answer needed

❓Does the share allow anonymous access? Y/N?Y

❓Great! Have a look around for any interesting documents that could contain valuable information. Who can we assume this profile folder belongs to?John Cactus

❓What service has been configured to allow him to work from home?ssh

❓Okay! Now we know this, what directory on the share should we look in?.ssh

❓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?id_rsa

❓What is the smb.txt flag?THM{***_**_***_**?}

Understanding Telnet

[!CAUTION] If you see Telnet enabled during enumeration, it’s often a security red flag. Since credentials travel in clear text, Telnet services are risky and commonly targeted in security testing labs.

 


❓Is Telnet a client-server protocol (Y/N)?Y

❓What has slowly replaced Telnet?SSH

❓How wouold you connect to a Telnet server with the IP 10.10.10.3 on port 23?telnet 10.10.10.3 23

❓The lack of what, means that all Telnet communication is in plaintext?encryption

Enumerating Telnet

[!NOTE] Telnet commonly runs on port 23, so pay extra attention if you see it open in scan results. Service banners from scans can sometimes reveal useful version or configuration details.

 


❓How many ports are open on the target machine? Note: you may need to scan non-standard ports too.1

❓What port is this?8012

❓This port is unassigned, but still lists the protocol it's using, what protocol is this?tcp

❓Now re-run the nmap scan, without the -p- tag, how many ports show up as open?0

❓Based on the title returned to us, what do we think this port could be used for?a backdoor

❓Who could it belong to? Gathering possible usernames is an important step in enumeration.Skidy

Exploiting Telnet

image

[!TIP] Useful CVE search resources: https://www.cvedetails.com/ https://cve.mitre.org/

Always check both known CVEs and configuration mistakes — labs often rely more on misconfigurations than patched vulnerabilities.

 


❓Great! It's and open telnet connection! What welcome message do we receive?SKIDY'S BACKDOOR.

❓Let's try to executing some commands, do we get a return on any input we enter into the telnet session? (Y/N)N

❓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)Y

❓What word does the generated payload start with?mkfifo

❓What would the command look like for the listening port we selected in our payload?nc -lvnp 4444

❓Success! What is the contents of flag.txt?THM{***_***_***_******_****}

Understanding FTP

[!IMPORTANT] Default FTP port is usually 21 for commands.
Because standard FTP is not encrypted, many systems now prefer SFTP or FTPS for secure file transfers.
The official FTP specification is documented in RFC 959 by the IETF.


❓What communications model does FTP use?client-server

❓What's the standard FTP port?21

❓How many modes of FTP connection are there?2

Enumerating FTP


❓How many ports are open on the target machine?3

❓What port is ftp running on?21

❓What variant of FTP is running on it?vsftpd

❓What is the name of the file in the anonymous FTP directory?PUBLIC_NOTICE.txt

❓What do we think a possible username could be?mike

Exploiting FTP

option usage
-l single username
-P password wordlist
-t parallel attempts (speed control)
-vV very verbose output

❓What is the password for the user "mike"?password

❓What is ftp.txt?THM{***_***_***_***_****}