Skip to content

Commit

Permalink
Update intercepting communication monitor levels
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorNelson committed Feb 21, 2025
1 parent 9aea8ce commit 8dc685f
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 8 deletions.
6 changes: 2 additions & 4 deletions dojo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ modules:
- id: level-4
name: Scan 2
- id: level-5
name: level5
description: Monitor traffic from a remote host
name: Monitor 1
- id: level-6
name: level6
description: Monitor slow traffic from a remote host
name: Monitor 2
- id: level-7
name: level7
description: Hijack traffic from a remote host by configuring your network interface
Expand Down
1 change: 0 additions & 1 deletion intercepting-communication/level-5/.config

This file was deleted.

1 change: 1 addition & 0 deletions intercepting-communication/level-5/.init
2 changes: 2 additions & 0 deletions intercepting-communication/level-5/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Monitor traffic from a remote host.
Your host is already receiving traffic on port `31337`.
1 change: 0 additions & 1 deletion intercepting-communication/level-5/run

This file was deleted.

39 changes: 39 additions & 0 deletions intercepting-communication/level-5/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/exec-suid --real -- /usr/bin/python -I

import socket
import time
from dojjail import Host, Network

flag = open("/flag").read()

class ClientHost(Host):
def entrypoint(self):
while True:
try:
client_socket = socket.socket()
client_socket.connect(("10.0.0.2", 31337))
client_socket.sendall(flag.encode())
client_socket.close()
time.sleep(10)
except (ConnectionError, TimeoutError):
continue

class ServerHost(Host):
def entrypoint(self):
server_socket = socket.socket()
server_socket.bind(("0.0.0.0", 31337))
server_socket.listen()
while True:
try:
connection, _ = server_socket.accept()
connection.recv(1024)
connection.close()
except ConnectionError:
continue

user_host = ClientHost("ip-10-0-0-1")
server_host = ServerHost("ip-10-0-0-2")
network = Network(hosts={user_host: "10.0.0.1", server_host: "10.0.0.2"}, subnet="10.0.0.0/24")
network.run()

user_host.interact()
1 change: 0 additions & 1 deletion intercepting-communication/level-6/.config

This file was deleted.

1 change: 1 addition & 0 deletions intercepting-communication/level-6/.init
2 changes: 2 additions & 0 deletions intercepting-communication/level-6/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Monitor slow traffic from a remote host.
Your host is already receiving traffic on port `31337`.
1 change: 0 additions & 1 deletion intercepting-communication/level-6/run

This file was deleted.

41 changes: 41 additions & 0 deletions intercepting-communication/level-6/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/exec-suid --real -- /usr/bin/python -I

import socket
import time
from dojjail import Host, Network

flag = open("/flag").read()

class ClientHost(Host):
def entrypoint(self):
while True:
try:
client_socket = socket.socket()
client_socket.connect(("10.0.0.2", 31337))
for c in flag:
client_socket.sendall(c.encode())
time.sleep(1)
client_socket.close()
time.sleep(10)
except (ConnectionError, TimeoutError):
continue

class ServerHost(Host):
def entrypoint(self):
server_socket = socket.socket()
server_socket.bind(("0.0.0.0", 31337))
server_socket.listen()
while True:
try:
connection, _ = server_socket.accept()
connection.recv(1024)
connection.close()
except ConnectionError:
continue

user_host = ClientHost("ip-10-0-0-1")
server_host = ServerHost("ip-10-0-0-2")
network = Network(hosts={user_host: "10.0.0.1", server_host: "10.0.0.2"}, subnet="10.0.0.0/24")
network.run()

user_host.interact()

0 comments on commit 8dc685f

Please sign in to comment.