Skip to content

Commit 37ff3f6

Browse files
committed
class12 fix routing, fix tooling
1 parent d52c1fe commit 37ff3f6

File tree

4 files changed

+30
-43
lines changed

4 files changed

+30
-43
lines changed

classes/class12/Dockerfile

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:12 AS gobuilder
1+
FROM ubuntu:24.04 AS gobuilder
22

33
# Install build dependencies
44
RUN apt-get update && apt-get install -y \
@@ -28,14 +28,10 @@ RUN go install github.com/tomnomnom/assetfinder@latest
2828
# Install gobuster
2929
RUN go install github.com/OJ/gobuster/v3@latest
3030

31-
# gau
32-
RUN go install -v github.com/lc/gau/v2/cmd/gau@latest
3331

32+
FROM ubuntu:24.04 AS base
3433

35-
36-
FROM debian:12 AS base
37-
38-
RUN dpkg --add-architecture amd64 && apt update -y && apt upgrade -y
34+
RUN apt update -y && apt upgrade -y
3935

4036
RUN apt-get install -y \
4137
make \
@@ -55,18 +51,15 @@ RUN apt-get install -y \
5551
net-tools \
5652
knot-dnsutils \
5753
dnsutils \
58-
jq
59-
60-
# Install Pyenv
61-
ENV PYENV_ROOT=/usr/local/pyenv
62-
ENV PATH="$PYENV_ROOT/bin:$PATH"
63-
64-
RUN git clone https://github.com/pyenv/pyenv.git /usr/local/pyenv && \
65-
eval "$(pyenv init --path)" && \
66-
pyenv install $(pyenv install -l | grep -v - | grep -E '^ 3\.[0-9]+\.[0-9]+$' | tail -1) && \
67-
pyenv global $(pyenv install -l | grep -v - | grep -E '^ 3\.[0-9]+\.[0-9]+$' | tail -1)
68-
54+
jq \
55+
python3 \
56+
pipx
6957

58+
# make python nicer
59+
RUN ln -s $(which python3) /usr/local/bin/python
60+
# add bsy-clippy
61+
RUN pipx ensurepath && \
62+
pipx install bsy-clippy==0.3.2
7063

7164
FROM base AS pybuilder
7265

@@ -105,32 +98,26 @@ CMD ["/usr/sbin/sshd", "-D"]
10598
# Copy tools from builder
10699
COPY --from=gobuilder /root/go/bin/assetfinder /usr/local/bin/
107100
COPY --from=gobuilder /root/go/bin/gobuster /usr/local/bin/
108-
COPY --from=gobuilder /root/go/bin/gau /usr/local/bin/
109101
COPY --from=gobuilder /usr/local/go /usr/local/go
110102

111103
# Copy Pyenv
112-
COPY --from=pybuilder /usr/local/pyenv /usr/local/pyenv
113104
COPY --from=pybuilder /opt/sqlmap /opt/sqlmap
114105
RUN ln -s /opt/sqlmap/sqlmap.py /usr/local/bin/sqlmap
115106

116107
# Copy wordlists
117108
COPY --from=wordlists /data/wordlist /data/wordlist
118109

119110
# Set environment variables
120-
ENV PYENV_ROOT="/usr/local/pyenv"
121111
ENV GOPATH="/root/go"
122-
ENV PATH="/usr/local/go/bin:$GOPATH/bin:$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"
112+
ENV PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"
123113

124114
# we need to write this to bashrc so that ssh will set same env variables
125-
RUN echo 'export PYENV_ROOT="/usr/local/pyenv"' >> /root/.bashrc && \
126-
echo 'export GOPATH="/root/go"' >> /root/.bashrc && \
127-
echo 'export PATH="/usr/local/go/bin:$GOPATH/bin:$PYENV_ROOT/bin:$PYENV_ROOT/shims:$PATH"' >> /root/.bashrc
115+
RUN echo 'export GOPATH="/root/go"' >> /root/.bashrc && \
116+
echo 'export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"' >> /root/.bashrc
128117

129118
# Verify installations
130119
RUN go version && \
131-
pyenv versions && \
120+
python --version && \
132121
assetfinder -h && \
133-
gobuster version && \
134-
sqlmap --version && \
135-
gau -h
136-
122+
gobuster --help && \
123+
sqlmap --version

classes/class12/docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
- juiceshop1
2727
- juiceshop2
2828
- juiceshop3
29-
- juice.bsy.com
29+
- juice.class12.bsy
3030

3131
waf:
3232
image: gbe0/coraza:latest
@@ -39,7 +39,7 @@ services:
3939
aliases:
4040
- protected-juiceshop
4141
- waf
42-
- waf.bsy.com
42+
- waf.class12.bsy
4343
depends_on:
4444
- juiceshop
4545
environment:
@@ -57,11 +57,11 @@ services:
5757
ipv4_address: 172.20.0.105
5858
aliases:
5959
- juicynginx
60-
- bsy.com
61-
- app.bsy.com
62-
- example.bsy.com
63-
- hidden.bsy.com
64-
- pub.bsy.com
60+
- class12.bsy
61+
- app.class12.bsy
62+
- example.class12.bsy
63+
- hidden.class12.bsy
64+
- pub.class12.bsy
6565
depends_on:
6666
- juiceshop
6767

classes/class12/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "0x12 - Web Attacks",
33
"id": "class-12",
4-
"description": "The 12th focuses on Web Attacks. After starting the class:<br><ul><li>Connect to a class lab with command <code>ssh [email protected].101</code> and 'admin' password from hackerlab</li><li>From a new terminal on your computer (NOT StratoCyberLab), execute a following command</br><code>ssh -L 3000:juiceshop:3000 -L 8080:juicynginx:80 [email protected] -p 2222</code></br>with a password <code>ByteThem123</code>. The command setups port forwarding so you can access the class services in your browser.</li></ol>",
4+
"description": "The 12th focuses on Web Attacks. After starting the class:<br><ul><li>Connect to a class lab with command <code>ssh [email protected].102</code> and 'admin' password from hackerlab</li><li>From a new terminal on your computer (NOT StratoCyberLab), execute a following command</br><code>ssh -L 3000:juiceshop:3000 -L 8080:juicynginx:80 [email protected] -p 2222</code></br>with a password <code>ByteThem123</code>. The command setups port forwarding so you can access the class services in your browser.</li></ol>",
55
"google_doc_url": "",
66
"yt_recording_url": "",
77
"starting_time": "2025-12-11T14:30:00+01:00"

classes/class12/nginx/nginx.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ http {
1616
server {
1717
listen 80;
1818

19-
server_name bsy.com;
19+
server_name class12.bsy;
2020

2121
location = /hidden {
2222
return 200 "Hah, very good job, but try somewhere else!\n";
@@ -39,11 +39,11 @@ http {
3939
}
4040

4141
location = /juice {
42-
return 301 http://app.bsy.com;
42+
return 301 http://app.class12.bsy;
4343
}
4444

4545
location = /real {
46-
return 301 http://pub.bsy.com;
46+
return 301 http://pub.class12.bsy;
4747
}
4848

4949
location = / {
@@ -53,7 +53,7 @@ http {
5353

5454
server {
5555
listen 80;
56-
server_name app.bsy.com;
56+
server_name app.class12.bsy;
5757

5858
set $backend "juiceshop:3000";
5959

@@ -73,7 +73,7 @@ http {
7373
server {
7474
listen 80;
7575

76-
server_name pub.bsy.com;
76+
server_name pub.class12.bsy;
7777
server_name localhost;
7878

7979
root /usr/share/nginx/html;

0 commit comments

Comments
 (0)