this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

docs: update format of readme

+93 -76
+21 -45
00-mini-hack-overview.md
··· 4 4 5 5 ``` 6 6 External Network (172.20.0.0/16) 7 - ├── Kali External: 172.20.2 7 + ├── Kali External: 172.20.0.2 8 8 ├── Router External: 172.20.<team>.1 9 - └── Scoring Server: 172.20.1 9 + └── Scoring Server: 172.20.0.1 10 10 11 11 Internal Network (192.168.<team>.0/24) 12 12 ├── Router Internal: 192.168.<team>.1 ··· 27 27 ### 1. Find Your Team Number 28 28 29 29 **On Kali External**: 30 - ```bash 31 - ip addr show # Look for 172.20.X 32 - # If you see 172.20.2, your team number is 2 33 - # Check scoreboard at http://172.20.1 for confirmation 34 - ``` 30 + 31 + Check scoreboard at http://172.20.1 for team number (username: `sandbox` pass: `password`). 35 32 36 33 ### 2. Configure Router 37 34 38 35 **Login to MikroTik** (via ProxMox console or SSH): 36 + 39 37 ```bash 40 38 # Default login 41 39 admin ··· 46 44 ``` 47 45 48 46 **Assign IP addresses**: 47 + 49 48 ```bash 49 + /interface print 50 + 50 51 # External interface 51 - /ip address add address=172.20.<team>.1/16 interface=ether3 52 + /ip address add address=172.20.<team>.1/16 interface=ether# 52 53 53 54 # Internal interface 54 - /ip address add address=192.168.<team>.1/24 interface=ether4 55 + /ip address add address=192.168.<team>.1/24 interface=ether# 55 56 56 57 # Verify 57 58 /ip address print 58 59 ``` 59 60 60 - **Or use Web GUI**: `http://172.20.<team>.1:8080` 61 - - Login: `admin` / `<your password>` 62 - - Go to **Quick Set** 63 - - Enter external IP: `172.20.<team>.1/16` 64 - - Enter internal IP: `192.168.<team>.1/24` 65 - - ✅ **Check "Enable NAT"** (required!) 66 - - Click **Apply Configuration** 61 + The webgui can't be used here because there are no ip addresses assigned to it yet. 67 62 68 63 ### 3. Configure Ubuntu Web Server 69 64 70 65 **Assign static IP**: 66 + 71 67 ```bash 72 68 sudo nano /etc/netplan/01-network-manager-all.yaml 73 69 ``` ··· 90 86 ping 192.168.<team>.1 # Test router connectivity 91 87 ``` 92 88 89 + or open settings -> enable wired and config there 90 + 93 91 **Start Apache**: 92 + 94 93 ```bash 95 94 sudo systemctl restart apache2 96 95 sudo systemctl status apache2 # Should show "active (running)" 97 96 ``` 98 97 99 - **Test locally**: 100 98 ```bash 101 - curl http://192.168.<team>.2 # Should return HTML 99 + sudo vi /var/www/html/index.html # change team number 102 100 ``` 103 101 104 102 ### 4. Configure Port Forwarding (Router) 105 103 106 - **Web GUI Method** (recommended): 104 + **Web GUI**: 105 + 107 106 ``` 108 107 http://172.20.<team>.1:8080 109 108 ``` 110 109 111 - 1. Go to **Quick Set** → **Port Mapping** 110 + 1. Go to **Quick Set** → **Port Mapping** (enable nat here and change gateway to `172.20.1.1`) 112 111 2. Click **New** 113 112 - Name: `www-tcp` 114 113 - Protocol: `TCP` ··· 126 125 ### 5. Test From External Network 127 126 128 127 **On Kali External**: 128 + 129 129 ```bash 130 130 ping 172.20.<team>.1 # Router should respond 131 131 curl http://172.20.<team>.1 # Should show web content from internal server ··· 135 135 136 136 All lights should be green! 137 137 138 - ## Quick Troubleshooting 139 - 140 - | Problem | Check | 141 - |---------|-------| 142 - | Router not pingable | Verify IP on ether3: `/ip address print` | 143 - | Web not accessible | 1. Is Apache running? 2. Did you enable NAT? 3. Port forwarding rules exist? | 144 - | Internal server can't reach router | Check internal IP on ether4, verify gateway in netplan | 145 - | Lights still red | Wait 30 seconds for scoring refresh, check exact IPs match topology | 146 - 147 138 ## Configuration Files Reference 148 139 149 140 **Router**: Web GUI at `http://172.20.<team>.1:8080` or CLI via console 150 141 151 142 **Ubuntu Web Server**: 143 + 152 144 - Network: `/etc/netplan/01-network-manager-all.yaml` 153 145 - Apache: `sudo systemctl restart apache2` 154 146 - Website content: `/var/www/html/` 155 147 156 148 **Kali Machines**: For testing only, no configuration needed 157 - 158 - ## Common Mistakes 159 - 160 - ❌ Forgot to enable NAT on router 161 - ❌ Port forwarding only has TCP rule (need UDP too) 162 - ❌ Wrong team number in IP addresses 163 - ❌ Apache not started on Ubuntu 164 - ❌ Netplan syntax error (YAML is whitespace-sensitive) 165 - ❌ Router interface names wrong (check with `interface print`) 166 - 167 - ## Time-Saving Tips 168 - 169 - 1. Use **web GUI for router** - faster than CLI for NAT/port forwarding 170 - 2. Copy/paste team number once you know it - avoid typos 171 - 3. Test each step before moving on (ping, curl, status checks) 172 - 4. If stuck, verify each light's requirement on scoreboard
+72 -31
README.md
··· 1 - # Linux Service Configuration Writeups 1 + # NCAE Linux Competition Tools 2 + 3 + > [!CAUTION] 4 + > These writeups are tailored for NCAE cybersecurity competitions and may not reflect production best practices. 5 + > 6 + > Focus is on speed and competition scenarios, not enterprise deployment. 2 7 3 8 Quick reference guides for configuring services in Linux competitions. Assumes basic Linux knowledge (filesystem navigation, systemctl, ssh, etc.). 4 9 5 - ## Writeups 10 + ## The Layout 6 11 7 - 0. **[Mini-Hack Quick Start](00-mini-hack-overview.md)** - Complete mini-hack walkthrough checklist 8 - 1. **[Services Overview](01-services-overview.md)** - General approach to any service 9 - 2. **[Apache Web Service](02-apache-web-service.md)** - HTTP/HTTPS server configuration 10 - 3. **[SSH Service](03-ssh-service.md)** - Remote access, keys, security 11 - 4. **[Network Configuration](04-network-configuration.md)** - Static IPs across different distros 12 - 5. **[DNS, Rsync, Cron](05-dns-rsync-cron.md)** - Name resolution and automated backups 13 - 6. **[UFW Firewall](06-ufw-firewall.md)** - Ubuntu firewall configuration 14 - 7. **[Active Connection Defense](07-active-connection-defense.md)** - Monitor and kill malicious connections 15 - 8. **[MikroTik Router](08-mikrotik-router.md)** - Router configuration (2025 competition) 12 + ```bash 13 + ~/ncae-tools 14 + ├── 00-mini-hack-overview.md # Complete mini-hack walkthrough checklist 15 + ├── 01-services-overview.md # General approach to any service 16 + ├── 02-apache-web-service.md # HTTP/HTTPS server configuration 17 + ├── 03-ssh-service.md # Remote access, keys, security 18 + ├── 04-network-configuration.md # Static IPs across different distros 19 + ├── 05-dns-rsync-cron.md # Name resolution and automated backups 20 + ├── 06-ufw-firewall.md # Ubuntu firewall configuration 21 + ├── 07-active-connection-defense.md # Monitor and kill malicious connections 22 + └── 08-mikrotik-router.md # Router configuration (2025 minitik) 23 + ``` 16 24 17 25 ## Service-Specific Quick Reference 18 26 19 27 ### Apache Service Names 28 + 20 29 ```bash 21 30 apache2 # Ubuntu/Debian/Kali 22 31 httpd # CentOS/RHEL ··· 24 33 25 34 ### Network Configuration Files 26 35 27 - | Distribution | Config Location | 28 - |--------------|----------------| 29 - | Kali/Debian | `/etc/network/interfaces` | 30 - | Ubuntu | `/etc/netplan/*.yaml` | 36 + | Distribution | Config Location | 37 + | ------------ | ---------------------------------------- | 38 + | Kali/Debian | `/etc/network/interfaces` | 39 + | Ubuntu | `/etc/netplan/*.yaml` | 31 40 | CentOS/RHEL | `/etc/sysconfig/network-scripts/ifcfg-*` | 32 41 33 42 ### SSH Key Permissions 43 + 34 44 ```bash 35 45 chmod 700 ~/.ssh/ 36 46 chmod 600 ~/.ssh/id_rsa # Private key ··· 39 49 ``` 40 50 41 51 Regenerate host keys on cloned VMs: 52 + 42 53 ```bash 43 54 sudo ssh-keygen -A 44 55 sudo systemctl restart sshd 45 56 ``` 46 57 47 58 ### UFW Firewall 59 + 48 60 ```bash 49 61 sudo ufw enable 50 62 sudo ufw allow ssh ··· 56 68 ``` 57 69 58 70 ### Active Connection Monitoring 71 + 59 72 ```bash 60 73 sudo netstat -tunap # All connections with PIDs 61 74 sudo netstat -tunap | grep ESTABLISHED # Only active ··· 65 78 ``` 66 79 67 80 ### MikroTik Router 81 + 68 82 **CLI**: 83 + 69 84 ```bash 70 85 /ip address print 71 86 /ip address add address=192.168.1.1/24 interface=ether3 ··· 77 92 Default login: `admin` / (blank password) 78 93 79 94 ### Rsync + Cron 95 + 80 96 **Rsync common patterns**: 97 + 81 98 ```bash 82 99 rsync -av source/ dest/ # Basic sync 83 100 rsync -av --delete source/ dest/ # Mirror (delete extra files in dest) ··· 87 104 ``` 88 105 89 106 **Cron syntax**: `minute hour day month weekday command` 107 + 90 108 ``` 91 109 0 2 * * * /path/to/backup.sh # Daily at 2 AM 92 110 */15 * * * * /path/to/script.sh # Every 15 minutes ··· 95 113 96 114 ## Distribution Differences 97 115 98 - | Feature | Ubuntu | Kali | CentOS/RHEL | 99 - |---------|--------|------|-------------| 100 - | Apache service | `apache2` | `apache2` | `httpd` | 101 - | Network config | netplan YAML | interfaces | ifcfg-* scripts | 102 - | Firewall | UFW | iptables | firewall-cmd | 103 - | Cron service | `cron` | `cron` | `crond` | 116 + | Feature | Ubuntu | Kali | CentOS/RHEL | 117 + | -------------- | ------------ | ---------- | ---------------- | 118 + | Apache service | `apache2` | `apache2` | `httpd` | 119 + | Network config | netplan YAML | interfaces | ifcfg-\* scripts | 120 + | Firewall | UFW | iptables | firewall-cmd | 121 + | Cron service | `cron` | `cron` | `crond` | 104 122 105 123 **Router (2025)**: All distributions use MikroTik (replaces CentOS router) 106 124 ··· 117 135 118 136 ## Critical Configuration Locations 119 137 120 - | Service | Config File(s) | 121 - |---------|---------------| 122 - | SSH | `/etc/ssh/sshd_config` | 123 - | Apache (Ubuntu) | `/etc/apache2/apache2.conf`, `/etc/apache2/sites-available/` | 124 - | Apache (CentOS) | `/etc/httpd/conf/httpd.conf`, `/etc/httpd/conf.d/` | 125 - | Network (Kali) | `/etc/network/interfaces` | 126 - | Network (Ubuntu) | `/etc/netplan/*.yaml` | 127 - | Network (CentOS) | `/etc/sysconfig/network-scripts/ifcfg-*` | 128 - | DNS resolution | `/etc/resolv.conf` | 129 - | Cron jobs | `crontab -e` (per-user), `/etc/crontab` (system-wide) | 138 + | Service | Config File(s) | 139 + | ---------------- | ------------------------------------------------------------ | 140 + | SSH | `/etc/ssh/sshd_config` | 141 + | Apache (Ubuntu) | `/etc/apache2/apache2.conf`, `/etc/apache2/sites-available/` | 142 + | Apache (CentOS) | `/etc/httpd/conf/httpd.conf`, `/etc/httpd/conf.d/` | 143 + | Network (Kali) | `/etc/network/interfaces` | 144 + | Network (Ubuntu) | `/etc/netplan/*.yaml` | 145 + | Network (CentOS) | `/etc/sysconfig/network-scripts/ifcfg-*` | 146 + | DNS resolution | `/etc/resolv.conf` | 147 + | Cron jobs | `crontab -e` (per-user), `/etc/crontab` (system-wide) | 148 + 149 + ## Credits 150 + 151 + These writeups are based on real NCAE competition experience and consolidate knowledge from: 152 + 153 + - NCAE Cyber Games competition materials 154 + - Various Linux distribution documentation 155 + - Hands-on competition debugging and troubleshooting 156 + 157 + > [!NOTE] 158 + > The main repository is hosted on [tangled.org](https://tangled.org/dunkirk.sh/ncae-tools), with GitHub serving as a mirror. 159 + 160 + <p align="center"> 161 + <img src="https://raw.githubusercontent.com/taciturnaxolotl/carriage/master/.github/images/line-break.svg" /> 162 + </p> 163 + 164 + <p align="center"> 165 + &copy 2025-present <a href="https://github.com/taciturnaxolotl">Kieran Klukas</a> 166 + </p> 167 + 168 + <p align="center"> 169 + <a href="https://github.com/taciturnaxolotl/ncae-tools/blob/main/LICENSE.md"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a> 170 + </p>