Skip to content

Commit

Permalink
忘记添加 build 的文件夹了
Browse files Browse the repository at this point in the history
  • Loading branch information
13m0n4de committed Oct 16, 2023
1 parent 9eb60f8 commit 5485a73
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 0 deletions.
8 changes: 8 additions & 0 deletions challenges/web/md5/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ghcr.io/svuctf/base/php:latest

COPY html/ /var/www/html/
RUN chown -R www-data:www-data /var/www/html/

COPY --chmod=500 init.sh /etc/init.sh

CMD ["/etc/init.sh"]
3 changes: 3 additions & 0 deletions challenges/web/md5/build/html/flag.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php
echo "怎么可能直接给你 flag 呢?";
$flag = file_get_contents("/flag");
62 changes: 62 additions & 0 deletions challenges/web/md5/build/html/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f2f2f2;
}
header {
background-color: #333;
color: #fff;
text-align: center;
padding: 20px;
}
main {
max-width: 800px;
margin: 20px auto;
background-color: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<header>
<h1></h1>
</header>
<main>
<article>
<h2>这是一个收藏miHOYO表情包的站点</h2>
<p></p>
<p></p>
<img src="x.png" alt="图片描述">
<img src="x1.png" alt="图片描述">
<img src="x2.png" alt="图片描述">
<img src="x3.png" alt="图片描述">
<img src="x4.png" alt="图片描述">
<img src="x5.png" alt="图片描述">
<img src="x6.png" alt="图片描述">
</article>
<div class="bottom-button">
<a href="md5.php" class="button">点我进一步查看更多表情包</a>
</div>
</main>
</body>
</html>
17 changes: 17 additions & 0 deletions challenges/web/md5/build/html/md5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
highlight_file(__FILE__);
include 'flag.php';

# 哈哈哈被骗了吧
# 完成这道 MD5 我就给你flag
if (isset($_GET['name']) && isset($_POST['password'])) {
$name = $_GET['name'];
$password = $_POST['password'];
if ($name != $password && md5($name) == md5($password)) {
echo $flag;
} else {
echo "上网搜搜,就差一点点啦!!!";
}
} else {
echo '来吧来吧,快写,我才会给你米哈游的表情包';
}
Binary file added challenges/web/md5/build/html/x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenges/web/md5/build/html/x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenges/web/md5/build/html/x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenges/web/md5/build/html/x3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenges/web/md5/build/html/x4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenges/web/md5/build/html/x5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added challenges/web/md5/build/html/x6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions challenges/web/md5/build/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

echo $GZCTF_FLAG > /flag
chmod 444 /flag

unset GZCTF_FLAG

php-fpm -D
nginx -g 'daemon off;'

0 comments on commit 5485a73

Please sign in to comment.