Skip to content

Commit 266fab2

Browse files
committed
Update for Hack The Vote 2024
1 parent 58dba33 commit 266fab2

File tree

157 files changed

+102011
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+102011
-2
lines changed

2024/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Hack The Vote 2024
2+
3+
Hack The Vote 2024 was run by [RPISEC](https://rpis.ec) from November 1st to 3rd, 2024 (2024-11-01T23:00Z/2024-11-03T23:00Z).
4+
5+
Congratulations to the top 3 teams:
6+
7+
1st place: Maple Bacon (solved all challenges)
8+
2nd place: tohru
9+
3rd place: Shellphish
10+
11+
This was the last edition of HTV. There may be future RPISEC CTFs, but we are retiring the Hack The Vote series.
12+
13+
![challenges](challenges.png)
14+
15+
## Theme
16+
17+
This year we simulated a presidential election between Wilfred J. Lewis and Jeanette D. Westcott, two cats. After every solve, teams redirected hacked votes to one of the candidates. Westcott had a narrow lead through most of the competition with a few brief takeovers, but was ultimately hacked the winner at 157 votes, with Lewis trailing at 152.
18+
19+
![bios](index.png)
20+
21+
## Statistics
22+
23+
![scoreboard](scoreboard.png)
24+
25+
![solves](solves.png)
26+
27+
| | |
28+
| --- | --- |
29+
| Teams registered | 1177 |
30+
| Teams scored: | 758 |
31+
| Sanity solves | 734 |
32+
| Insanity solves | 235 |
33+
| Correct flags | 1357 |
34+
| Incorrect flags | 714 |
35+
| Points available | 4153 |
36+
| Number of challenges | 12 |
37+
| 1st place challenges solved | 12 |
38+
39+
For the first time in HTV history, there were no unsolved challenges.
40+
41+
## Organizers
42+
43+
Andrew Fasano, Josh Ferrell, Michael Jones, Michael Krasnitski, Andrew Marumoto, Austin Ralls, Max Shavrick, Glenn Smith, and Avi Weinstock

2024/base-image/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
ARG UBUNTU_DIGEST=sha256:aa772c98400ef833586d1d517d3e8de670f7e712bf581ce6053165081773259d
2+
3+
FROM --platform=linux/amd64 ubuntu@${UBUNTU_DIGEST} as base
4+
5+
ARG DEBIAN_FRONTEND=noninteractive
6+
RUN apt-get update && \
7+
apt-get install -y ca-certificates wget
8+
9+
RUN useradd challenge_user
10+
11+
WORKDIR /
12+
13+
FROM --platform=linux/amd64 ubuntu@${UBUNTU_DIGEST} as build_nsjail
14+
15+
ARG DEBIAN_FRONTEND=noninteractive
16+
RUN apt-get update && apt-get install -y --no-install-recommends \
17+
autoconf \
18+
bison \
19+
ca-certificates \
20+
flex \
21+
g++ \
22+
gcc \
23+
git \
24+
libnl-route-3-dev \
25+
libprotobuf-dev \
26+
libtool \
27+
make \
28+
pkg-config \
29+
curl \
30+
protobuf-compiler \
31+
libssl-dev && \
32+
rm -rf /var/lib/apt/lists/*
33+
34+
RUN git clone https://github.com/google/nsjail.git && make -C /nsjail
35+
36+
FROM base as htv2024_pwn
37+
38+
ARG DEBIAN_FRONTEND=noninteractive
39+
RUN apt-get update && apt-get install -y --no-install-recommends \
40+
libprotobuf23 \
41+
libnl-3-200 \
42+
libnl-route-3-200 && \
43+
rm -rf /var/lib/apt/lists/*
44+
45+
COPY --from=build_nsjail /nsjail/nsjail /usr/bin/nsjail
46+
RUN chmod 755 /usr/bin/nsjail
47+
48+
COPY --chown=root:root nsjail.conf /home/challenge_user/nsjail.conf
49+
RUN chmod 400 /home/challenge_user/nsjail.conf
50+
51+
COPY entrypoint.sh /home/challenge_user/entrypoint.sh
52+
RUN chmod 755 /home/challenge_user/entrypoint.sh
53+
54+
WORKDIR /home/challenge_user/
55+
56+
ENTRYPOINT ["./entrypoint.sh"]

2024/base-image/entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
sed -i "s/PLACEHOLDER_FLAG/$FLAG/" nsjail.conf
6+
unset FLAG
7+
8+
exec nsjail --config nsjail.conf "$@"

2024/base-image/nsjail.conf

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Base config for pwnable challenge
2+
3+
name: "htv2024-pwn"
4+
5+
description: "Base configuration for HackTheVote 2024 pwnable"
6+
7+
mode: LISTEN
8+
port: 31337
9+
10+
exec_bin {
11+
path: "/challenge/challenge"
12+
}
13+
14+
cwd: "/"
15+
16+
# Timeout
17+
time_limit: 120
18+
19+
# Resource limits
20+
rlimit_as: 2048
21+
rlimit_cpu: 1000
22+
rlimit_fsize: 1024
23+
rlimit_nofile: 64
24+
25+
26+
keep_env: false
27+
envar: "TERM=linux"
28+
envar: "PS1=$ "
29+
30+
skip_setsid: true
31+
32+
clone_newcgroup: true
33+
34+
uidmap {
35+
inside_id: "1000"
36+
outside_id: "1000"
37+
count: 1
38+
}
39+
40+
gidmap {
41+
inside_id: "1000"
42+
outside_id: "1000"
43+
count: 1
44+
}
45+
46+
47+
# Env vars
48+
envar: "TERM=linux"
49+
50+
# Mount shenanigans
51+
mount_proc: false
52+
53+
mount {
54+
src: "/lib"
55+
dst: "/lib"
56+
is_bind: true
57+
rw: false
58+
}
59+
60+
mount {
61+
src: "/bin"
62+
dst: "/bin"
63+
is_bind: true
64+
rw: false
65+
}
66+
67+
mount {
68+
src: "/sbin"
69+
dst: "/sbin"
70+
is_bind: true
71+
rw: false
72+
}
73+
74+
mount {
75+
src: "/usr"
76+
dst: "/usr"
77+
is_bind: true
78+
rw: false
79+
}
80+
81+
mount {
82+
src: "/lib64"
83+
dst: "/lib64"
84+
is_bind: true
85+
rw: false
86+
mandatory: false
87+
}
88+
89+
mount {
90+
src: "/lib32"
91+
dst: "/lib32"
92+
is_bind: true
93+
rw: false
94+
mandatory: false
95+
}
96+
97+
mount {
98+
dst: "/tmp"
99+
fstype: "tmpfs"
100+
rw: true
101+
is_bind: false
102+
noexec: true
103+
nodev: true
104+
nosuid: true
105+
}
106+
107+
mount {
108+
src: "/dev/null"
109+
dst: "/dev/null"
110+
rw: true
111+
is_bind: true
112+
}
113+
114+
mount {
115+
dst: "/proc"
116+
fstype: "proc"
117+
rw: false
118+
}
119+
120+
mount {
121+
dst: "/flag"
122+
src_content: "PLACEHOLDER_FLAG"
123+
rw: false
124+
}
125+
126+
mount {
127+
dst: "/challenge"
128+
src: "/home/challenge_user/deploy"
129+
is_dir: true
130+
is_bind: true
131+
}

2024/challenges.png

108 KB
Loading

2024/crypto/zerovote/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM htv2024:pwn_base as base
2+
3+
FROM base as build
4+
# Space-separated list of required packages
5+
ARG REQUIRED_PACKAGES="build-essential cargo"
6+
7+
ARG DEBIAN_FRONTEND=noninteractive
8+
RUN apt-get update && \
9+
apt-get install -y --no-install-recommends ${REQUIRED_PACKAGES} && \
10+
rm -rf /var/lib/apt/lists/*
11+
12+
COPY build.sh /build.sh
13+
COPY src/ /src/
14+
RUN cd / && chmod +x /build.sh && /build.sh
15+
16+
COPY Dockerfile /handout/Dockerfile
17+
RUN tar -czf /handout.tar.gz /handout
18+
19+
FROM base as run
20+
COPY --from=build /deploy /home/challenge_user/deploy
21+
22+
COPY make_handout.sh /make_handout.sh
23+
RUN cd / && chmod +x /make_handout.sh && /make_handout.sh

2024/crypto/zerovote/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
mkdir -p build
6+
mkdir -p deploy
7+
mkdir -p deploy/src/src
8+
9+
# Build binaries
10+
cargo build --release --manifest-path=src/Cargo.toml
11+
12+
# Copy required files to deploy
13+
cp ./src/target/release/zerovote deploy/challenge
14+
cp ./src/src/main.rs deploy/src/src/main.rs
15+
cp ./src/Cargo.toml deploy/src/Cargo.toml
16+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "zerovote"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
curve25519-dalek = { version = "4.1.3", features = ["digest", "group", "rand_core", "serde"] }
10+
group = "0.13.0"
11+
lazy_static = "1.5.0"
12+
rand_core = { version = "0.6.4", features = ["getrandom"] }
13+
serde = { version = "1.0", features = ["derive"] }
14+
serde_json = "1.0"
15+
sha2 = "0.10.8"

0 commit comments

Comments
 (0)