Samba


Nmap discovered a Samba server on the target ports 139 and 445 The running service is Samba smbd 4.9.5-Debian

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/pelican]
└─$ nmap --script smb-enum-shares -sV -p139,445 $IP          130
Starting Nmap 7.95 ( https://nmap.org ) at 2025-03-21 19:28 CET
Nmap scan report for 192.168.132.98
Host is up (0.021s latency).
 
PORT    STATE SERVICE     VERSION
139/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open  netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
Service Info: Host: PELICAN
 
Host script results:
| smb-enum-shares: 
|   account_used: guest
|   \\192.168.132.98\IPC$: 
|     Type: STYPE_IPC_HIDDEN
|     Comment: IPC Service (Samba 4.9.5-Debian)
|     Users: 1
|     Max Users: <unlimited>
|     Path: C:\tmp
|     Anonymous access: READ/WRITE
|     Current user access: READ/WRITE
|   \\192.168.132.98\print$: 
|     Type: STYPE_DISKTREE
|     Comment: Printer Drivers
|     Users: 0
|     Max Users: <unlimited>
|     Path: C:\var\lib\samba\printers
|     Anonymous access: <none>
|_    Current user access: <none>
 
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 23.66 seconds

Share mapping complete The target Samba server allows anonymous access

┌──(kali㉿kali)-[~/PEN-200/PG_PRACTICE/pelican]
└─$ enum4linux -a -r -o -n -A -U $IP                   
Starting enum4linux v0.9.1 ( http://labs.portcullis.co.uk/application/enum4linux/ ) on Fri Mar 21 19:29:06 2025
 
 =========================================( Target Information )=========================================
 
Target ........... 192.168.132.98
RID Range ........ 500-550,1000-1050
Username ......... ''
Password ......... ''
Known Usernames .. administrator, guest, krbtgt, domain admins, root, bin, none
 
 
 ===========================( Enumerating Workgroup/Domain on 192.168.132.98 )===========================
 
 
[E] Can't find workgroup/domain
 
 
 
 ===============================( Nbtstat Information for 192.168.132.98 )===============================
 
Looking up status of 192.168.132.98
No reply from 192.168.132.98
 
 ==================================( Session Check on 192.168.132.98 )==================================
 
 
[+] Server 192.168.132.98 allows sessions using username '', password ''
 
 
 ===============================( Getting domain SID for 192.168.132.98 )===============================
 
Domain Name: WORKGROUP
Domain Sid: (NULL SID)
 
[+] Can't determine if host is part of domain or part of a workgroup
 
 
 ==================================( OS information on 192.168.132.98 )==================================
 
 
[E] Can't get OS info with smbclient
 
 
[+] Got OS info for 192.168.132.98 from srvinfo: 
	PELICAN        Wk Sv PrQ Unx NT SNT Samba 4.9.5-Debian
	platform_id     :	500
	os version      :	6.1
	server type     :	0x809a03
 
 
 ======================================( Users on 192.168.132.98 )======================================
 
Use of uninitialized value $users in print at ./enum4linux.pl line 972.
Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 975.
 
Use of uninitialized value $users in print at ./enum4linux.pl line 986.
Use of uninitialized value $users in pattern match (m//) at ./enum4linux.pl line 988.
 
 ================================( Share Enumeration on 192.168.132.98 )================================
 
 
	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	IPC$            IPC       IPC Service (Samba 4.9.5-Debian)
Reconnecting with SMB1 for workgroup listing.
 
	Server               Comment
	---------            -------
 
	Workgroup            Master
	---------            -------
	WORKGROUP            
 
[+] Attempting to map shares on 192.168.132.98
 
//192.168.132.98/print$	Mapping: DENIED Listing: N/A Writing: N/A
 
[E] Can't understand response:
 
NT_STATUS_OBJECT_NAME_NOT_FOUND listing \*
//192.168.132.98/IPC$	Mapping: N/A Listing: N/A Writing: N/A
 
 ===========================( Password Policy Information for 192.168.132.98 )===========================
 
 
 
[+] Attaching to 192.168.132.98 using a NULL share
 
[+] Trying protocol 139/SMB...
 
[+] Found domain(s):
 
	[+] PELICAN
	[+] Builtin
 
[+] Password Info for Domain: PELICAN
 
	[+] Minimum password length: 5
	[+] Password history length: None
	[+] Maximum password age: 37 days 6 hours 21 minutes 
	[+] Password Complexity Flags: 000000
 
		[+] Domain Refuse Password Change: 0
		[+] Domain Password Store Cleartext: 0
		[+] Domain Password Lockout Admins: 0
		[+] Domain Password No Clear Change: 0
		[+] Domain Password No Anon Change: 0
		[+] Domain Password Complex: 0
 
	[+] Minimum password age: None
	[+] Reset Account Lockout Counter: 30 minutes 
	[+] Locked Account Duration: 30 minutes 
	[+] Account Lockout Threshold: None
	[+] Forced Log off Time: 37 days 6 hours 21 minutes 
 
 
 
[+] Retieved partial password policy with rpcclient:
 
 
Password Complexity: Disabled
Minimum Password Length: 5
 
 
 ======================================( Groups on 192.168.132.98 )======================================
 
 
[+] Getting builtin groups:
 
 
[+]  Getting builtin group memberships:
 
 
[+]  Getting local groups:
 
 
[+]  Getting local group memberships:
 
 
[+]  Getting domain groups:
 
 
[+]  Getting domain group memberships:
 
 
 =================( Users on 192.168.132.98 via RID cycling (RIDS: 500-550,1000-1050) )=================
 
 
[I] Found new SID: 
S-1-22-1
 
[I] Found new SID: 
S-1-5-32
 
[I] Found new SID: 
S-1-5-32
 
[I] Found new SID: 
S-1-5-32
 
[I] Found new SID: 
S-1-5-32
 
[+] Enumerating users using SID S-1-5-21-3775993406-1587906097-1752599619 and logon username '', password ''
 
S-1-5-21-3775993406-1587906097-1752599619-501 PELICAN\nobody (Local User)
S-1-5-21-3775993406-1587906097-1752599619-513 PELICAN\None (Domain Group)
 
[+] Enumerating users using SID S-1-22-1 and logon username '', password ''
 
S-1-22-1-1000 Unix User\charles (Local User)
 
[+] Enumerating users using SID S-1-5-32 and logon username '', password ''
 
S-1-5-32-544 BUILTIN\Administrators (Local Group)
S-1-5-32-545 BUILTIN\Users (Local Group)
S-1-5-32-546 BUILTIN\Guests (Local Group)
S-1-5-32-547 BUILTIN\Power Users (Local Group)
S-1-5-32-548 BUILTIN\Account Operators (Local Group)
S-1-5-32-549 BUILTIN\Server Operators (Local Group)
S-1-5-32-550 BUILTIN\Print Operators (Local Group)
 
 ==============================( Getting printer info for 192.168.132.98 )==============================
 
No printers returned.
 
 
enum4linux complete on Fri Mar 21 19:31:08 2025

enum4linux discovered the target system’s password policy as well as a system user; charles