Detect SMB version

Nmap

 nmap -p445 --script smb-protocols <target>
 nmap -p139 --script smb-protocols <target>

Metasploit

  1. search for SMB version detection:

    Untitled

    use auxiliary/scanner/smb/smb_version
    
  2. info about parameters of module:

    Untitled

  3. set options: setting up options that we need to launch the module:

    Untitled

    set RHOSTS <target>
    
  4. run: run the module:

    Untitled

Enumerate info

nmap -sC -p 139,445 -sV <target>

Enumerate hosts with SMB enabled

Scan against a list of IPs using a list file and a single set of credentials:

nxc smb scope_internal.txt -u 'anonymous' -p 'anonymous' --no-bruteforce

Scan against a list of IPs using a list file and a file of credentials:

nxc smb scope_internal.txt -u usernames.txt -p passwords.txt --no-bruteforce

Enumerate Shares

Enumerate shares using a valid username: