06. SMB Samba Part 3
1. Nmap SMB Enumeration¶
Command:¶
Explanation:¶
-p 445specifies the SMB port (445).--script smb-enum-sharesruns the Nmap script to enumerate SMB shares.- This command helps identify shared folders on the target system.
Example:¶
2. Metasploit SMB Share Enumeration¶
Commands:¶
Explanation:¶
- This Metasploit module scans for SMB shares on a target system.
RHOSTSspecifies the target IP.- Running this module provides a list of accessible SMB shares.
Example:¶
3. Enum4linux Share Enumeration¶
Command:¶
Explanation:¶
-Sflag lists SMB shares.- Provides information about accessible shared resources.
Example:¶
4. Listing SMB Shares Using SMBClient¶
Command:¶
Explanation:¶
-Llists available shares on the SMB server.-Nskips password authentication.
Example:¶
5. Enumerating SMB Groups Using Enum4linux¶
Command:¶
Explanation:¶
-Gflag enumerates groups on the SMB server.- Helps identify group memberships, which can be useful for privilege escalation.
Example:¶
6. Enumerating Domain Groups Using RPCClient¶
Commands:¶
Explanation:¶
rpcclientconnects to the SMB server and interacts with RPC services.-U "" -Nmeans no username or password is used.enumdomgroupslists domain groups.
Example:¶
7. Comprehensive SMB Enumeration Using Enum4linux¶
Command:¶
Explanation:¶
-iflag performs an in-depth information gathering on SMB services.- Retrieves user lists, share lists, group information, etc.
Example:¶
8. Accessing a Public SMB Share Using SMBClient¶
Command:¶
Explanation:¶
- Connects to a publicly accessible SMB share named "Public".
-Nskips authentication.- Useful for accessing shared files without credentials.
Example:¶
These commands help in identifying SMB vulnerabilities, unauthorized access points, and misconfigurations in SMB shares, which can be useful for penetration testing and security auditing.