METASPLOITABLE- Enumerating SMB user info
Metasploitable is a purposefully vulnerable Linux virtual machine that helps us safely (and of course, ethically) perform penetration testing. This virtual machine is useful for testing security tools and demonstrating common vulnerabilities .
Download METASPLOITABLE here --> (https://sourceforge.net/projects/metasploitable/)
Once downloaded, don’t forget to have the Metasploitable “Network” settings to “Host-only Adapter”. Again, Metasploitable is a vulnerable machine, so we don’t want anything spilling out and being exposed to hostile networks!
Launch the VM and when prompted, sign-in with the default credentials: “mfsadmin” for both the login and password information.
Perform an ifconfig command from the Metasploitable, and find the ip address. Then from your Kali linux, ping the ip address to see if Metasploitable is up and running.
This can also be checked by searching the ip address from your browser.
In this post we will go over a method of active reconnaisance; I will demonstrate enumerating SMB user information from the Metasploitable server.
But before, let’s briefly talk about what the SMB is.
The Simple Message Blocks (SMB) is a file server protocol (from ports 139, 445/TCP) that connects different machines on a network to share/access resources (i.e. gaining access to files) or to perform tasks (i.e. printing over a network). In a penetration tester’s perspective, gaining a list of users help us identify targets/individuals that might be used to gain access, then escalate privileges within a network. From a list of users, a penetration-tester might build a dictionary of possible usernames for bruteforce attacks, and/or user the account information for web applications on this or other servers. Or the pen-tester might learn more about the purpose of the server by researching the identities and roles of the users within a network.
In order to enumerate the SMB users, we will ultize the nmap command with the --scripts option from our Kali Linux. Kali comes with default, downloaded scripts to perform various scans on a network. For the purpose of this demonstration we will search for the smb-enum-users.nse script to perform the scan and enumerate the users within the SMB server. First locate the script:
Then, specify the path and file of the script, followed by the port numbers: 445, 139 for SMB server. Include the target ip address that we derived from Metasploitable. Note that the response will tell us that both of the ports are “open” and list out the name of the account from the given path “METASPLOITABLE\<user_name>” with RID numbers.
Try filtering the previous output with grep search “METASPLOITABLE” and also print the number lines to see how many users there are.
TADAhhhh~ Only 35 account users within the network!
As a penetration tester, this information might leave more questions.
Can we identify any of these users through OSINT testing or perhaps further enumerate identities with root or admin priviledges? Can we check certain files of these users and learn more about them to apply social engineering against them?
The possibilities are endless and hackers are creative. Keep in mind, penetration testing is a cyclical process of gathering information and scanning, even after gaining access to a network. Information is power and enumeration is key!