SMB Enumeration [InitialAccess -NT]

──(kali㉿kali)-[~/pg/internal]
└─$ netexec smb $internal -u guest -p '' --shares
SMB         192.168.203.40  445    INTERNAL         [*] Windows Server (R) 2008 Standard 6001 Service Pack 1 x32 (name:INTERNAL) (domain:internal) (signing:False) (SMBv1:True)
SMB         192.168.203.40  445    INTERNAL         [-] internal\guest: STATUS_ACCOUNT_DISABLED

┌──(kali㉿kali)-[~/pg/internal]
└─$ nmap --script smb-brute.nse -p445 $internal
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-01-02 12:18 IST
Nmap scan report for 192.168.203.40
Host is up (0.073s latency).

PORT    STATE SERVICE
445/tcp open  microsoft-ds

Host script results:
| smb-brute:
|_  guest:<blank> => Valid credentials, account disabled

Nmap done: 1 IP address (1 host up) scanned in 260.56 seconds

┌──(kali㉿kali)-[~/pg/internal]
└─$ smbclient -N -L $internal
Anonymous login successful

        Sharename       Type      Comment
        ---------       ----      -------
Reconnecting with SMB1 for workgroup listing.
do_connect: Connection to 192.168.203.40 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Unable to connect with SMB1 -- no workgroup available

Null session not allowd.

Looking for vulnerability.

I will try the CVE-2009-3103

Found one github exploit.

In the exploit code, shell code is needed to make shell code. The command is mentioned.

I will not be using meterpreter reverse tcp. I will be using reverse TCP only.

I tried windows/shell_reverse_tcp , windows/x64/shell/reverse_tcp but didn't work and then I tried windows/shell/reverse_tcp and it worked.

Making payload:

The last command changes the variable name to shell from buf .

Now replace shell code in exploit with your shell code.

Start the listener.

Run the exploit.

You will see that the exploit gives an error but we get a shell in the listener.

Last updated

Was this helpful?