diff --git a/.env.example.ini b/.env.example.ini deleted file mode 100644 index 356f7d4..0000000 --- a/.env.example.ini +++ /dev/null @@ -1,2 +0,0 @@ -; Save request details in a SQLite database at this location -DB_POT="" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 16bb1cd..3fccee3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,51 +1,4 @@ -# Bootstrapping # -################# -/node_modules -/public/hot -/public/storage -/storage/*.key -/vendor -.env -.env.ini -.env.backup -.phpunit.result.cache -Homestead.json -Homestead.yaml -npm-debug.log -yarn-error.log -public/robots.txt +logs/* +!logs/.gitkeep - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -Icon? -ehthumbs.db -Thumbs.db -.directory - -# Tool specific files # -####################### -# vim -*~ -*.swp -*.swo -# sublime text & textmate -*.sublime-* -*.stTheme.cache -*.tmlanguage.cache -*.tmPreferences.cache -# Eclipse -.settings/* -# JetBrains, aka PHPStorm, IntelliJ IDEA -.idea/* -# NetBeans -nbproject/* -# Visual Studio Code -.vscode -# Sass preprocessor -.sass-cache/ +vendor \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 61d2e41..3b5234f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "database/9f50ea1a5be726e610dc2fe134926869"] - path = database/9f50ea1a5be726e610dc2fe134926869 - url = https://gist.github.com/9f50ea1a5be726e610dc2fe134926869.git +[submodule "vegvisir"] + path = vegvisir + url = https://codeberg.org/vegvisir/vegvisir diff --git a/assets/css/pages/document.css b/assets/css/pages/document.css deleted file mode 100644 index 293c2de..0000000 --- a/assets/css/pages/document.css +++ /dev/null @@ -1,104 +0,0 @@ -:root { - --padding: 20px; - --color-accent: #00b0d0; -} - -* { - font-family: "Verdana", "Arial", sans-serif; - font-size: 12px; -} - -body { - margin: 0; - background: url("/assets/media/Inner-page_cut_02.png") repeat-x right top; -} - -a { - color: inherit; - text-decoration: none; -} - -/* ---- */ - -header, -section { - width: 100%; - display: grid; - align-items: center; - justify-items: center; -} - -header { - height: 100px; -} - -.container { - width: 100%; - max-width: 1000px; -} - -/* ---- */ - -header .container { - display: flex; - justify-content: space-between; -} - -header nav { - margin-left: auto; - display: flex; - align-items: flex-end; -} - -header nav p { - position: relative; - margin: 0; - padding: 5px 10px; - border-radius: 10px; - color: var(--color-accent); -} - -/* --- */ - -#title h1 { - color: white; - font-size: 17px; - margin-left: var(--padding); -} - -.content { - background-color: white; - box-sizing: border-box; - padding: var(--padding); - border-radius: 6px; - border: solid 1px #eee; - min-height: 450px; - box-shadow: 0 0 10px 5px #00000017; - border: solid 1px #e6e6e6; -} - -.content * { - margin: 0; -} - -@media (hover: hover) { - header nav p:hover { - background-color: var(--color-accent); - color: white; - } - - header nav p:hover::after { - --size: 7px; - content: ""; - position: absolute; - top: 100%; - left: 50%; - transform: translateX(-50%); - width: 0; - height: 0; - border-left: var(--size) solid transparent; - border-right: var(--size) solid transparent; - - border-top: var(--size) solid var(--color-accent); - } -} \ No newline at end of file diff --git a/assets/css/pages/index.css b/assets/css/pages/index.css deleted file mode 100644 index 46bc5a8..0000000 --- a/assets/css/pages/index.css +++ /dev/null @@ -1,48 +0,0 @@ -.content#login { - display: grid; - grid-template-columns: 1fr 300px; -} - -.content#login aside { - background-color: #f7f7f7; - box-sizing: border-box; - padding: var(--padding); - display: flex; - flex-direction: column; - gap: var(--padding); - border-radius: 6px; -} - -.content#login aside h2 { - color: var(--color-accent); - font-size: 17px; -} - -.content#login form { - max-width: 400px; - display: flex; - flex-direction: column; - gap: var(--padding); -} - -.content#login .error { - background-color: #ff000010; - color: red; - padding: 10px; -} - -.content#login input[type="submit"] { - width: 100px; - padding: 7px; - background: linear-gradient(0deg, rgba(0,134,167,1) 0%, rgba(0,176,208,1) 100%); - border-radius: 3px; - border: none; - color: white; - cursor: pointer; -} - -@media (hover: hover) { - .content#login input[type="submit"]:hover { - background: rgba(0,134,167,1); - } -} \ No newline at end of file diff --git a/assets/css/pages/login.css b/assets/css/pages/login.css new file mode 100644 index 0000000..95782a7 --- /dev/null +++ b/assets/css/pages/login.css @@ -0,0 +1,26 @@ +vv-shell { + display: grid; + align-items: baseline; + grid-template-columns: 1fr 300px; +} + +form { + gap: 10px; + display: flex; + flex-direction: column; + + button { + margin-top: 20px; + } +} + +aside { + height: 100%; + padding: 20px; + border-radius: 6px; + background-color: var(--color-grey-light); + + > * { + margin-bottom: 10px; + } +} \ No newline at end of file diff --git a/assets/css/pages/partials/footer.css b/assets/css/pages/partials/footer.css deleted file mode 100644 index c499231..0000000 --- a/assets/css/pages/partials/footer.css +++ /dev/null @@ -1,25 +0,0 @@ -footer { - margin-top: var(--padding); -} - -footer #footer_list { - --color: #888; - display: grid; - grid-template-columns: repeat(4, 1fr); - color: var(--color); -} - -footer #footer_list > div { - display: flex; - flex-direction: column; - padding-left: var(--padding); - color: var(--color); -} - -footer #footer_list > div p { - font-weight: bold; -} - -footer #footer_list > div:not(:first-child) { - border-left: solid 1px var(--color); -} \ No newline at end of file diff --git a/assets/css/shell.css b/assets/css/shell.css new file mode 100644 index 0000000..4a9ef43 --- /dev/null +++ b/assets/css/shell.css @@ -0,0 +1,147 @@ +:root { + --color-grey: #888888; + --color-dlink: #00B0D0; + --color-grey-dark: #424242; + --color-grey-light: #F7F7F7; +} + +* { + color: inherit; + margin: 0; + box-sizing: border-box; + font-family: Arial, Helvetica, sans-serif; +} + +html { + display: grid; + justify-items: center; +} + +body { + width: 1000px; + display: grid; + justify-items: center; + background-image: url("/assets/media/Inner-page_cut_02.png"); + background-size: 1200px; + background-repeat: no-repeat; + grid-template-rows: 70px 1fr 200px; + background-position: 50% -30px; + grid-template-columns: 1fr; +} + +/* Components */ + +h1, h2, h3 { + color: var(--color-dlink); +} + +p, label, a { + font-size: 13px; +} + +button { + color: white; + height: 30px; + cursor: pointer; + border: solid 1px var(--color-grey-light); + min-width: 100px; + align-self: baseline; + background: linear-gradient(180deg,rgba(0, 176, 208, 1) 0%, rgba(0, 134, 167, 1) 100%); + justify-self: baseline; + border-radius: 4px; + + &:hover { + border-color: var(--color-dlink); + } + + &:active { + background: linear-gradient(180deg,rgba(0, 176, 208, 1) 0%, rgba(0, 134, 167, 1) 0%); + } +} + +/* Sections */ + +vv-shell { + width: calc(100% - 30px); + margin: 40px 0; + padding: 20px; + position: relative; + min-height: 400px; + box-shadow: 0 0 9px 3px #00000026; + border-radius: 9px; + background-color: white; + + &[vv-loading="true"] { + pointer-events: none; + } + + &[vv-loading="true"]::after { + --size: 150px; + + top: 50%; + left: 50%; + color: var(--color-dlink); + width: var(--size); + height: var(--size); + padding: 15px; + content: ""; + position: absolute; + transform: translate(-50%, -50%); + font-weight: bolder; + background-size: contain; + background-image: url("/assets/media/spinner.gif"); + } +} + +header { + width: 100%; + display: flex; + align-items: end; + justify-content: space-between; + + img { + height: 60px; + } + + nav ul { + gap: 20px; + display: flex; + list-style: none; + + a { + color: var(--color-dlink); + font-weight: bolder; + text-decoration: none; + } + } +} + +footer { + width: 100%; + display: grid; + margin-top: 100px; + color: var(--color-grey); + grid-template-columns: repeat(4, 1fr); + + section { + padding: 20px; + + &:not(:first-child) { + border-left: solid 1px var(--color-grey); + } + + p { + font-weight: bolder; + margin-bottom: 10px; + } + + ul { + padding: unset; + list-style: none; + + & a { + text-decoration: none; + } + } + } +} \ No newline at end of file diff --git a/assets/js/pages/document.js b/assets/js/pages/document.js deleted file mode 100644 index ed7003d..0000000 --- a/assets/js/pages/document.js +++ /dev/null @@ -1 +0,0 @@ -globalThis.pragma.Interactions("document", {}); \ No newline at end of file diff --git a/assets/js/pages/login.js b/assets/js/pages/login.js new file mode 100644 index 0000000..bd6b5fd --- /dev/null +++ b/assets/js/pages/login.js @@ -0,0 +1,23 @@ +const WHITELIST_USERNAMES = [ + "user", + "root", + "admin", + "mydlink" +]; +const WHITELIST_PASSWORDS = [ + "root", + "admin", + "12345", + "mydlink", + "password", + "123456789" +] + +document.querySelector("form button").addEventListener("click", (event) => { + event.preventDefault(); + + VV.shell.setAttribute("vv-loading", true); + const form = new FormData(event.target.closest("form")); + + console.log("Hello"); +}); \ No newline at end of file diff --git a/assets/js/shell.js b/assets/js/shell.js new file mode 100644 index 0000000..bb067c5 --- /dev/null +++ b/assets/js/shell.js @@ -0,0 +1,73 @@ +// Set a global delay to simulate crappy web software +VV.delay = 200; + +// Log user activities +{ + const MOUSE_MOVE_TIMEOUT_MS = 100; + + const logUrl = new URL(window.location); + logUrl.pathname = "/log"; + + let mouseMoveTimeout; + + // Return a fingerprint for this browser + const fingerprint = async () => { + const buffer = await window.crypto.subtle.digest("SHA-1", new TextEncoder().encode(JSON.stringify([ + navigator.userAgent, + navigator.buildId, + navigator.languages + ]))); + + let fingerprint; + + for (let i = 0; i < buffer.byteLength; i++) { + fingerprint += buffer[i]; + } + + return fingerprint; + }; + + // Log data + const log = async (data) => { + console.log(JSON.stringify({ + data: data, + fingerprint: await fingerprint() + })); + + return await fetch(logUrl, { + body: JSON.stringify({ + data: data, + fingerprint: await fingerprint() + }), + method: "POST", + headers: VV.header + }); + }; + + const mouseEvent = (event) => { + return { + e: event.type, + w: window.innerWidth, + h: window.innerHeight, + x: event.x, + y: event.y + } + } + + const keyEvent = (event) => { + return { + e: event.type, + c: event.key, + s: event.shiftKey + } + } + + document.addEventListener("keyup", (event) => log(keyEvent(event))); + document.addEventListener("keydown", (event) => log(keyEvent(event))); + document.addEventListener("click", (event) => log(mouseEvent(event))); + document.addEventListener("mousemove", (event) => { + // Throttle mousemove events + clearTimeout(mouseMoveTimeout); + //mouseMoveTimeout = setTimeout(() => log(mouseEvent(event)), MOUSE_MOVE_TIMEOUT_MS); + }); +} diff --git a/database/9f50ea1a5be726e610dc2fe134926869 b/database/9f50ea1a5be726e610dc2fe134926869 deleted file mode 160000 index ba34c57..0000000 --- a/database/9f50ea1a5be726e610dc2fe134926869 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ba34c5719fda3131a66ed9664ee182900c495bbd diff --git a/database/Pot.php b/database/Pot.php deleted file mode 100644 index 85f0e72..0000000 --- a/database/Pot.php +++ /dev/null @@ -1,33 +0,0 @@ - $_POST, - "SERVER" => $_SERVER - ]); - - // And save it! - $sql = "INSERT OR IGNORE INTO pot (id, data, version, created) VALUES (?, ?, ?, ?)"; - return $this->return_bool($sql, [ - crc32(uniqid($data, true)), - $data, - 1, - time() - ]); - } - } diff --git a/database/init/POT.sql b/database/init/POT.sql deleted file mode 100644 index 36e5bae..0000000 --- a/database/init/POT.sql +++ /dev/null @@ -1,6 +0,0 @@ -CREATE TABLE pot ( - id TEXT PRIMARY KEY NOT NULL, - data TEXT, - version INT NOT NULL, - created INT NOT NULL -); \ No newline at end of file diff --git a/logs/.gitkeep b/logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/pages/EN_EN/document.php b/pages/EN_EN/document.php deleted file mode 100644 index 904b92c..0000000 --- a/pages/EN_EN/document.php +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - mydlink - - - - -
-
- - -
-
-
- -
- - - - - \ No newline at end of file diff --git a/pages/EN_EN/index.php b/pages/EN_EN/index.php deleted file mode 100644 index 1f318d9..0000000 --- a/pages/EN_EN/index.php +++ /dev/null @@ -1,38 +0,0 @@ -yoink(); - } - -?> - -
-
-

