I participated in NahamCon CTF 2025, organized by JohnHammond, as a member of my institute’s club, InfoSecIITR. This writeup details the challenge I solved during the competition.
Networking
A Special ID
Challenge Description
483 points - Networking - 60 Solves - hard
Author: @Kkevsterrr
We’ve got a brand new, state of the art firewall here to protect our webserver.
For top of the line protection, only packets with specific IPIDs are allowed.
NOTE: Accessing this challenge by the link below will time out. This connection refused is intentional. The challenge is not broken, and it is your task to understand how to connect to it. Port 8080 is the only port in scope for this challenge.
Connect to this challenge at http://137.184.230.90:8080
Solution
As mentioned in the description, only packets with specific IPIDs are allowed.
1 | The IPID (IP Identification field) is a 16-bit field in the IPv4 header, used to uniquely identify fragments of an original IP datagram. Here's what you need to know about its possible values in a raw packet: |
To exploit this, I began crafting packets using the Scapy Python library with different IPID values. Naturally, I started with 1337, a well-known number in cybersecurity culture. When I sent a SYN packet with IPID 1337, I received a SYN-ACK response with IPID 0.
However, when I sent an ACK packet with an IPID other than 1337, the firewall dropped it. This indicated that only packets with IPID 1337 were permitted beyond the initial handshake. So, I adjusted my approach and sent all packets with a fixed IPID of 1337.
Initial Python Script to Send the Packets
1 | from scapy.all import * |
Output of the initial script:
1 | $ sudo -E python3 ipid.py |
Despite establishing the connection, I didn’t receive the flag on the first attempt. I noticed that I was only receiving 5360 bytes, whereas the Content-Length header indicated 31491 bytes (~31.5 KB). This suggested the connection was getting terminated too early.
To address this, I modified the script to continuously send ACK packets to keep the TCP connection alive until the full content was received.
Modified Script:
1 | from scapy.all import * |
Output of the modified script:
1 | $ sudo -E python3 ipid.py |
Flag
1 | flag{4e3dd38dcd14821aa327e2c96af2799d} |