-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add challenge-base image with pluggable bashrc dir
- Loading branch information
1 parent
29a2490
commit 3148a84
Showing
6 changed files
with
84 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM phusion/baseimage | ||
MAINTAINER Pavel Sviderski <[email protected]> | ||
|
||
RUN apt-get update && apt-get --no-install-recommends -y install \ | ||
man wget vim nano screen tmux \ | ||
python python-pip python-virtualenv python3.4 python3-pip \ | ||
binutils build-essential gdb ltrace strace \ | ||
sqlite sqlite3 \ | ||
&& apt-get clean \ | ||
&& useradd -m box | ||
|
||
RUN rm -f /etc/service/sshd/down && /etc/my_init.d/00_regen_ssh_host_keys.sh \ | ||
&& rm -rf /etc/service/cron /etc/service/syslog-forwarder /etc/service/syslog-ng \ | ||
&& echo "box ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/box \ | ||
&& mkdir -p /.box/bashrc.d/root /.box/bashrc.d/box | ||
|
||
COPY ssh /root/.ssh | ||
COPY bashrc/root /root/.bashrc | ||
COPY bashrc/box /home/box/.bashrc | ||
|
||
COPY greeting /.box/greeting | ||
COPY start.sh /.box/start.sh | ||
|
||
EXPOSE 22 | ||
|
||
CMD /.box/start.sh |
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,8 @@ | ||
PS1='\[\033[01;32m\]\u\[\033[01;33m\]@\[\033[01;32m\]\h: \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]' | ||
alias ls="ls --color=auto" | ||
|
||
cd ~/ | ||
|
||
while read bashrc_script; do | ||
source "$bashrc_script" | ||
done < <(find /.box/bashrc.d /.box/bashrc.d/box -maxdepth 1 -type f) |
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,8 @@ | ||
PS1='\[\033[01;32m\]\u\[\033[01;33m\]@\[\033[01;32m\]\h: \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]' | ||
alias ls="ls --color=auto" | ||
|
||
cd ~/ | ||
|
||
while read bashrc_script; do | ||
source "$bashrc_script" | ||
done < <(find /.box/bashrc.d /.box/bashrc.d/root -maxdepth 1 -type f) |
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 @@ | ||
Welcome to Linux Challenge on | ||
_ _ | ||
| | (_) | ||
___| |_ ___ _ __ _ ___ ___ _ __ __ _ | ||
/ __| __/ _ \ '_ \| |/ __| / _ \| '__/ _` | | ||
\__ \ || __/ |_) | | (__ | (_) | | | (_| | | ||
|___/\__\___| .__/|_|\___(_)___/|_| \__, | | ||
| | __/ | | ||
|_| |___/ | ||
|
||
This box runs Ubuntu 14.04. You are logged in as user "box". | ||
To run a command as administrator (user "root"), use "sudo <command>". | ||
* Documentation: https://help.ubuntu.com/ | ||
|
||
Web terminal usage | ||
================== | ||
* Click the titlebar to drag | ||
* Double-click the titlebar to maximize | ||
* Click and drag the lower-right corner to resize | ||
|
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 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6Tx8U13CktlFNP4uFncrbXTWGweyVDG8KfuM+csoLfXp9VRYUZGpuFELKrfhgPaTjvRv0JfVCvoOWLsflma87k0Bq8s5OIPujAblwP1oBXFGOa//iSMOtZO9AtYYQwDhI7AUNlgAAsrmoPBzsQ1lHLbA+OAc5ckl9Vv+9l7xMZPyTaA894leuQSVNgYixwFmKKUBv+Go0w24CvYUDJL3KeIJCZDD7e7DzW2vACMYyjdfo3DDpNsabE9yfmsaITrs/zakESf3Gy6zUdTPgUo0NjIpT772BOmPK4cvWV3Lb9ExMH6psYqwh14B+Wz9gguDhkcdGioajXqNxKShRH/uF checker@checksystem |
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,21 @@ | ||
#!/bin/bash | ||
|
||
# Start the SSH service | ||
/sbin/my_init --skip-startup-files &> /dev/null & | ||
|
||
# Display the bold prompt | ||
bold=$(tput bold) | ||
normal=$(tput sgr0) | ||
echo "${bold}Press ENTER to start hacking...${normal}" | ||
|
||
# Wait for ENTER | ||
trap '' 2 # mock SIGINT on CTRL+C | ||
read | ||
trap 2 # enable SIGINT | ||
|
||
# Print the greeting | ||
cat /.box/greeting 2> /dev/null | ||
|
||
while true; do | ||
su box | ||
done |