Sign In to mydlink

-
-
-
-
-
- -

Invalid username or password. Please try again.

- -
- - -
-
- - -
- -
- -
-
\ No newline at end of file diff --git a/pages/EN_EN/partials/footer.php b/pages/EN_EN/partials/footer.php deleted file mode 100644 index 8c87596..0000000 --- a/pages/EN_EN/partials/footer.php +++ /dev/null @@ -1,28 +0,0 @@ - -
- -
\ No newline at end of file diff --git a/assets/media/Inner-page_cut_02.png b/public/assets/media/Inner-page_cut_02.png similarity index 100% rename from assets/media/Inner-page_cut_02.png rename to public/assets/media/Inner-page_cut_02.png diff --git a/assets/media/favicon.ico b/public/assets/media/favicon.ico similarity index 100% rename from assets/media/favicon.ico rename to public/assets/media/favicon.ico diff --git a/assets/media/loading.gif b/public/assets/media/loading.gif similarity index 100% rename from assets/media/loading.gif rename to public/assets/media/loading.gif diff --git a/assets/media/logo.gif b/public/assets/media/logo.gif similarity index 100% rename from assets/media/logo.gif rename to public/assets/media/logo.gif diff --git a/public/assets/media/spinner.gif b/public/assets/media/spinner.gif new file mode 100644 index 0000000..2ef2eda Binary files /dev/null and b/public/assets/media/spinner.gif differ diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..daa8dcd --- /dev/null +++ b/public/index.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/log.php b/public/log.php new file mode 100644 index 0000000..9296dc1 --- /dev/null +++ b/public/log.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/public/login.php b/public/login.php new file mode 100644 index 0000000..09c90e9 --- /dev/null +++ b/public/login.php @@ -0,0 +1,24 @@ + +
+ + + +
+ + +

Incorrect username or password

+
+ +
+
+ \ No newline at end of file diff --git a/public/shell.php b/public/shell.php new file mode 100644 index 0000000..76f1240 --- /dev/null +++ b/public/shell.php @@ -0,0 +1,60 @@ + + + + + + mydlink + + + + +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/src/Log.php b/src/Log.php new file mode 100644 index 0000000..b6ecbe2 --- /dev/null +++ b/src/Log.php @@ -0,0 +1,9 @@ +