How punk-security/smbeagle works
Project type and purpose
• SMBeagle is a cross-platform CLI tool (written in C#/.NET Core) for auditing SMB file shares.
• It discovers networks, finds hosts, enumerates shares and files, tests permissions, and outputs results to CSV and/or Elasticsearch (with an optional Kibana dashboard).
File structure
Top-level organization:
• Program.cs + SMBeagle.sln/.csproj – entry point and solution.
• Enums – shared enumerations (Authors, Directory, Network, ShareType).
• NetworkDiscovery – scans local adapters and network ranges for TCP/445.
• HostDiscovery – filters alive SMB hosts on discovered networks.
• ShareDiscovery – finds shares on each host (Windows via Win32, Linux via SMBLibrary).
• FileDiscovery – crawls share directory trees, inspects file ACLs and permissions, and (optionally) fetches files.
• Output – interfaces and helpers to write results to CSV or Elasticsearch.
• Kibana – supporting Docker compose and ndjson for dashboard.
• tests – integration/unit tests in Python and Dockerfiles for CI.
• CI/CD: .github/workflows, Dockerfile, Dockerignore.
README for architectural insights
• There is a schematic (“Docs/schematic.png”) outlining a pipeline:
– Network candidate generation → TCP scan → SMB host detection → Share enumeration → File enumeration/permission checks → Output.
• Modules are loosely coupled, enabling easy extension.