Introduction

On 25 November 2026 I gave a guest lecture at the University of Trento, titled “Protocols Security Assessment”. The seminar was hosted by Professor Fabrizio Granelli, who supervised my Bachelor’s thesis back when I was a student there. Going back to the same lecture hall where I studied for both my Bachelor’s and Master’s degree was a nostalgic moment and also a good occasion to share what I wish someone had told me before I entered the industry.

The talk covered three parts: an introduction to how information security is structured in companies, a threat modeling method for network protocols and two live labs on HTTP request smuggling and SNMP. The slides and lab code are on GitHub in the public repository ProtocolsSecurityAssessmentUnitn.

University and Industry

My Computer Science courses at UniTn were solid. I learned cryptography, network protocols, secure design principles and plenty of theory. What they never covered was how security work is actually organised inside a company. Who owns a vulnerability once it is found. How a pentest is scoped before it starts. How a finding becomes a tracked issue with an owner and a deadline. How a security team fits into an organization alongside product teams with their own priorities.

That gap only closed once I started working as a pentester and it took longer than it should have. I dedicated the opening slides of the seminar to it: a slide on the different roles that make up an information security team inside a company and a penetration testing process slide that shows scoping, threat modeling, testing and reporting as a repeatable engineering pipeline, not a one-off hacking session.

A second gap was Microsoft protocols. University networking courses cover TCP/IP, DNS, HTTP and similar foundational protocols, but say almost nothing about SMB, Kerberos, NTLM, RDP, LDAP or the rest of the stack that dominates real corporate environments, especially in Active Directory engagements. I listed the most relevant ones and used EternalBlue (MS17-010) as a bonus case study. A good illustration of what a protocol-level bug in production can actually cost.

Lab 1: HTTP request smuggling (CL.TE)

This lab reproduces a real CL.TE smuggling vulnerability using Pound 4.11.90 (commit 8d86d52d0bc65534c33018b0a01996081d23b89e) as the frontend reverse proxy and Gunicorn 20.0.4 with Flask 2.3.3 as the backend. Pound blocks any direct request to /admin with a 403. The goal is to reach /admin on the backend without the frontend ever seeing the path.

The root cause is a single trailing space. Pound’s parser matches the Transfer-Encoding header value against the exact token chunked. The value chunked with a trailing space is not recognized as that token, so Pound skips its anti-smuggling check, frames the body using Content-Length and forwards both headers to the backend unchanged. Gunicorn, on the other hand, treats the body as chunked whenever the value contains chunked as a substring. It consumes the chunked terminator and considers the body complete, leaving whatever bytes follow in its receive buffer.

The lab topology is straightforward: the host machine runs attack.py and talks to Pound on port 80. Pound sits in front of Gunicorn on port 5000, both on the same Docker bridge network.

HTTP smuggling lab topology: host machine sends to Pound on port 80, Pound forwards to Gunicorn on port 5000 over a Docker bridge network

The two containers start with docker compose up:

Pound and Gunicorn containers starting up

A direct GET /admin through the frontend confirms the Pound’s routing rule is working:

Direct GET /admin blocked by Pound with a 403 Forbidden response

The attack sends one POST / carrying both Content-Length and Transfer-Encoding: chunked headers over a keep-alive connection. The body ends with the chunked terminator 0\r\n\r\n, immediately followed by a GET /admin prefix. Pound reads Content-Length, never notices the Transfer-Encoding and forwards the full request including both headers. Gunicorn reads chunked, stops at the terminator and leaves the GET /admin prefix sitting in the socket buffer:

Smuggling carrier: POST / with both Content-Length and Transfer-Encoding headers, smuggled GET /admin prefix visible in the body

A second GET / is then sent on the same keep-alive connection. The backend prepends the leftover bytes from the buffer to this new request, reassembles it as GET /admin and serves the admin page. The WAF never saw /admin in either request:

Follow-up GET / receives the admin page response including the flag, because the backend reassembled it with the smuggled prefix

