ShellSpells
  • 🧙‍♂️Welcome!
    • ShellSpells
    • FAQs
    • License & Disclaimer
  • 🐧Linux
    • System Ops
      • Transcripts
      • Help
      • System Info
        • Date/Time
        • System Details
        • Patches & Updates
        • Init System Identification
        • Hostname / Host ID
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Shares
        • Packages
        • Connected Devices
        • Kernel Modules (Drivers)
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Jobs
        • Enumerate
        • Modify
      • Processes
        • Enumerate
        • Modify
        • Custom Script and Shared Object
        • Process I/O Redirection
      • Services
        • Enumerate
        • Modify
        • Create a Service
      • Startup/Boot Scripts
        • Enumerate
        • Modify
      • Security
        • Antivirus
        • Firewall
        • SSH Keys
      • History & Logs
        • History
        • Logs
    • File Ops
      • Search
        • Filename
        • Content
        • Users (Owners)
        • Time
        • Size
        • Permission
        • Hidden Files
        • Inode
        • Find + Exec
        • Notes
      • Enumerate Metadata
      • Modify Metadata
      • Read Content
      • Modify Content
      • Extract Content
      • Sort / Compare / Count
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
    • Terminal Ops
      • Keyboard Shortcuts
      • Tmux Shortcuts
  • 🪟Windows
    • System Ops
      • Transcripts
      • Help
      • System Info
        • One-liners
        • Date/Time
        • System Details
        • Hotfixes
        • Domain or Workgroup
        • Data Execution Prevention
        • Variables
        • Hardware & Resources
      • Filesystem
        • Traverse & Enumerate
        • Drives & Partitions
        • Installed Software
        • Drivers
        • Shares
      • Registry
        • Enumerate
        • Modify
        • Forensically Relevant Keys
      • Users & Groups
        • Enumerate
        • Modify
      • Network
        • Enumerate
        • Modify
      • Scheduled Tasks
      • Processes
        • Enumerate
        • Modify
      • Services
        • Enumerate
        • Modify
      • Autorun / Startup
        • Enumerate
        • Modify
      • Security
        • Permissions
          • Enumerate
          • Page
        • Antivirus
        • Firewall
          • Enumerate
          • Modify
        • Audit Policies
        • Remoting
          • Enumerate
          • Modify
          • Registry Locations
        • Stored Credentials
      • Remote Command Execution
      • Active Directory
        • Enumerate
        • Modify
      • History & Logs
        • History
        • Logs
      • PowerShell Config
      • Scripting
      • WMIC Notes
    • File Ops
      • Search
        • Filename
        • Time
        • Size
        • Permissions
        • Attributes
        • Wildcarding
      • Enumerate Metadata
        • One Liners
        • Users (Owners)
        • Timestamps
        • Size
        • Permissions
        • Attributes
      • Modify Metadata
        • Change Owner
        • Timestamps
        • Size
        • Attributes
      • Read Content
      • Modify Content
        • Overwrite
        • Insert
        • Append
        • Replace / Remove
        • Convert Case
        • Alternate Data Streams
      • Extract Content
      • Sort / Compare / Count
        • Sort
        • Count
        • Compare
      • Move
      • Copy
      • Execute
      • Hash
      • Encode/Decode
      • Compress/Decompress
      • Working With Weird Filenames
      • Output Formatting / Filtering
      • File Formatting
      • Operators
  • ⛓️Network
    • Traffic Manipulation
      • iptables
        • Option List
        • General Commands
        • Filter Tables
        • NAT
        • Mangle
        • Filter for SSH Traffic (Example)
      • nftables
    • Packet Capture
      • Syntax
      • TCPDump Examples
    • Packet Analysis
      • Wireshark
  • 🚗Maneuver
    • SSH
    • Control Sockets
    • RDP
    • Windows Port Proxy
  • 🛩️Data Transfer
    • SCP
    • FTP
    • Netcat
      • Netcat Relays
    • Server Interactions
    • Alternate Methods
  • 🪄REGEX
    • Examples
