📝
Basic Penetration Testing
  • About Knowledge
  • Server Enumeration
    • Scanning
    • Common Services
      • FTP - 21
      • SMTP - 25
      • SMB - 139, 445
  • Web Application
    • Enumeration
    • Exploitation
    • Execute Commands
    • Databases
      • MySQL
      • SQLite
      • MSSQL
      • PostgreSQL
  • Remote Code Execution
  • File Transfer
    • HTTP Server
    • SMB Protocol
    • FTP Server on Kali Linux
  • Hash Cracking
  • Privilege Escalation
    • Windows Privilege Escalation
    • Linux Privilege Escalation
  • Buffer Overflow
  • About LeeCyberSec
Powered by GitBook
On this page
  • Server Connection
  • smbmap
  • smbclient
  • Scanning Vul
  • SMB Enum
  • Guess Server's Version
  • Mount Access
  • smbclient
  • nbtscan
  • Enum4linux
  • rpcclient
  • SMB Common Commands

Was this helpful?

  1. Server Enumeration
  2. Common Services

SMB - 139, 445

Server Connection

smbmap

$ smbmap -H $ip

$ smbmap -u <user> -H $ip

smbclient

$ smbclient -L $ip

$ smbclient -N -L //10.10.10.4

Scanning Vul

$ ls -l /usr/share/nmap/scripts/smb*

$ nmap -p 139,445 --script smb-vul* $ip

SMB Enum

Guess Server's Version

$ nmap -A 10.10.10.4

$ nmap -p 139,445 $ip --script-args=unsafe=1 --script /usr/share/nmap/scripts/smb-os-discovery

Mount Access

$ mount -t cifs -o user=USERNAME,sec=ntlm,dir_mode=0077 "//ip/My Share" /mnt/cifs

$ mount -o nolock $ip:/home ~/home/
-rwx------ 1 1014  1014   48 Jun 10 09:16 creds.txt

$ sudo adduser pwn
$ sudo sed -i -e 's/1001/1014/g' /etc/passwd
$ su pwn
$ cat creds.txt

smbclient

$ smbclient //ip/tmp

$ smbclient \\\\ip\\ipc$ -U john 

$ smbclient //ip/ipc$ -U john

nbtscan

$ nbtscan -r $ip

Enum4linux

$ enum4linux -a $ip

rpcclient

$ rpcclient -U "" $ip

SMB Common Commands

$ srvinfo
$ enumdomusers
$ getdompwinfo
$ querydominfo
$ netshareenum
$ netshareenumall
PreviousSMTP - 25NextWeb Application

Last updated 4 years ago

Was this helpful?