Skip to content
Permalink
Browse files
Created rough outline of README and started building target container
  • Loading branch information
digehode committed Jul 30, 2020
1 parent c8a2fab commit 9d60e4974461e8f6cf21602ec7deb788bcc54b90
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 1 deletion.
@@ -18,8 +18,12 @@ and their binary, decimal or hexadecimal (hex) representation. For
example, the capital letter A has the ASCII code 65. 65 in hex
is 41. In octal it is 101, and in binary it is 01000001.

# The Target

# Completing Transcoder
TODO


# Completing HarbourMaster

TODO:

@@ -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"]

@@ -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)
@@ -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
@@ -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

@@ -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>

0 comments on commit 9d60e49

Please sign in to comment.