feat: add flagisnowhidden challenge
This commit is contained in:
parent
87d9c1c3eb
commit
c1d973ea26
4
flagisnowhidden/Dockerfile
Normal file
4
flagisnowhidden/Dockerfile
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
FROM nginx
|
||||||
|
|
||||||
|
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY ./conf/html /usr/share/nginx/html
|
7
flagisnowhidden/README.md
Normal file
7
flagisnowhidden/README.md
Normal 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
|
12
flagisnowhidden/SOLUTION.md
Normal file
12
flagisnowhidden/SOLUTION.md
Normal 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}`
|
1
flagisnowhidden/conf/html/git/COMMIT_EDITMSG
Normal file
1
flagisnowhidden/conf/html/git/COMMIT_EDITMSG
Normal file
@ -0,0 +1 @@
|
|||||||
|
hide flag
|
0
flagisnowhidden/conf/html/git/FETCH_HEAD
Normal file
0
flagisnowhidden/conf/html/git/FETCH_HEAD
Normal file
1
flagisnowhidden/conf/html/git/HEAD
Normal file
1
flagisnowhidden/conf/html/git/HEAD
Normal file
@ -0,0 +1 @@
|
|||||||
|
ref: refs/heads/main
|
7
flagisnowhidden/conf/html/git/config
Normal file
7
flagisnowhidden/conf/html/git/config
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[core]
|
||||||
|
repositoryformatversion = 0
|
||||||
|
filemode = true
|
||||||
|
bare = false
|
||||||
|
logallrefupdates = true
|
||||||
|
ignorecase = true
|
||||||
|
precomposeunicode = true
|
9
flagisnowhidden/conf/html/git/hooks/post-commit
Executable file
9
flagisnowhidden/conf/html/git/hooks/post-commit
Executable 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) ###
|
BIN
flagisnowhidden/conf/html/git/index
Normal file
BIN
flagisnowhidden/conf/html/git/index
Normal file
Binary file not shown.
2
flagisnowhidden/conf/html/git/logs/HEAD
Normal file
2
flagisnowhidden/conf/html/git/logs/HEAD
Normal 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
|
2
flagisnowhidden/conf/html/git/logs/refs/heads/main
Normal file
2
flagisnowhidden/conf/html/git/logs/refs/heads/main
Normal 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
|
@ -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
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
flagisnowhidden/conf/html/git/refs/heads/main
Normal file
1
flagisnowhidden/conf/html/git/refs/heads/main
Normal file
@ -0,0 +1 @@
|
|||||||
|
2d87e51eefa6f195126294dbaca315f6534c713e
|
8
flagisnowhidden/conf/html/index.html
Normal file
8
flagisnowhidden/conf/html/index.html
Normal 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>
|
35
flagisnowhidden/conf/nginx.conf
Normal file
35
flagisnowhidden/conf/nginx.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
9
flagisnowhidden/docker-compose.yaml
Normal file
9
flagisnowhidden/docker-compose.yaml
Normal 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"
|
Loading…
Reference in New Issue
Block a user