-
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.
Update intercepting communication monitor levels
- Loading branch information
1 parent
9aea8ce
commit 8dc685f
Showing
9 changed files
with
88 additions
and
8 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 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 @@ | ||
Monitor traffic from a remote host. | ||
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,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() |
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 @@ | ||
Monitor slow traffic from a remote host. | ||
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,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() |