-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f66084e
commit 4ae6fea
Showing
29 changed files
with
175 additions
and
26 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,4 @@ | ||
.git | ||
.dockerignore | ||
.env | ||
* |
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 |
---|---|---|
|
@@ -13,3 +13,4 @@ config*.yml | |
*.retry | ||
.trash/ | ||
.env | ||
id_ed25519 |
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,32 @@ | ||
FROM ubuntu:20.04 | ||
|
||
# Core deps | ||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata | ||
RUN apt-get install -y --no-install-recommends rsync git less tmux python3 curl wireguard python3-pip unzip file nano dnsutils jq \ | ||
software-properties-common gpg-agent # for ansible and packer install | ||
|
||
# Ansible | ||
RUN add-apt-repository --yes --update ppa:ansible/ansible && apt-get install -y ansible | ||
|
||
# Terrorform | ||
RUN ls -alh /usr/local/bin | ||
RUN curl https://releases.hashicorp.com/terraform/1.0.11/terraform_1.0.11_linux_amd64.zip > terraform.zip && \ | ||
unzip terraform.zip && \ | ||
mv terraform /usr/local/bin/ | ||
|
||
# Packer | ||
RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \ | ||
apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \ | ||
apt-get update && apt-get install packer | ||
|
||
# OpenVPN | ||
RUN apt-get install -y openvpn easy-rsa zip unzip | ||
ENV PATH="/usr/share/easy-rsa:${PATH}" | ||
|
||
# QOL | ||
RUN echo "set -g mouse on" > /root/.tmux.conf | ||
|
||
WORKDIR /bambictf | ||
|
||
ENTRYPOINT tail -f /dev/null |
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 |
---|---|---|
|
@@ -67,3 +67,29 @@ export HCLOUD_TOKEN="..." | |
(cd packer; packer build bambivulnbox.json) | ||
(cd packer; packer build bambielk.json) | ||
``` | ||
|
||
## Docker | ||
- Have at least one ssh key with the label `type=admin` in your project | ||
- Set `HCLOUD_TOKEN` and `HETZNERDNS_TOKEN` | ||
- Create `./ansible/config_bambi.yml` | ||
- Obtain a private ssh ed25519 key that can clone your repositories (`cp ~/.ssh/id_ed25519 .`) | ||
- Run the container (`docker-compose up --build`) | ||
- Invoke a bash in the container (`docker-compose exec bambictf bash`) | ||
- Build configs | ||
- `cd /bambictf/config` | ||
- `./gen_config.sh` | ||
- Builds VMs | ||
- `cd /bambictf/packer` | ||
- `packer build bambichecker.json` | ||
- Create `./terraform/terraform.tfvars` | ||
- `cd ./terraform` | ||
- `terraform init` | ||
- `terraform apply` | ||
|
||
|
||
## Open game network | ||
- `iptables -A FORWARD -o router -j ACCEPT` (on *every* gateway) | ||
|
||
|
||
## Rsync stuff | ||
- `while true; do rsync /services/data/*.json [email protected]:/services/EnoCTFPortal_bambi7/scoreboard; sleep 5; done` TODO ask Lucas about loops and stuff |
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 |
---|---|---|
|
@@ -22,4 +22,6 @@ | |
- docker-block-external | ||
- role: programs | ||
vars: | ||
program_list: "tmux" | ||
program_list: | ||
- "tmux" | ||
- "git" |
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 |
---|---|---|
|
@@ -22,4 +22,6 @@ | |
elk: 192.168.3.0 | ||
- role: programs | ||
vars: | ||
program_list: "tmux" | ||
program_list: | ||
- "tmux" | ||
- "git" |
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 |
---|---|---|
|
@@ -22,4 +22,6 @@ | |
- docker-block-external | ||
- role: programs | ||
vars: | ||
program_list: "tmux" | ||
program_list: | ||
- "tmux" | ||
- "git" |
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
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
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
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,7 @@ | ||
{ | ||
"flagRegex": "ENO[A-Za-z0-9+\/=]{48}", | ||
"targetsUrl": "https://6.enowars.com/api/data/ips", | ||
"submissionAddress": "10.0.13.37", | ||
"submissionPort": 1337, | ||
"interval": 50 | ||
} |
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,16 @@ | ||
--- | ||
- name: Install bambixploit | ||
get_url: | ||
url: "https://github.com/enowars/bambiXploit-dotnet/releases/download/v0.0.9/bambixploit-linux-x64" | ||
dest: /usr/local/bin/bambixploit | ||
mode: 0755 | ||
|
||
- name: Create /etc/bambixploit | ||
ansible.builtin.file: | ||
path: /etc/bambixploit | ||
state: directory | ||
|
||
- name: Deploy bambixploit.json | ||
copy: | ||
src: bambixploit.json | ||
dest: /etc/bambixploit/bambixploit.json |
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
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
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
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
dependencies: | ||
- role: "docker" | ||
- role: "programs" | ||
- role: "bambi-ssh-keys" |
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
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
dependencies: | ||
- role: "docker" | ||
- role: "programs" | ||
- role: "bambi-ssh-keys" |
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
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
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
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,11 @@ | ||
version: '2' | ||
|
||
services: | ||
bambictf: | ||
build: . | ||
environment: | ||
- HCLOUD_TOKEN=${HCLOUD_TOKEN} # for packer | ||
- TF_VAR_HCLOUD_TOKEN=${HCLOUD_TOKEN} # for terraform | ||
- TF_VAR_HETZNERDNS_TOKEN=${HETZNERDNS_TOKEN} # for terraform | ||
volumes: | ||
- ".:/bambictf" |
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
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
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
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
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
Oops, something went wrong.