Initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
FROM public.ecr.aws/docker/library/ruby:2.7.2
|
||||
|
||||
ARG PASSWORD
|
||||
|
||||
RUN echo root:${PASSWORD} | chpasswd
|
||||
RUN apt-get update && apt-get install -y openssh-server curl
|
||||
RUN echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
||||
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
||||
RUN service ssh start
|
||||
|
||||
WORKDIR /ctf/art/
|
||||
|
||||
RUN useradd -m ctf
|
||||
RUN chown -R root:root /ctf/art/
|
||||
|
||||
COPY Gemfile .
|
||||
COPY app.rb .
|
||||
COPY start.sh .
|
||||
|
||||
RUN bundle install
|
||||
RUN touch /flag.txt
|
||||
|
||||
RUN chmod +x start.sh
|
||||
CMD ./start.sh
|
||||
@@ -0,0 +1,4 @@
|
||||
source "http://rubygems.org"
|
||||
|
||||
gem "sinatra"
|
||||
gem "slim"
|
||||
@@ -0,0 +1,14 @@
|
||||
require "sinatra"
|
||||
require "slim"
|
||||
|
||||
set :port, 8080
|
||||
set :bind, '0.0.0.0'
|
||||
set :environment, :production
|
||||
|
||||
get '/' do
|
||||
redirect '/art/gemastik'
|
||||
end
|
||||
|
||||
get '/art/:word' do
|
||||
return Slim::Template.new{ '<iframe height="100%" width="100%" frameborder="0" src=https://asciified.thelicato.io/api/v2/ascii?text=' + params[:word] + '></iframe>' }.render
|
||||
end
|
||||
@@ -0,0 +1,11 @@
|
||||
version: '3'
|
||||
services:
|
||||
art:
|
||||
restart: always
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- PASSWORD=root
|
||||
ports:
|
||||
- "10000:8080"
|
||||
- "10022:22"
|
||||
@@ -0,0 +1,5 @@
|
||||
# run sshd
|
||||
/usr/sbin/sshd -D &
|
||||
# run the command
|
||||
su ctf -c "bundle install"
|
||||
su ctf -c "ruby /ctf/art/app.rb"
|
||||
Reference in New Issue
Block a user