This skill should be used when the user asks to "set up a web server", "configure HTTP or HTTPS", "perform SNMP enumeration", "configure SMB shares", "test network services", or needs guidance on configuring and testing network services for penetration testing labs.
Add this skill
npx mdskills install sickn33/network-101Comprehensive penetration testing lab setup guide with actionable commands and troubleshooting
1---2name: Network 1013description: This skill should be used when the user asks to "set up a web server", "configure HTTP or HTTPS", "perform SNMP enumeration", "configure SMB shares", "test network services", or needs guidance on configuring and testing network services for penetration testing labs.4metadata:5 author: zebbern6 version: "1.1"7---89# Network 1011011## Purpose1213Configure and test common network services (HTTP, HTTPS, SNMP, SMB) for penetration testing lab environments. Enable hands-on practice with service enumeration, log analysis, and security testing against properly configured target systems.1415## Inputs/Prerequisites1617- Windows Server or Linux system for hosting services18- Kali Linux or similar for testing19- Administrative access to target system20- Basic networking knowledge (IP addressing, ports)21- Firewall access for port configuration2223## Outputs/Deliverables2425- Configured HTTP/HTTPS web server26- SNMP service with accessible communities27- SMB file shares with various permission levels28- Captured logs for analysis29- Documented enumeration results3031## Core Workflow3233### 1. Configure HTTP Server (Port 80)3435Set up a basic HTTP web server for testing:3637**Windows IIS Setup:**381. Open IIS Manager (Internet Information Services)392. Right-click Sites → Add Website403. Configure site name and physical path414. Bind to IP address and port 804243**Linux Apache Setup:**4445```bash46# Install Apache47sudo apt update && sudo apt install apache24849# Start service50sudo systemctl start apache251sudo systemctl enable apache25253# Create test page54echo "<html><body><h1>Test Page</h1></body></html>" | sudo tee /var/www/html/index.html5556# Verify service57curl http://localhost58```5960**Configure Firewall for HTTP:**6162```bash63# Linux (UFW)64sudo ufw allow 80/tcp6566# Windows PowerShell67New-NetFirewallRule -DisplayName "HTTP" -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow68```6970### 2. Configure HTTPS Server (Port 443)7172Set up secure HTTPS with SSL/TLS:7374**Generate Self-Signed Certificate:**7576```bash77# Linux - Generate certificate78sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \79 -keyout /etc/ssl/private/apache-selfsigned.key \80 -out /etc/ssl/certs/apache-selfsigned.crt8182# Enable SSL module83sudo a2enmod ssl84sudo systemctl restart apache285```8687**Configure Apache for HTTPS:**8889```bash90# Edit SSL virtual host91sudo nano /etc/apache2/sites-available/default-ssl.conf9293# Enable site94sudo a2ensite default-ssl95sudo systemctl reload apache296```9798**Verify HTTPS Setup:**99100```bash101# Check port 443 is open102nmap -p 443 192.168.1.1103104# Test SSL connection105openssl s_client -connect 192.168.1.1:443106107# Check certificate108curl -kv https://192.168.1.1109```110111### 3. Configure SNMP Service (Port 161)112113Set up SNMP for enumeration practice:114115**Linux SNMP Setup:**116117```bash118# Install SNMP daemon119sudo apt install snmpd snmp120121# Configure community strings122sudo nano /etc/snmp/snmpd.conf123124# Add these lines:125# rocommunity public126# rwcommunity private127128# Restart service129sudo systemctl restart snmpd130```131132**Windows SNMP Setup:**1331. Open Server Manager → Add Features1342. Select SNMP Service1353. Configure community strings in Services → SNMP Service → Properties136137**SNMP Enumeration Commands:**138139```bash140# Basic SNMP walk141snmpwalk -c public -v1 192.168.1.1142143# Enumerate system info144snmpwalk -c public -v1 192.168.1.1 1.3.6.1.2.1.1145146# Get running processes147snmpwalk -c public -v1 192.168.1.1 1.3.6.1.2.1.25.4.2.1.2148149# SNMP check tool150snmp-check 192.168.1.1 -c public151152# Brute force community strings153onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings.txt 192.168.1.1154```155156### 4. Configure SMB Service (Port 445)157158Set up SMB file shares for enumeration:159160**Windows SMB Share:**1611. Create folder to share1622. Right-click → Properties → Sharing → Advanced Sharing1633. Enable sharing and set permissions1644. Configure NTFS permissions165166**Linux Samba Setup:**167168```bash169# Install Samba170sudo apt install samba171172# Create share directory173sudo mkdir -p /srv/samba/share174sudo chmod 777 /srv/samba/share175176# Configure Samba177sudo nano /etc/samba/smb.conf178179# Add share:180# [public]181# path = /srv/samba/share182# browsable = yes183# guest ok = yes184# read only = no185186# Restart service187sudo systemctl restart smbd188```189190**SMB Enumeration Commands:**191192```bash193# List shares anonymously194smbclient -L //192.168.1.1 -N195196# Connect to share197smbclient //192.168.1.1/share -N198199# Enumerate with smbmap200smbmap -H 192.168.1.1201202# Full enumeration203enum4linux -a 192.168.1.1204205# Check for vulnerabilities206nmap --script smb-vuln* 192.168.1.1207```208209### 5. Analyze Service Logs210211Review logs for security analysis:212213**HTTP/HTTPS Logs:**214215```bash216# Apache access log217sudo tail -f /var/log/apache2/access.log218219# Apache error log220sudo tail -f /var/log/apache2/error.log221222# Windows IIS logs223# Location: C:\inetpub\logs\LogFiles\W3SVC1\224```225226**Parse Log for Credentials:**227228```bash229# Search for POST requests230grep "POST" /var/log/apache2/access.log231232# Extract user agents233awk '{print $12}' /var/log/apache2/access.log | sort | uniq -c234```235236## Quick Reference237238### Essential Ports239240| Service | Port | Protocol |241|---------|------|----------|242| HTTP | 80 | TCP |243| HTTPS | 443 | TCP |244| SNMP | 161 | UDP |245| SMB | 445 | TCP |246| NetBIOS | 137-139 | TCP/UDP |247248### Service Verification Commands249250```bash251# Check HTTP252curl -I http://target253254# Check HTTPS255curl -kI https://target256257# Check SNMP258snmpwalk -c public -v1 target259260# Check SMB261smbclient -L //target -N262```263264### Common Enumeration Tools265266| Tool | Purpose |267|------|---------|268| nmap | Port scanning and scripts |269| nikto | Web vulnerability scanning |270| snmpwalk | SNMP enumeration |271| enum4linux | SMB/NetBIOS enumeration |272| smbclient | SMB connection |273| gobuster | Directory brute forcing |274275## Constraints276277- Self-signed certificates trigger browser warnings278- SNMP v1/v2c communities transmit in cleartext279- Anonymous SMB access is often disabled by default280- Firewall rules must allow inbound connections281- Lab environments should be isolated from production282283## Examples284285### Example 1: Complete HTTP Lab Setup286287```bash288# Install and configure289sudo apt install apache2290sudo systemctl start apache2291292# Create login page293cat << 'EOF' | sudo tee /var/www/html/login.html294<html>295<body>296<form method="POST" action="login.php">297Username: <input type="text" name="user"><br>298Password: <input type="password" name="pass"><br>299<input type="submit" value="Login">300</form>301</body>302</html>303EOF304305# Allow through firewall306sudo ufw allow 80/tcp307```308309### Example 2: SNMP Testing Setup310311```bash312# Quick SNMP configuration313sudo apt install snmpd314echo "rocommunity public" | sudo tee -a /etc/snmp/snmpd.conf315sudo systemctl restart snmpd316317# Test enumeration318snmpwalk -c public -v1 localhost319```320321### Example 3: SMB Anonymous Access322323```bash324# Configure anonymous share325sudo apt install samba326sudo mkdir /srv/samba/anonymous327sudo chmod 777 /srv/samba/anonymous328329# Test access330smbclient //localhost/anonymous -N331```332333## Troubleshooting334335| Issue | Solution |336|-------|----------|337| Port not accessible | Check firewall rules (ufw, iptables, Windows Firewall) |338| Service not starting | Check logs with `journalctl -u service-name` |339| SNMP timeout | Verify UDP 161 is open, check community string |340| SMB access denied | Verify share permissions and user credentials |341| HTTPS certificate error | Accept self-signed cert or add to trusted store |342| Cannot connect remotely | Bind service to 0.0.0.0 instead of localhost |343
Full transparency — inspect the skill content before installing.