Asset Exposure Dynamics
0x00 - Executive Summary
The illusion of obscurity is a fatal strategic error. Any asset assigned a public IP is under constant observation by global automated botnets. This operation focuses on deploying a low-interaction honeypot to capture, filter, and analyze these persistent reconnaissance patterns and brute-force attempts.
Impact Analysis: We transform a vulnerable exposure into a high-fidelity intelligence sensor, allowing us to map attacker IPs and fingerprint automated tools before they touch critical infrastructure.
0x01 - Prerequisites & Tooling
To follow this guide and replicate the lab environment, the following assets are required:
- Host: Exposed Linux Instance (
Ubuntu/Debianbased). - Sensing:
portsentry(Advanced Detection Engine). - Logging:
systemd-journald(Centralized Log Management). - Networking:
iproute2(ss),netcat-traditional.
0x02 - The Theory: Why it works
Attackers utilize mass-scanning tools (zmap/masscan) to index the entire IPv4 space in minutes. By mimicking open ports that hold no real service, we shift the advantage.
Red Team Insight: 100% of public-facing IPs are targeted within minutes of exposure. Automated reconnaissance is the baseline noise of the modern internet; visibility into this noise is the first step of defense.
0x03 - Step-by-Step Execution
Phase 1: Initial Reconnaissance
Before deployment, validate system load and current socket state to establish a baseline.
uptime
04:04:04 up 12 days, 1:22, 1 user, load average: 0.08, 0.03, 0.01
sudo ss -nlptu
Netid State Recv-Q Send-Q Local Address:Port Process
tcp LISTEN 0 128 0.0.0.0:22 users:(("sshd",pid=842,fd=3))
tcp LISTEN 0 511 0.0.0.0:80 users:(("apache2",pid=910,fd=4))
Phase 2: Sensor Deployment
Deploying portsentry to monitor unauthorized connection attempts on unused ports.
sudo apt install portsentry -y && sudo systemctl start portsentry
Reading package lists... Done
Setting up portsentry (1.2-17)...
Created symlink /etc/systemd/system/multi-user.target.wants/portsentry.service.
Phase 3: Real-time Intelligence Gathering
Monitoring the system journal for specific attack alerts generated by the honeypot.
sudo journalctl -u portsentry -f | grep "attackalert"
Feb 09 04:05:01 ngr3p portsentry[1024]: attackalert: Connect from host: 192.168.x.x/192.168.x.x to TCP port: 1234
Feb 09 04:05:05 ngr3p portsentry[1024]: attackalert: Connect from host: 45.128.x.x/45.128.x.x to TCP port: 3389
Phase 4: SSH Brute-Force Triage
Filtering failed authentication attempts to identify active password-spraying campaigns.
sudo journalctl -u ssh -f | grep "Failed"
Feb 09 04:06:12 ngr3p sshd[2045]: Failed password for root from 185.x.x.x port 44322 ssh2
Feb 09 04:06:15 ngr3p sshd[2048]: Failed password for admin from 185.x.x.x port 44328 ssh2
0x04 - Offense Informs Defense
To mitigate these vectors, security administrators should implement the following hardening steps:
- Mitigation: Implement
Fail2Banto ingest journal logs and dynamically updatenftablesdrop rules. - Detection: Monitor Event IDs related to service start/stop to ensure the honeypot isn't deactivated by an intruder.
| Modern Command | Legacy Equivalent | Function |
|---|---|---|
ss -nlptu |
netstat -nlptu |
Socket Statistics |
journalctl -u [svc] |
tail -f /var/log/syslog |
Log Aggregation |
systemctl start |
service start |
Service Orchestration |
apt |
apt-get |
Package Management |