Powered by GitBook
On this page
  • Enumerate
  • Samba (Windows Shares)
  • NFS (Network File System)
  • WebDAV Shares
  • Modify
  • NFS (Network File System)
  • Samba (SMB/CIFS)
  • WebDAV

Was this helpful?

  1. Linux
  2. System Ops
  3. Filesystem

Shares

Enumerate

Samba (Windows Shares)

smbclient -L <server_name>

Lists shares available on a specific Windows server.

smbclient -L //<hostname>

List available SMB/CIFS shares on a remote Samba server (replace <hostname> with the server's hostname or IP address).

netstat -tuln

Display listening network services and ports. Look for services like NFS (port 2049) or Samba (ports 137-139 and 445).

nmap -p 139,445 <network_range>

Scans a network range for active Samba servers (requires nmap installation).

smbmap

Lists shares from multiple servers based on /etc/samba/smb.conf configuration.

NFS (Network File System)

mount

List currently mounted filesystems, including network shares like NFS and CIFS/SMB.

showmount -e

Lists NFS exports (shared directories) from accessible NFS servers.

showmount -e <hostname>

List NFS shares available on a remote NFS server (replace <hostname> with the server's hostname or IP address).

rpcinfo -p mountd <server_name>

Checks NFS availability on a specific server.

nfsstat -s

Shows mounted NFS shares on the local system. (client perspective)

nfsstat -m

Show NFS-mounted filesystems on the local system.

findmnt -t nfs -t cifs

List mounted NFS and CIFS filesystems.

WebDAV Shares

curl -I <URL>

Checks the headers of a URL to see if it's a WebDAV server.

davfs2

Mounts WebDAV shares as local directories (tool) (requires installation).

Modify

NFS (Network File System)

Create an NFS Export

Modify the /etc/exports file to specify which directories to export and the access permissions. Example: sudo nano /etc/exports Add an entry like: /shared_directory 192.168.1.0/24(rw,sync,no_root_squash)

Restart NFS Server

Reload or restart the NFS server to apply changes. Example: sudo systemctl restart nfs-server

Mount an NFS Share

Use the mount command to connect to an NFS share. Example: sudo mount -t nfs <server_ip>:/shared_directory /mnt/mount_point

Samba (SMB/CIFS)

Install Samba

Ensure Samba is installed on your system. Example (on Debian/Ubuntu): sudo apt-get install samba

Create a Samba Share

Create a share on a Samba server (requires administrative privileges): smbcontrol server <server_name> share add <share_name> <path>

Export a directory on your system as an NFS share (requires administrative privileges): export <path>

AND/OR

Modify the Samba configuration file (smb.conf) to define your shares. sudo nano /etc/samba/smb.conf Add an entry like:

[MyShare]
path = /shared_directory
read only = no

Set Samba Passwords

Create a Samba user and set the password. Example: sudo smbpasswd -a <username>

Restart Samba

Restart the Samba service to apply changes. Example: sudo systemctl restart smbd

Connect to a Samba Share

Use the smbclient command to connect to a Samba share interactively. smbclient //<server_ip>/MyShare -U <username>

Connect to a share for editing files. Requires appropriate permissions: smbclient -U <server_name>/<share_name>

Mount a Samba Share (CIFS)

Use the mount command to mount a Samba share to a local directory. Example: sudo mount -t cifs -o username=<user>,password=<password> //<server_ip>/MyShare /mnt/mount_point

Mount a share temporarily: smbmount //<server_name>/<share_name> /mnt/sharepoint

Mounts a share permanently using credentials: mount.cifs //<server_name>/<share_name> /mnt/sharepoint -o username=<user>,password=<password>

WebDAV

Modifying

Mount a WebDAV share as a local directory for editing files (requires the davfs2 package): davfs2 /url/to/webdav /mnt/sharepoint

Creating

WebDAV servers usually have web interfaces for creating shares. Consult the server's documentation.

Connecting

Same as modifying.

PreviousDrives & PartitionsNextPackages

Last updated 1 year ago

Was this helpful?

🐧