445 - Pentesting SMB

NetExec

netexec is the latest tool which can be used to enumerate SMB protocol

make a list of ips in a file and then used the below command

netexec smb ips.txt 

Password Spraying using netexec

this will try to list all the shares

netexec smb ips.txt -u users.txt -p passwords.txt 

Netexec to see shares

we can see shares as well using netexec

netexec smb ips.txt -u users.txt -p passwords.txt --shares

SMBClient

List Shares using SMBClient

We can use smbclient to list the shares and login to the shares as well

List Shares with User and Pass

when we have a username and password we can try this

Download files using SMBClient

Login to SMB

now use the following commands and it will recursively download all the files in your kali linux

SMBMAP

List Shares using SMBMAP

Directory Structure Listing of a Share Recursively

Download files from Shares using SMBMAP

STATUS_PASSWORD_MUST_CHANGE

if you see status password must change, then you can change the password of that user using impacket-smbpasswd

Last updated