holy shit

This commit is contained in:
Ashley Graves 2024-10-17 23:03:23 +02:00
parent 470a45500d
commit 7ca81d1869
19 changed files with 55 additions and 9 deletions

View file

@ -1,11 +1,19 @@
FROM docker.io/alpine:latest
ADD banner.txt /etc/vsftpd/banner.txt
ADD vsftpd.pem /etc/vsftpd/vsftpd.pem
ADD vsftpd.key /etc/vsftpd/vsftpd.key
ADD vsftpd.conf /etc/vsftpd/vsftpd.conf
ARG S6_OVERLAY_VERSION=3.2.0.2
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
ADD data /etc/vsftpd
ADD conf /conf
ADD cont-init.d /etc/cont-init.d
ADD s6-rc.d /etc/s6-overlay/s6-rc.d
ADD setup.sh /setup.sh
RUN /setup.sh
CMD /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf
#CMD sh
RUN /setup.sh && rm /setup.sh
ENTRYPOINT ["/init"]

View file

@ -10,6 +10,7 @@ seccomp_sandbox=NO
xferlog_std_format=NO
log_ftp_protocol=YES
anon_root=/var/ftp
pasv_addr_resolve=YES
pasv_max_port=65515
pasv_min_port=65500
max_per_ip=0
@ -34,5 +35,6 @@ ssl_ciphers=HIGH
xferlog_enable=YES
xferlog_std_format=NO
log_ftp_protocol=YES
#vsftpd_log_file=/var/log/vsftpd.log
vsftpd_log_file=/proc/1/fd/1
include(`/conf/etc.m4')dnl

1
conf/etc.m4 Normal file
View file

@ -0,0 +1 @@
# This will be overwritten by /etc/cont-init.d/init.sh

1
conf/explicit.m4 Normal file
View file

@ -0,0 +1 @@
include(`/conf/base.m4')dnl

4
conf/implicit.m4 Normal file
View file

@ -0,0 +1,4 @@
include(`/conf/base.m4')dnl
implicit_ssl=YES
listen_port=990

13
cont-init.d/init.sh Executable file
View file

@ -0,0 +1,13 @@
#!/command/with-contenv sh
echo "# Written by init.sh" > /conf/etc.m4
VARS=$(env | awk -F "=" '{print $1}' | grep -i "vsftpd_")
for var in $VARS; do
name=$(echo $var | sed "s/^vsftpd_//gi" | tr '[:upper:]' '[:lower:]')
echo "$name=$(printenv $var)" >> /conf/etc.m4
done
m4 /conf/explicit.m4 > /etc/vsftpd/explicit.conf
m4 /conf/implicit.m4 > /etc/vsftpd/implicit.conf
cat /etc/vsftpd/implicit.conf

11
docker-compose.yml Normal file
View file

@ -0,0 +1,11 @@
services:
ftp:
image: git.incest.world/ashley/vsftpd-anon:latest
restart: unless-stopped
environment:
VSFTPD_PASV_ADDRESS: google.com
VSFTPD_PASV_ADDR_RESOLVE: YES
ports:
- '990:990/tcp'
- '20-21:20-21/tcp'
- '65500-65515:65500-65515/tcp'

View file

View file

2
s6-rc.d/vsftpd-implicit/run Executable file
View file

@ -0,0 +1,2 @@
#!/command/execlineb -P
exec /usr/sbin/vsftpd /etc/vsftpd/implicit.conf

View file

@ -0,0 +1 @@
longrun

View file

2
s6-rc.d/vsftpd/run Executable file
View file

@ -0,0 +1,2 @@
#!/command/execlineb -P
exec /usr/sbin/vsftpd /etc/vsftpd/explicit.conf

1
s6-rc.d/vsftpd/type Normal file
View file

@ -0,0 +1 @@
longrun

View file

@ -2,7 +2,7 @@
apk update && \
apk upgrade && \
apk add openssl vsftpd && \
apk add m4 vsftpd && \
mkdir -p /var/ftp && \
mkdir -p /var/run/vsftpd/empty && \
chmod 777 /etc /etc/vsftpd /etc/vsftpd/vsftpd.pem /etc/vsftpd/vsftpd.key && \