-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8dc685f
commit a400a0a
Showing
7 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Monitor traffic from a remote host. | ||
Your host is already receiving traffic on port `31337`. | ||
Your host is already receiving traffic on port `31337`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Monitor slow traffic from a remote host. | ||
Your host is already receiving traffic on port `31337`. | ||
Your host is already receiving traffic on port `31337`. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Hijack traffic from a remote host by configuring your network interface. | ||
The remote host at `10.0.0.2` is communicating with the remote host at `10.0.0.3` on port `31337`. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/exec-suid --real -- /usr/bin/python -I | ||
|
||
import os | ||
import socket | ||
import subprocess | ||
import time | ||
from dojjail import Host, Network | ||
|
||
flag = open("/flag").read() | ||
|
||
class ClientHost(Host): | ||
def entrypoint(self): | ||
if os.fork() == 0: | ||
while True: | ||
subprocess.run(["/bin/ip", "neigh", "flush", "all"], | ||
check=True, | ||
stdin=subprocess.DEVNULL, | ||
stdout=subprocess.DEVNULL, | ||
stderr=subprocess.DEVNULL) | ||
time.sleep(1) | ||
while True: | ||
try: | ||
client_socket = socket.socket() | ||
client_socket.connect(("10.0.0.3", 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 = Host("ip-10-0-0-1") | ||
client_host = ClientHost("ip-10-0-0-2") | ||
server_host = ServerHost("ip-10-0-0-3") | ||
network = Network(hosts={user_host: "10.0.0.1", client_host: "10.0.0.2", server_host: "10.0.0.3"}, subnet="10.0.0.0/24") | ||
network.run() | ||
|
||
user_host.interact() |