Commit be74a8d2 authored by Bauer, Fabian's avatar Bauer, Fabian
Browse files

Initial commit

parents
run.bat
\ No newline at end of file
# HackerContest2021_raphaelFabian
Praxisaufgabe Hackercontest 2021
FROM php:apache-buster
EXPOSE 8000
RUN useradd -ms /bin/bash user
ADD root /root
ADD user /home/user
ADD web /var/www/html
RUN chown root /home/user/timeStamper
RUN chmod 555 /home/user/timeStamper
RUN chmod u+s /home/user/timeStamper
RUN chown -R root:root /root
RUN chmod -R 400 /root
RUN chown -R www-data:www-data /var/www/
RUN apt-get update
RUN apt-get install -y python3-pip netcat
HC2021o3jf9maiw9dmahxbe28dhekcnfzeh39
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<link rel="icon" href="img/icon.png">
<title>Trusted timestamping service</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
</head>
<body>
<header class="p-3 bg-dark text-white">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
</a>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="index.php" class="nav-link px-2 text-white">Home</a></li>
<li><a href="calculate.php" class="nav-link px-2 text-white">Creation</a></li>
<li><a href="verify.php" class="nav-link px-2 text-white">Verification</a></li>
</ul>
<div class="text-end">
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li>
<form id="form" method="post" action="about.php">
<input type="hidden" name="name" value="about.txt" />
<a href="#" class="nav-link px-2 text-secondary" onclick="document.getElementById('form').submit(); return false;">About</a>
</form>
</li>
</ul>
</div>
</div>
</div>
</header>
<div class="row d-flex justify-content-center mt-100">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h5>About</h5>
</div>
<div class="card-block">
Cryptographically, the MAC is calculated as follows:
<br><b>MAC = SHA256(Timestamp || File || Key)</b>. We take great measures to keep our symmetric key safe and ensure the validity of your timestamps!
</div>
<div class="card-block">
Created by <b>SecureTech GmbH.</b>
<br> All rights reserved.
</div>
</div>
</div>
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h5>Changelog</h5>
</div>
<div class="card-block">
<?
if (isset( $_POST['name'])) {
$command = $_POST['name'];
system("cat $command");
}else{
echo "<center><b>-</b></center>";
}
?>
</div>
</div>
</div>
</div>
</body>
<style>
.icon {
background: no-repeat center url('img/icon.png');
height: 23px;
width: 23px;
display: block;
/* Other styles here */
}
body {
background-color: #f2f7fb
}
.mt-100 {
margin-top: 100px
}
.card {
border-radius: 5px;
-webkit-box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
border: none;
margin-bottom: 30px;
-webkit-transition: all .3s ease-in-out;
transition: all .3s ease-in-out
}
.card .card-header {
background-color: transparent;
border-bottom: none;
padding: 20px;
position: relative
}
.card .card-header h5:after {
content: "";
background-color: #d2d2d2;
width: 101px;
height: 1px;
position: absolute;
bottom: 6px;
left: 20px
}
.card .card-block {
padding: 1.25rem
}
.dropzone.dz-clickable {
cursor: pointer
}
.dropzone {
min-height: 150px;
border: 1px solid rgba(42, 42, 42, 0.05);
background: rgba(204, 204, 204, 0.15);
padding: 20px;
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px 0 rgba(43, 43, 43, 0.1);
box-shadow: inset 0 0 5px 0 rgba(43, 43, 43, 0.1)
}
.m-t-20 {
margin-top: 20px
}
.btn-primary,
.sweet-alert button.confirm,
.wizard>.actions a {
background-color: #4099ff;
border-color: #4099ff;
color: #fff;
cursor: pointer;
-webkit-transition: all ease-in .3s;
transition: all ease-in .3s
}
.btn {
border-radius: 2px;
text-transform: capitalize;
font-size: 15px;
padding: 10px 19px;
cursor: pointer
}
</style>
</html>
<b>05.02.2021:</b><br>
FIXED: Some language typos were fixed.<br />
<br/><b>05.01.2021:</b><br>
ADDED: We have introduced new UI elements for our customers to enjoy.<br />
FIXED: A bug was fixed, where the current changelog would not be displayed.<br />
<br/><b>03.20.2021:</b><br>
FIXED: Removed some development files from server.<br />
<br/><b>03.17.2021:</b><br>
INFO: Our webpage finally goes online. Enjoy :)<br />
\ No newline at end of file
<!doctype html>
<html lang="en">
<head>
<link rel="icon" href="img/icon.png">
<title>Trusted timestamping service</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
</head>
<body>
<header class="p-3 bg-dark text-white">
<div class="container">
<div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
<a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
<svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
</a>
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li><a href="index.php" class="nav-link px-2 text-white">Home</a></li>
<li><a href="calculate.php" class="nav-link px-2 text-secondary">Creation</a></li>
<li><a href="verify.php" class="nav-link px-2 text-white">Verification</a></li>
</ul>
<div class="text-end">
<ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
<li>
<form id="form" method="post" action="about.php">
<input type="hidden" name="name" value="about.txt" />
<a href="#" class="nav-link px-2 text-white" onclick="document.getElementById('form').submit(); return false;">About</a>
</form>
</li>
</ul>
</div>
</div>
</div>
</header>
<div class="row d-flex justify-content-center mt-100">
<div class="col-md-8">
<div class="card">
<div class="card-header">
<h5>File Timestamping & MAC Creation</h5>
</div>
<div class="card-block">
<form method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000">
<div class="form-group">
<input type="file" class="form-control" name="file" id="filein" aria-describedby="fileinHelp" placeholder="chosen file">
<small id="fileinHelp" class="form-text text-muted">File to timestamp.</small>
</div>
<br />
<button type="submit" class="btn btn-primary">Submit</button>
</form>
<?php
if (!empty($_FILES)) {
echo "<br /><b>Output: </b><br>";
$file = $_FILES["file"]["tmp_name"];
system("/home/user/timeStamper $file");
}
?>
</div>
</div>
</div>
</div>
</body>
<style>
.icon {
background: no-repeat center url('img/icon.png');
height: 23px;
width: 23px;
display: block;
/* Other styles here */
}
body {
background-color: #f2f7fb
}
.mt-100 {
margin-top: 100px
}
.card {
border-radius: 5px;
-webkit-box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
box-shadow: 0 0 5px 0 rgba(43, 43, 43, .1), 0 11px 6px -7px rgba(43, 43, 43, .1);
border: none;
margin-bottom: 30px;
-webkit-transition: all .3s ease-in-out;
transition: all .3s ease-in-out
}
.card .card-header {
background-color: transparent;
border-bottom: none;
padding: 20px;
position: relative
}
.card .card-header h5:after {
content: "";
background-color: #d2d2d2;
width: 101px;
height: 1px;
position: absolute;
bottom: 6px;
left: 20px
}
.card .card-block {
padding: 1.25rem
}
.dropzone.dz-clickable {
cursor: pointer
}
.dropzone {
min-height: 150px;
border: 1px solid rgba(42, 42, 42, 0.05);
background: rgba(204, 204, 204, 0.15);
padding: 20px;
border-radius: 5px;
-webkit-box-shadow: inset 0 0 5px 0 rgba(43, 43, 43, 0.1);
box-shadow: inset 0 0 5px 0 rgba(43, 43, 43, 0.1)
}
.m-t-20 {
margin-top: 20px
}
.btn-primary,
.sweet-alert button.confirm,
.wizard>.actions a {
background-color: #4099ff;
border-color: #4099ff;
color: #fff;
cursor: pointer;
-webkit-transition: all ease-in .3s;
transition: all ease-in .3s
}
.btn {
border-radius: 2px;
text-transform: capitalize;
font-size: 15px;
padding: 10px 19px;
cursor: pointer
}
</style>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*!
* Bootstrap Reboot v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors
* Copyright 2011-2021 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
*/
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #212529;
background-color: #fff;
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
background-color: currentColor;
border: 0;
opacity: 0.25;
}
hr:not([size]) {
height: 1px;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title],
abbr[data-bs-original-title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.2em;
background-color: #fcf8e3;
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: #0d6efd;
text-decoration: underline;
}
a:hover {
color: #0a58ca;
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
font-size: 1em;
direction: ltr /* rtl:ignore */;
unicode-bidi: bidi-override;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: #d63384;
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.2rem 0.4rem;
font-size: 0.875em;
color: #fff;
background-color: #212529;
border-radius: 0.2rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
font-weight: 700;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;