Academy - Footprinting -SMTP

Way later, but the problem with nmap is that the nse script mark the 252 and 550 response status code as “not permitted”, and those are the response status codes for the VRFY method, on this server.
(cf line 163)
Which results in the method being skipped
(cf line 340)
Now since in our case 550 is a valid status code for “user doesn’t exist” and 252 for “user exists”, the only way to make it work would be to tweak the script


Now the tweaked nse script will find the user
sudo nmap $TARGET -p25 --script=smtp-enum-users.nse --script-args userdb=/home/$USER/Desktop/test/footprinting-wordlist.txt,methods={VRFY} -dd -packet

Conclusion: this reminds of a sentence from the footprinting module, SMB chapter “we should never rely only on automated tools where we do not know precisely how they were written.”

Guys, I just got the answer by editing the smtp-user-enum perl script

sudo nano $(which smtp-user-enum)

my $VERSION        = "1.2";
my $debug          = 0;
my @child_handles  = ();
my $verbose        = 0;
my $max_procs      = 5;
my $smtp_port      = 25;
my @usernames      = ();
my @hosts          = ();
my $recursive_flag = 1;
my $query_timeout  = 5;      <----------------- EDIT THIS 
my $mode           = "VRFY";
my $from_address   = 'user@example.com';
my $start_time     = time();

I put the timeout to 30 seconds and run, then the user just showed

I scanned with the default -w 5 at first and got no results, continued adding longer time periods 10, 15, 20 and finally got results! The best hint was: The server takes time responding, and sometimes some of them take even longer. Hope it helps you both in answering the question and the reason behind it!

smtp-user-enum -M VRFY -U footprinting-wordlist.txt -t 10.129.75.123 -w 20
Starting smtp-user-enum v1.2 ( smtp-user-enum | pentestmonkey )


Scan Information

Mode … VRFY
Worker Processes … 5
Usernames file … footprinting-wordlist.txt
Target count … 1
Username count … 101
Target TCP port … 25
Query timeout … 20 secs
Target domain …

######## Scan started at Tue Sep 3 07:19:12 2024 #########
10.129.75.123: [redacted]
######## Scan completed at Tue Sep 3 07:22:50 2024 #########
1 results.

101 queries in 218 seconds (0.5 queries / sec)

Get it done with Metasploit :stuck_out_tongue:

hey u can still use the smtp user enum tool, u should tweak the command a little bit, remember the server can take time to respond so make sure to give some time.

Boys, just go with the smtp-user-enum tool with the flag -w 20.
5 (the default) or 10 didnt give me any results either.

How am I supposed to know this command : smtp-user-enum

I mean I want to learn and to know , so how could I think of that . Without reading the forums I couldn’t do it .

Yea, I’m not sure why the module doesn’t talk about this specific tool unless the goal is to make you research…which is a skill. But yes, it is frustrating. THey could at least say “You will need to research a command line tool to solve this last question.”

1 Like

exactly , maybe a hit to do a research .

As I saw , Hack the box is a bit more advanced from TryHackMe , so we need more researching if we don’t know something .

It is possible to have smpt-user-enum give you the information you are looking for if you use the command

smtp-user-enum -h

Looking at the options there are a few that I would look into -w, -U, -v . The command will look something like:

smtp-user-enum -M VRFY -w <time_in_seconds> -U htb/footprinting-wordlist.txt -t 10.129.43.216 -v

This will give you an output that looks something like:

Playing around with the time element supplied to the -w argument will change the “result”