final version
This commit is contained in:
8
ctl.sh
8
ctl.sh
@@ -16,6 +16,14 @@ case "${1}" in
|
|||||||
docker-compose up -d;
|
docker-compose up -d;
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
reinit )
|
||||||
|
yes | docker-compose rm --stop;
|
||||||
|
docker rmi $(docker images | grep "docker_and_networks" | awk '{print $1}');
|
||||||
|
docker rmi $(docker images | grep "ngx-template" | awk '{print $1}');
|
||||||
|
docker rmi $(docker images | grep "visor" | awk '{print $1}');
|
||||||
|
docker-compose up -d;
|
||||||
|
;;
|
||||||
|
|
||||||
watch )
|
watch )
|
||||||
watch "docker-compose ps"
|
watch "docker-compose ps"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ services:
|
|||||||
|
|
||||||
visor:
|
visor:
|
||||||
container_name: visor
|
container_name: visor
|
||||||
|
image: visor
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./dockerfiles/Dockerfile_visor
|
dockerfile: ./dockerfiles/Dockerfile_visor
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ ARG NET_NAME=kek
|
|||||||
ARG CONTAINER_NAME=lol
|
ARG CONTAINER_NAME=lol
|
||||||
ARG STATIC_FILE=/usr/share/nginx/html/index.html
|
ARG STATIC_FILE=/usr/share/nginx/html/index.html
|
||||||
|
|
||||||
|
COPY ./scripts/.env /root/scripts/.env
|
||||||
|
|
||||||
# change default nginx index.html
|
# change default nginx index.html
|
||||||
RUN sed -i '13,21d' $STATIC_FILE && \
|
RUN sed -i '13,21d' $STATIC_FILE && \
|
||||||
sed -i "13i <table>\
|
sed -i "13i <table>\
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
FROM nginx:latest
|
FROM nginx:latest
|
||||||
|
|
||||||
COPY ./scripts/knocking_setup.sh /root/scripts/knocking_setup.sh
|
COPY ./scripts/knocking_setup.sh /root/scripts/knocking_setup.sh
|
||||||
|
COPY ./scripts/.env /root/scripts/.env
|
||||||
|
|
||||||
|
WORKDIR /root/scripts/
|
||||||
|
|
||||||
RUN apt update \
|
RUN apt update \
|
||||||
&& apt install knockd htop iptables iproute2 vim curl -y
|
&& apt install knockd htop iptables iproute2 vim curl -y
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
FROM ubuntu:latest
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
COPY ./scripts/.env /root/scripts/.env
|
||||||
|
COPY ./scripts/block_port.sh /root/scripts/block_port.sh
|
||||||
|
|
||||||
|
WORKDIR /root/scripts/
|
||||||
|
|
||||||
CMD apt update \
|
CMD apt update \
|
||||||
&& apt install iproute2 vim curl nmap knockd -y \
|
&& apt install iproute2 vim curl nmap knockd -y \
|
||||||
&& sleep infinity
|
&& sleep infinity
|
||||||
|
|||||||
@@ -4,18 +4,20 @@
|
|||||||
INTERFACE=$(ip -br a | grep -E "172.28" | awk '{print $1}') || \
|
INTERFACE=$(ip -br a | grep -E "172.28" | awk '{print $1}') || \
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
source .env
|
||||||
|
|
||||||
echo -E "
|
echo -E "
|
||||||
[options]
|
[options]
|
||||||
Interface = ${INTERFACE%@*}
|
Interface = ${INTERFACE%@*}
|
||||||
|
|
||||||
[openNGINX]
|
[openNGINX]
|
||||||
sequence = 8100, 7200, 13000
|
sequence = ${OPEN_PORT_SEQ}
|
||||||
seq_timeout = 5
|
seq_timeout = 5
|
||||||
command = /sbin/iptables -D INPUT -p tcp --dport 80 -j REJECT
|
command = /sbin/iptables -D INPUT -p tcp --dport 80 -j REJECT
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
|
|
||||||
[closeNGINX]
|
[closeNGINX]
|
||||||
sequence = 6300, 5200, 12001
|
sequence = ${CLOSE_PORT_SEQ}
|
||||||
seq_timeout = 5
|
seq_timeout = 5
|
||||||
command = /sbin/iptables -A INPUT -p tcp --dport 80 -j REJECT
|
command = /sbin/iptables -A INPUT -p tcp --dport 80 -j REJECT
|
||||||
tcpflags = syn
|
tcpflags = syn
|
||||||
|
|||||||
Reference in New Issue
Block a user