The same attack can be run end to end with the provided attack.py script, which sends both requests over one keep-alive connection and prints both responses:

python3 attack.py

attack.py output showing both responses: response 1 is 200 from POST /, response 2 is 200 from the smuggled GET /admin with the flag in the body

The flag in the response flag{cl_te_smuggling_success} and the note: "Only reachable via request smuggling." field confirm the attack worked end to end. The fix is to make the frontend and backend agree on one body-framing mechanism. The long-term solution is HTTP/2 for upstream connections, because its binary, explicitly-length-encoded frames make the Content-Length and Transfer-Encoding ambiguity impossible.

Lab 2: SNMP

This lab uses snmpPoC against a deliberately vulnerable Net-SNMP 5.9.4 agent, with a legitimate manager polling it every 5 seconds and an attacker container running the PoC.

SNMP lab topology: legitimate NMS polling the agent every 5 seconds, attacker in the middle via arpspoof running tcpdump and snmpPoC

Starting the lab:

Three-container SNMP lab starting up: snmp-agent running Net-SNMP 5.9.4, snmp-manager polling every 5 seconds, snmp-attacker

The PoC runs community-string brute-force, full MIB disclosure, write-permission check and RCE detection in sequence:

Full snmpPoC output: community strings public and private found, OS and kernel version, IP addresses, running processes, storage units, write permission confirmed for private, RCE detection flagging the agent as exploitable

A few things stand out in that output. public and private are the top two entries in the wordlist and are found immediately because the agent ships with the most common defaults. A single unauthenticated read then dumps the OS version Linux lab-agent 5.15, the full process table, all configured IP addresses and storage information. No exploitation is needed, only a valid community string.

Since SNMPv1 and v2c carry the community string in clear text, a network position is enough to recover it passively. The lab demonstrates this with ARP spoofing: the attacker poisons both the manager and the agent so all traffic flows through it, then runs tcpdump on the bridge. The community string public appears in every packet:

tcpdump on the attacker container after ARP spoofing, showing the community string public in clear text in every GetRequest

The private community string carries write permission. A single snmpset is enough to tamper with the agent’s configuration:

snmpset with the private community string overwrites sysLocation.0 to “Pwned by attacker” with no authentication beyond the guessable string

The most severe issue is RCE via NET-SNMP-EXTEND-MIB. If the EXTEND-MIB module is active and writable, the write community string is enough to register an arbitrary shell command at runtime and read its output back over SNMP, with no file or config access on the host. The lab demonstrates this by injecting a command that dumps /etc/shadow base64-encoded via snmpset:

docker exec snmp-attacker snmpset -m +NET-SNMP-EXTEND-MIB -v2c -c private snmp-agent \
  'nsExtendStatus."shadow"'  = createAndGo \
  'nsExtendCommand."shadow"' = /bin/sh \
  'nsExtendArgs."shadow"'    = '-c "cat /etc/shadow | base64"'

The command is now registered on the agent. Reading the output back over SNMP and decoding it:

/etc/shadow dumped from the agent via NET-SNMP-EXTEND-MIB, decoded from base64, with the admin password hash visible at the bottom

The admin password hash is visible at the bottom of the output. The entire chain, from brute-forcing the community string to reading /etc/shadow, required no authentication beyond a guessable string sent in clear text over UDP.

The fix is SNMPv3 in authPriv mode: per-user HMAC authentication, AES-encrypted payloads, least-privilege OID views scoped to what each user actually needs, NET-SNMP-EXTEND-MIB disabled and the agent firewalled to trusted manager IPs only.

Conclusion

Both labs are intentionally small: one protocol, one specific parser disagreement or missing authentication primitive, one clear impact. That is the approach I’d suggest to any student starting out in protocol security. Pick one protocol, ask what it was built for, what a user can control and what breaks if confidentiality, integrity or availability is violated, then test it in a disposable environment.

Thanks to Professor Granelli and the University of Trento for having me back. Keep learning and happy hacking!