Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Created rough outline of README and started building target container
- Loading branch information
Showing
6 changed files
with
109 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM ubuntu:bionic | ||
ARG DEBIAN_FRONTEND=noninteractive | ||
RUN apt-get update | ||
|
||
RUN apt-get -y install python3-pip | ||
RUN apt-get -y install apache2 | ||
RUN apt-get -y install libapache2-mod-php | ||
RUN apt-get -y install net-tools | ||
RUN apt-get -y install python3 | ||
COPY app /root/app/ | ||
COPY web /var/www/html/ | ||
RUN sed -i -e 's/AllowOverride None/AllowOverride All/g' /etc/apache2/apache2.conf | ||
RUN sed -i -e 's/Require all denied/Require all granted/g' /etc/apache2/apache2.conf | ||
|
||
#RUN chmod u+x /root/app/starter.sh | ||
#CMD ["/root/app/starter.sh"] | ||
|
||
RUN chmod u+x /root/app/wydah.py | ||
CMD ["/root/app/wydah.py"] | ||
|
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,10 @@ | ||
NAME=wydah | ||
PROJ=harbourmaster | ||
ALL: Dockerfile | ||
docker build $(OPTS) -t $(PROJ)_$(NAME) . | ||
run: | ||
docker run -t --name $(PROJ)_$(NAME) $(PROJ)_$(NAME) | ||
|
||
clean: | ||
-docker kill $(PROJ)_$(NAME) | ||
-docker rm $(PROJ)_$(NAME) |
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,18 @@ | ||
#!/bin/bash | ||
|
||
/etc/init.d/apache2 start | ||
|
||
for (( ; ; )) | ||
do | ||
|
||
echo | ||
echo "-------------------------" | ||
echo " Wydah Started" | ||
echo "-------------------------" | ||
echo | ||
echo -n "IP: " | ||
ifconfig eth0|grep inet[^6]|cut -d " " -f 10 | ||
|
||
sleep 3 | ||
clear | ||
done |
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/python3 | ||
import socket | ||
import random | ||
import os | ||
portOptions=[37000+x*100+x*2 for x in range(9)] | ||
print(portOptions) | ||
port=random.choice(portOptions) | ||
hostname=socket.gethostname() | ||
|
||
serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
|
||
serversocket.bind((hostname, port)) | ||
os.system("""ifconfig eth0|grep inet[^6]|cut -d " " -f 10""") | ||
print(f"Serving on port {port}") | ||
|
||
serversocket.listen() | ||
response1=b"57 65 6c 63 6f 6d 65 20 74 6f 20 57 79 64 61 68" | ||
|
||
|
||
|
||
class WydSock: | ||
def __init__(self, sock): | ||
self.sock = sock | ||
|
||
def send(self, msg): | ||
self.sock.sendall(msg) | ||
|
||
def rcv(self): | ||
chunks = [] | ||
bytes_recd = 0 | ||
chunks=[] | ||
while bytes_recd <=0: | ||
chunk = self.sock.recv(1024) | ||
chunks.append(chunk) | ||
bytes_recd = len(chunk) | ||
return b''.join(chunks) | ||
|
||
def close(self): | ||
self.sock.shutdown(socket.SHUT_RDWR) | ||
self.sock.close() | ||
while True: | ||
(clientsocket, address) = serversocket.accept() | ||
print(f"Got a connection from {address}") | ||
s=WydSock(clientsocket) | ||
s.send(response1) | ||
s.close() | ||
serversocket.shutdown(socket.SHUT_RDWR) | ||
serversocket.close() | ||
break | ||
|
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,6 @@ | ||
<html> | ||
<head><title>Wydah</title></head> | ||
<body> | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/TZw4M1yHta8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | ||
</body> | ||
</html> |