feat: add flagisnowhidden challenge

This commit is contained in:
Abel Stuker 2024-11-25 22:29:38 +01:00
parent 87d9c1c3eb
commit c1d973ea26
21 changed files with 100 additions and 0 deletions

View File

@ -0,0 +1,4 @@
FROM nginx
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
COPY ./conf/html /usr/share/nginx/html

View File

@ -0,0 +1,7 @@
# flagisnowhidden
## Text
I removed the flag from the website. Good luck finding it back.
## Files
n/a
## How to Deploy
docker compose

View File

@ -0,0 +1,12 @@
## Difficulty
??
## Category
Web
## How To Solve
Observe that the `.git` folder is leaking at `<website>/.git/`. Copy this folder to your local machine using `wget -nH --mirror .git <website>/.git/`. Use `git log` to show the commit history. You can see that one of the commit messages is "hide flag". Using `git show` with the `commit ID` will reveal the flag.
```
- <p>IGCTF{n3ever_3xp0se_fl4gs_1n_g1t}</p>
+ <p>REMOVED</p>
```
## Flag
`IGCTF{n3ever_3xp0se_fl4gs_1n_g1t}`

View File

@ -0,0 +1 @@
hide flag

View File

View File

@ -0,0 +1 @@
ref: refs/heads/main

View File

@ -0,0 +1,7 @@
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true

View File

@ -0,0 +1,9 @@
#!/bin/sh
### git-stats hook (begin) ###
# Copy last commit hash to clipboard on commit
commit_hash=$(git rev-parse HEAD)
repo_url=$(git config --get remote.origin.url)
commit_date=$(git log -1 --format=%cd)
commit_data="\"{ \"date\": \"$commit_date\", \"url\": \"$repo_url\", \"hash\": \"$commit_hash\" }\""
git-stats --record "${commit_data}"
### git-stats hook (end) ###

Binary file not shown.

View File

@ -0,0 +1,2 @@
0000000000000000000000000000000000000000 071c93c131195760e3c933a31a6d56c6bf7b8313 Abel Stuker <stukerabel@gmail.com> 1730538294 +0100 commit (initial): expose flag
071c93c131195760e3c933a31a6d56c6bf7b8313 2d87e51eefa6f195126294dbaca315f6534c713e Abel Stuker <stukerabel@gmail.com> 1730538489 +0100 commit: hide flag

View File

@ -0,0 +1,2 @@
0000000000000000000000000000000000000000 071c93c131195760e3c933a31a6d56c6bf7b8313 Abel Stuker <stukerabel@gmail.com> 1730538294 +0100 commit (initial): expose flag
071c93c131195760e3c933a31a6d56c6bf7b8313 2d87e51eefa6f195126294dbaca315f6534c713e Abel Stuker <stukerabel@gmail.com> 1730538489 +0100 commit: hide flag

View File

@ -0,0 +1,2 @@
x<01><>[
Â0EýÎ*æ_<C3A6>É»]ƒ+˜„I-&¤¤)¸|ƒKðërn¬¥¬䄧ޘ!Z0ø™&—œÑŽLœ<>ÊÅh,ª0ˆ :ú«6xÎðìÇ›\÷ßÒP÷¥Ðš/±–H¯ÑêIÍÎ(Å°ã³<C3A3>âŸZðg«;CÊ´ˆ/f^;J

View File

@ -0,0 +1 @@
2d87e51eefa6f195126294dbaca315f6534c713e

View File

@ -0,0 +1,8 @@
<html>
<h1>Welcome to my super awesome website</h1>
<img src="https://live.staticflickr.com/5337/13903051555_2136343cf8_b.jpg"/>
<h2>Here is the flag:</h2>
<p>REMOVED</p>
</html>

View File

@ -0,0 +1,35 @@
user nginx;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
index index.html;
server {
listen 80;
root /usr/share/nginx/html;
location /.git/ {
alias /usr/share/nginx/html/git/;
autoindex on;
}
}
}

View File

@ -0,0 +1,9 @@
services:
flagisnowhidden:
build:
context: .
volumes:
- ./conf/nginx.conf:/etc/nginx/nginx.conf:ro
- ./conf/html:/usr/share/nginx/html:ro
ports:
- "2000:80"