Date: June 30, 2025
Machine: Kali Linux (Wing IDE Personal 11)
Project: Black Hat Python โ Networking (UDP Socket)
Path: ~/bhp/udp_client.py + ~/bhp/udp_server.py
๐ง Objective
Test basic UDP communication using raw Python sockets, following the example from Black Hat Python.
๐ฐ๏ธ Setup
- UDP Server (
udp_server.py)- Listens on
127.0.0.1:9997 - Receives incoming data via
recvfrom() - Responds using
.sendto()with UTF-8 encoded confirmation - UTF-8 encoding required to include emoji (
โ)
- Listens on
- UDP Client (
udp_client.py)- Sends
"AAABBBCCC"to127.0.0.1:9997 - Waits for response using
recvfrom() - Displays response on console
- Sends
โ Outcome
- Server launched successfully:
๐ฐ๏ธ UDP server up, waiting for data... - Client received response:
๐ก Response from server: โ Data received - Server printed:
๐จ Received from ('127.0.0.1', xxxxx): AAABBBCCC - All components functioned correctly within Wing IDE 11
๐๏ธ Notes
- Initial syntax error (
bytes can only contain ASCII literal characters) resolved by encoding Unicode string using.encode('utf-8') - Both scripts saved and versioned inside the
~/bhpfolder for continued development