Pentest Notes
  • About
  • Notes
    • Methodologies & Tools
      • Scanning & Enumeration
        • Scanning
        • Port 21 - FTP
        • Port 22 - SSH
        • Port 23 - telnet
        • Port 25 - SMTP
          • Enumerate Users via SMTP
        • Port 53 - DNS
        • Port 110 - POP3
        • Port 111 - RPCBind
        • Port 123 - NTP
        • Port 139, 445 - SMB
        • Port 143 - IMAP
        • Port 161 - SNMP
        • Port 389 - LDAP
        • Port 1521 - Oracle DB Listener
        • Port 1433 - MSSQL
        • Port 2049 - NFS
        • Port 3306 - MySQL/MariaDB
        • Port 3389 - RDP
        • Port 5432 - Postgres
        • Port 6379 - Redis
        • Port 27017 - MongoDB
      • Active Directory
        • Housekeeping
        • DNS Recon
        • Finding Users
        • Client Side Attacks
        • PowerShell Domain Enumeration
        • Roasting
        • Mimikatz
        • Credential Attacks
        • Bloodhound
        • Persistence
        • Group Policy Attack Tools
        • Service Account Exploits
        • Delegation
        • Cheatsheets
        • Tool Repos
      • Privilege Escalation
        • Windows
          • Basic Methodology
          • UAC Bypass
          • Privilege Exploits
          • Service Exploits
          • Password Hunting
          • Scheduled Tasks
          • Insecure File Permissions
          • Driver Kernel Exploits
          • LAPS Password
          • AlwaysInstallElevated
          • SMBGhost
          • PowerShell
          • PowerUp
          • Enable Remote Desktop
          • Cheatsheets
        • Linux
          • Shell Upgrade
          • Basic Methodology
          • Adding User to /etc/passwd
          • Add User to /etc/sudoers
          • Docker Breakout
          • LD_Library
          • Checking Weird Binaries
          • Outdated Bash
          • NFS Root Squash
          • Resources
      • Web
        • IDOR
        • LFI - Local File Inclusion
          • Windows LFI List
        • RFI - Remote File Inclusion
        • Command Injection
        • Server Side Template Injection - SSTI
        • SQL Injection
          • Blind Injection Sample Script
        • XSS
        • Authentication
        • Administrative Portals
        • NodeJS
        • 403 Forbidden Bypass
      • Network Pivoting
      • Tools
        • Compiling
        • Cracking
        • Port Knocking
        • Shells
        • SQL
      • File Transfer
      • External
Powered by GitBook
On this page
  1. Notes
  2. Methodologies & Tools
  3. Scanning & Enumeration

Port 139, 445 - SMB

Scanning:

nmap --script "smb-vuln*" -p 139.445 -Pn $target
nmap -v -p 139,445 -oG smb.txt 10.11.1.1-254
nmap 10.11.1.220 --script=smb-os-discovery
nbtscan -r 10.11.1.0/24

Enumerate Users

enum4linux -A $IP
  • Accepts creds as arguments

Test For Access Level

crackmapexec smb $target -u guest -p "" --shares

Spider Shares [with Pattern]

crackmapexec smb $target -u 'username' -p 'password' --spider sharename\ --pattern txt

Spider_Plus

  • Lists all files and saves as json

crackmapexec smb $target -u 'username' -p 'password' -M spider_plus

Download Everything

smbmap -H $IP -R -A .
  • Use -exclude flag for shares you don't need

  • Use -depth flag if you don't need everything in a folder

Mount Share

mount -t cifs //$IP/share /mnt/share
mount -t cifs -o username=$user //$IP/share /mnt/share

RPCClient

rpcclient -U "" $IP

PreviousPort 123 - NTPNextPort 143 - IMAP

Last updated 2 years ago

Eternalblue Manual Compilation:

https://root4loot.com/post/eternalblue_manual_exploit/