Summary Log: UDP Client-Server Test Using Black Hat Python

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

  1. 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 (โœ…)
  2. UDP Client (udp_client.py)
    • Sends "AAABBBCCC" to 127.0.0.1:9997
    • Waits for response using recvfrom()
    • Displays response on console

โœ… 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 ~/bhp folder for continued development