-
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 level 2 of intercepting communication
- Loading branch information
1 parent
dd8d117
commit 7919d1e
Showing
6 changed files
with
30 additions
and
5 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 +1 @@ | ||
From your host at 10.0.0.1, connect to the target server at 10.0.0.2 on port 31337. | ||
From your host at 10.0.0.1, connect to the remote host at 10.0.0.2 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 @@ | ||
From your host at 10.0.0.1, listen on port 31337 for a connection from the remote host at 10.0.0.2. |
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,26 @@ | ||
#!/usr/bin/exec-suid --real -- /usr/bin/python -I | ||
|
||
import socket | ||
from dojjail import Host, Network | ||
import time | ||
|
||
flag = open("/flag").read() | ||
|
||
class ClientHost(Host): | ||
def entrypoint(self): | ||
while True: | ||
try: | ||
client_socket = socket.socket() | ||
client_socket.connect(("10.0.0.1", 31337)) | ||
client_socket.sendall(flag.encode()) | ||
client_socket.close() | ||
time.sleep(1) | ||
except (ConnectionError, TimeoutError): | ||
continue | ||
|
||
user_host = Host("ip-10-0-0-1") | ||
server_host = ClientHost("ip-10-0-0-2") | ||
network = Network(hosts=[user_host, server_host]) | ||
network.run() | ||
|
||
user_host.interact() |