🟥
LSWSec - Offensive
  • Introduction
  • File transfer
    • Transferring Files
      • Transferring Files - Linux
      • Transferring Files - Windows
  • Recon
    • Passive information Gathering
      • Website
      • Finding SubDomains
        • DNS
        • DNS Zone Transfer
    • Subdomain Enumeration
    • OSINT
      • Email
      • People
      • Social Media
      • Username and Accounts
      • Passwords
      • Business
      • Image and Location
    • Active Information Gathering
      • Nmap
      • Netcat
      • ss
      • Unknown Port Scanning
      • Footprinting
        • FTP
        • SMB
        • NFS
        • DNS
    • Vulnerability Searching
  • Ports
    • 21 - FTP
    • 22 - SSH
    • 23 - Telnet
    • 25 - SMTP
    • 69 - TFTP
    • 80 - HTTP
    • 88 - Kerberos
    • 110 - Pop3
    • 111 - RPCBind
    • 119 - NNTP
    • 135 - MSRPC
    • 139/445 - SMB
      • PSExec
      • Nmap
      • Other tools
    • 143/993 - IMAP
    • 161/162 - SNMP
    • 389/636 - LDAP
    • 443 - HTTPS
    • 554 - RTSP
    • 587 - Submission
    • 631 - Cups
    • 1433 - MsSQL
    • 2049 - NFS
    • 3306 - MySQL
    • 3389 - RDP
  • Web
    • useful information
    • Web Proxy
      • Burp
    • Web Content Discovery
    • SQL
    • Web Fuzzing with FFUF
      • Directory Fuzzing
      • Domain Fuzzing
      • Paramater fuzzing
    • Local File Inclusion
      • LFI
      • Basic Bypass
    • Authentication Bypass
    • IDOR
  • Priv-esc
    • Windows
      • mimikatz
  • Pivoting
    • Info
    • Locating other machines
    • proxy
    • SSH tunneling/port forwarding
    • plink
    • socat
    • chisel
    • sshuttle
    • connecting to windows environments with a user account
  • Command and Control
    • powershell empire
    • Armitage
  • Active Directory
    • Debugging DNS
    • NTLM Authenticated Services
    • LDAP Bind Credentials
Powered by GitBook
On this page
  1. Recon
  2. Active Information Gathering
  3. Footprinting

SMB

  • Server message block

  • default config

    • cat /etc/samba/smb.conf | grep -v "#\|\;" 
      
  • dangerous settings

    • browseable = yes

    • read only = no

    • writable = yes

    • guest ok = yes

    • enable privileges = yes

    • create mask = 0777

    • directory mask = 0777

    • logon script = script.sh

    • magic script = script.sh

    • magic output = script.out

  • restart service

    • sudo systemctl restart smbd
      
  • connect

    • lists shares on server

      smbclient -N -L //10.129.14.128
    • connect to notes share

      smbclient //10.129.14.128/notes
  • get status

    • smbstatus

  • nmap

    • nmap 10.129.14.128 -sV -sC -p139,445
  • rpclient

    • rpcclient -U "" 10.129.14.128    
    • can offer us different requests

      • srvinfo - server info

      • enumdomains - enumerate all domains

      • querydominfo - provides domains, server and user info

      • netshareenumall - enumerates all shares

      • netsharegetinfo <share> - enumerates specific share

      • enumdomusers - enumerates all domain users

      • queryuser <rid> - enumerates specific user

  • Brute force user RIDs

    • for i in $(seq 500 1100);do rpcclient -N -U "" 10.129.14.128 -c "queryuser 0x$(printf '%x\n' $i)" | grep "User Name\|user_rid\|group_rid" && echo "";done
    • alternative to this is to use samrdump.py from impacket.

    • samrdump.py 10.129.14.128
  • smbmap

    • smbmap -H 10.129.14.128
  • crackmapexec

    • crackmapexec smb 10.129.14.128 --shares -u '' -p ''
  • enum4linux

    • enum4linux-ng.py 10.129.14.128 -A

PreviousFTPNextNFS

Last updated 10 days ago