Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Feb 24, 2025
1 parent 1391f81 commit 69bb6e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
8 changes: 2 additions & 6 deletions intercepting-communication/udp-1/run
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ class ServerHost(Host):
while True:
try:
client_message, (client_host, client_port) = server_socket.recvfrom(1024)
while True:
if not client_message:
break
if client_message == b"Hello, World!\n":
server_socket.sendto(flag.encode(), (client_host, client_port))
break
if client_message == b"Hello, World!\n":
server_socket.sendto(flag.encode(), (client_host, client_port))
except ConnectionError:
continue

Expand Down
10 changes: 2 additions & 8 deletions intercepting-communication/udp-2/run
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,8 @@ class ServerHost(Host):
while True:
try:
client_message, (client_host, client_port) = server_socket.recvfrom(1024)
while True:
if client_port != 31338:
break
if not client_message:
break
if client_message == b"Hello, World!\n":
server_socket.sendto(flag.encode(), (client_host, client_port))
break
if client_port == 31338 and client_message == b"Hello, World!\n":
server_socket.sendto(flag.encode(), (client_host, client_port))
except ConnectionError:
continue

Expand Down

0 comments on commit 69bb6e8

Please sign in to comment.